All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.blockchainnodeengine.kotlin.BlockchainNodes.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.blockchainnodeengine.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.blockchainnodeengine.kotlin.outputs.BlockchainNodesConnectionInfo
import com.pulumi.gcp.blockchainnodeengine.kotlin.outputs.BlockchainNodesEthereumDetails
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.gcp.blockchainnodeengine.kotlin.outputs.BlockchainNodesConnectionInfo.Companion.toKotlin as blockchainNodesConnectionInfoToKotlin
import com.pulumi.gcp.blockchainnodeengine.kotlin.outputs.BlockchainNodesEthereumDetails.Companion.toKotlin as blockchainNodesEthereumDetailsToKotlin

/**
 * Builder for [BlockchainNodes].
 */
@PulumiTagMarker
public class BlockchainNodesResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: BlockchainNodesArgs = BlockchainNodesArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend BlockchainNodesArgsBuilder.() -> Unit) {
        val builder = BlockchainNodesArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): BlockchainNodes {
        val builtJavaResource =
            com.pulumi.gcp.blockchainnodeengine.BlockchainNodes(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return BlockchainNodes(builtJavaResource)
    }
}

/**
 * A representation of a blockchain node.
 * To get more information about BlockchainNodes, see:
 * * [API documentation](https://cloud.google.com/blockchain-node-engine/docs/reference/rest/v1/projects.locations.blockchainNodes)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/blockchain-node-engine)
 * ## Example Usage
 * ### Blockchain Nodes Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const defaultNode = new gcp.blockchainnodeengine.BlockchainNodes("default_node", {
 *     location: "us-central1",
 *     blockchainType: "ETHEREUM",
 *     blockchainNodeId: "blockchain_basic_node",
 *     ethereumDetails: {
 *         apiEnableAdmin: true,
 *         apiEnableDebug: true,
 *         validatorConfig: {
 *             mevRelayUrls: [
 *                 "https://mev1.example.org/",
 *                 "https://mev2.example.org/",
 *             ],
 *         },
 *         nodeType: "ARCHIVE",
 *         consensusClient: "LIGHTHOUSE",
 *         executionClient: "ERIGON",
 *         network: "MAINNET",
 *     },
 *     labels: {
 *         environment: "dev",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default_node = gcp.blockchainnodeengine.BlockchainNodes("default_node",
 *     location="us-central1",
 *     blockchain_type="ETHEREUM",
 *     blockchain_node_id="blockchain_basic_node",
 *     ethereum_details=gcp.blockchainnodeengine.BlockchainNodesEthereumDetailsArgs(
 *         api_enable_admin=True,
 *         api_enable_debug=True,
 *         validator_config=gcp.blockchainnodeengine.BlockchainNodesEthereumDetailsValidatorConfigArgs(
 *             mev_relay_urls=[
 *                 "https://mev1.example.org/",
 *                 "https://mev2.example.org/",
 *             ],
 *         ),
 *         node_type="ARCHIVE",
 *         consensus_client="LIGHTHOUSE",
 *         execution_client="ERIGON",
 *         network="MAINNET",
 *     ),
 *     labels={
 *         "environment": "dev",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var defaultNode = new Gcp.BlockchainNodeEngine.BlockchainNodes("default_node", new()
 *     {
 *         Location = "us-central1",
 *         BlockchainType = "ETHEREUM",
 *         BlockchainNodeId = "blockchain_basic_node",
 *         EthereumDetails = new Gcp.BlockchainNodeEngine.Inputs.BlockchainNodesEthereumDetailsArgs
 *         {
 *             ApiEnableAdmin = true,
 *             ApiEnableDebug = true,
 *             ValidatorConfig = new Gcp.BlockchainNodeEngine.Inputs.BlockchainNodesEthereumDetailsValidatorConfigArgs
 *             {
 *                 MevRelayUrls = new[]
 *                 {
 *                     "https://mev1.example.org/",
 *                     "https://mev2.example.org/",
 *                 },
 *             },
 *             NodeType = "ARCHIVE",
 *             ConsensusClient = "LIGHTHOUSE",
 *             ExecutionClient = "ERIGON",
 *             Network = "MAINNET",
 *         },
 *         Labels =
 *         {
 *             { "environment", "dev" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/blockchainnodeengine"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := blockchainnodeengine.NewBlockchainNodes(ctx, "default_node", &blockchainnodeengine.BlockchainNodesArgs{
 * 			Location:         pulumi.String("us-central1"),
 * 			BlockchainType:   pulumi.String("ETHEREUM"),
 * 			BlockchainNodeId: pulumi.String("blockchain_basic_node"),
 * 			EthereumDetails: &blockchainnodeengine.BlockchainNodesEthereumDetailsArgs{
 * 				ApiEnableAdmin: pulumi.Bool(true),
 * 				ApiEnableDebug: pulumi.Bool(true),
 * 				ValidatorConfig: &blockchainnodeengine.BlockchainNodesEthereumDetailsValidatorConfigArgs{
 * 					MevRelayUrls: pulumi.StringArray{
 * 						pulumi.String("https://mev1.example.org/"),
 * 						pulumi.String("https://mev2.example.org/"),
 * 					},
 * 				},
 * 				NodeType:        pulumi.String("ARCHIVE"),
 * 				ConsensusClient: pulumi.String("LIGHTHOUSE"),
 * 				ExecutionClient: pulumi.String("ERIGON"),
 * 				Network:         pulumi.String("MAINNET"),
 * 			},
 * 			Labels: pulumi.StringMap{
 * 				"environment": pulumi.String("dev"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.blockchainnodeengine.BlockchainNodes;
 * import com.pulumi.gcp.blockchainnodeengine.BlockchainNodesArgs;
 * import com.pulumi.gcp.blockchainnodeengine.inputs.BlockchainNodesEthereumDetailsArgs;
 * import com.pulumi.gcp.blockchainnodeengine.inputs.BlockchainNodesEthereumDetailsValidatorConfigArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var defaultNode = new BlockchainNodes("defaultNode", BlockchainNodesArgs.builder()
 *             .location("us-central1")
 *             .blockchainType("ETHEREUM")
 *             .blockchainNodeId("blockchain_basic_node")
 *             .ethereumDetails(BlockchainNodesEthereumDetailsArgs.builder()
 *                 .apiEnableAdmin(true)
 *                 .apiEnableDebug(true)
 *                 .validatorConfig(BlockchainNodesEthereumDetailsValidatorConfigArgs.builder()
 *                     .mevRelayUrls(
 *                         "https://mev1.example.org/",
 *                         "https://mev2.example.org/")
 *                     .build())
 *                 .nodeType("ARCHIVE")
 *                 .consensusClient("LIGHTHOUSE")
 *                 .executionClient("ERIGON")
 *                 .network("MAINNET")
 *                 .build())
 *             .labels(Map.of("environment", "dev"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   defaultNode:
 *     type: gcp:blockchainnodeengine:BlockchainNodes
 *     name: default_node
 *     properties:
 *       location: us-central1
 *       blockchainType: ETHEREUM
 *       blockchainNodeId: blockchain_basic_node
 *       ethereumDetails:
 *         apiEnableAdmin: true
 *         apiEnableDebug: true
 *         validatorConfig:
 *           mevRelayUrls:
 *             - https://mev1.example.org/
 *             - https://mev2.example.org/
 *         nodeType: ARCHIVE
 *         consensusClient: LIGHTHOUSE
 *         executionClient: ERIGON
 *         network: MAINNET
 *       labels:
 *         environment: dev
 * ```
 * 
 * ### Blockchain Nodes Geth Details
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const defaultNodeGeth = new gcp.blockchainnodeengine.BlockchainNodes("default_node_geth", {
 *     location: "us-central1",
 *     blockchainType: "ETHEREUM",
 *     blockchainNodeId: "blockchain_geth_node",
 *     ethereumDetails: {
 *         apiEnableAdmin: true,
 *         apiEnableDebug: true,
 *         validatorConfig: {
 *             mevRelayUrls: [
 *                 "https://mev1.example.org/",
 *                 "https://mev2.example.org/",
 *             ],
 *         },
 *         nodeType: "FULL",
 *         consensusClient: "LIGHTHOUSE",
 *         executionClient: "GETH",
 *         network: "MAINNET",
 *         gethDetails: {
 *             garbageCollectionMode: "FULL",
 *         },
 *     },
 *     labels: {
 *         environment: "dev",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default_node_geth = gcp.blockchainnodeengine.BlockchainNodes("default_node_geth",
 *     location="us-central1",
 *     blockchain_type="ETHEREUM",
 *     blockchain_node_id="blockchain_geth_node",
 *     ethereum_details=gcp.blockchainnodeengine.BlockchainNodesEthereumDetailsArgs(
 *         api_enable_admin=True,
 *         api_enable_debug=True,
 *         validator_config=gcp.blockchainnodeengine.BlockchainNodesEthereumDetailsValidatorConfigArgs(
 *             mev_relay_urls=[
 *                 "https://mev1.example.org/",
 *                 "https://mev2.example.org/",
 *             ],
 *         ),
 *         node_type="FULL",
 *         consensus_client="LIGHTHOUSE",
 *         execution_client="GETH",
 *         network="MAINNET",
 *         geth_details=gcp.blockchainnodeengine.BlockchainNodesEthereumDetailsGethDetailsArgs(
 *             garbage_collection_mode="FULL",
 *         ),
 *     ),
 *     labels={
 *         "environment": "dev",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var defaultNodeGeth = new Gcp.BlockchainNodeEngine.BlockchainNodes("default_node_geth", new()
 *     {
 *         Location = "us-central1",
 *         BlockchainType = "ETHEREUM",
 *         BlockchainNodeId = "blockchain_geth_node",
 *         EthereumDetails = new Gcp.BlockchainNodeEngine.Inputs.BlockchainNodesEthereumDetailsArgs
 *         {
 *             ApiEnableAdmin = true,
 *             ApiEnableDebug = true,
 *             ValidatorConfig = new Gcp.BlockchainNodeEngine.Inputs.BlockchainNodesEthereumDetailsValidatorConfigArgs
 *             {
 *                 MevRelayUrls = new[]
 *                 {
 *                     "https://mev1.example.org/",
 *                     "https://mev2.example.org/",
 *                 },
 *             },
 *             NodeType = "FULL",
 *             ConsensusClient = "LIGHTHOUSE",
 *             ExecutionClient = "GETH",
 *             Network = "MAINNET",
 *             GethDetails = new Gcp.BlockchainNodeEngine.Inputs.BlockchainNodesEthereumDetailsGethDetailsArgs
 *             {
 *                 GarbageCollectionMode = "FULL",
 *             },
 *         },
 *         Labels =
 *         {
 *             { "environment", "dev" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/blockchainnodeengine"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := blockchainnodeengine.NewBlockchainNodes(ctx, "default_node_geth", &blockchainnodeengine.BlockchainNodesArgs{
 * 			Location:         pulumi.String("us-central1"),
 * 			BlockchainType:   pulumi.String("ETHEREUM"),
 * 			BlockchainNodeId: pulumi.String("blockchain_geth_node"),
 * 			EthereumDetails: &blockchainnodeengine.BlockchainNodesEthereumDetailsArgs{
 * 				ApiEnableAdmin: pulumi.Bool(true),
 * 				ApiEnableDebug: pulumi.Bool(true),
 * 				ValidatorConfig: &blockchainnodeengine.BlockchainNodesEthereumDetailsValidatorConfigArgs{
 * 					MevRelayUrls: pulumi.StringArray{
 * 						pulumi.String("https://mev1.example.org/"),
 * 						pulumi.String("https://mev2.example.org/"),
 * 					},
 * 				},
 * 				NodeType:        pulumi.String("FULL"),
 * 				ConsensusClient: pulumi.String("LIGHTHOUSE"),
 * 				ExecutionClient: pulumi.String("GETH"),
 * 				Network:         pulumi.String("MAINNET"),
 * 				GethDetails: &blockchainnodeengine.BlockchainNodesEthereumDetailsGethDetailsArgs{
 * 					GarbageCollectionMode: pulumi.String("FULL"),
 * 				},
 * 			},
 * 			Labels: pulumi.StringMap{
 * 				"environment": pulumi.String("dev"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.blockchainnodeengine.BlockchainNodes;
 * import com.pulumi.gcp.blockchainnodeengine.BlockchainNodesArgs;
 * import com.pulumi.gcp.blockchainnodeengine.inputs.BlockchainNodesEthereumDetailsArgs;
 * import com.pulumi.gcp.blockchainnodeengine.inputs.BlockchainNodesEthereumDetailsValidatorConfigArgs;
 * import com.pulumi.gcp.blockchainnodeengine.inputs.BlockchainNodesEthereumDetailsGethDetailsArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var defaultNodeGeth = new BlockchainNodes("defaultNodeGeth", BlockchainNodesArgs.builder()
 *             .location("us-central1")
 *             .blockchainType("ETHEREUM")
 *             .blockchainNodeId("blockchain_geth_node")
 *             .ethereumDetails(BlockchainNodesEthereumDetailsArgs.builder()
 *                 .apiEnableAdmin(true)
 *                 .apiEnableDebug(true)
 *                 .validatorConfig(BlockchainNodesEthereumDetailsValidatorConfigArgs.builder()
 *                     .mevRelayUrls(
 *                         "https://mev1.example.org/",
 *                         "https://mev2.example.org/")
 *                     .build())
 *                 .nodeType("FULL")
 *                 .consensusClient("LIGHTHOUSE")
 *                 .executionClient("GETH")
 *                 .network("MAINNET")
 *                 .gethDetails(BlockchainNodesEthereumDetailsGethDetailsArgs.builder()
 *                     .garbageCollectionMode("FULL")
 *                     .build())
 *                 .build())
 *             .labels(Map.of("environment", "dev"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   defaultNodeGeth:
 *     type: gcp:blockchainnodeengine:BlockchainNodes
 *     name: default_node_geth
 *     properties:
 *       location: us-central1
 *       blockchainType: ETHEREUM
 *       blockchainNodeId: blockchain_geth_node
 *       ethereumDetails:
 *         apiEnableAdmin: true
 *         apiEnableDebug: true
 *         validatorConfig:
 *           mevRelayUrls:
 *             - https://mev1.example.org/
 *             - https://mev2.example.org/
 *         nodeType: FULL
 *         consensusClient: LIGHTHOUSE
 *         executionClient: GETH
 *         network: MAINNET
 *         gethDetails:
 *           garbageCollectionMode: FULL
 *       labels:
 *         environment: dev
 * ```
 * 
 * ## Import
 * BlockchainNodes can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/blockchainNodes/{{blockchain_node_id}}`
 * * `{{project}}/{{location}}/{{blockchain_node_id}}`
 * * `{{location}}/{{blockchain_node_id}}`
 * When using the `pulumi import` command, BlockchainNodes can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:blockchainnodeengine/blockchainNodes:BlockchainNodes default projects/{{project}}/locations/{{location}}/blockchainNodes/{{blockchain_node_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:blockchainnodeengine/blockchainNodes:BlockchainNodes default {{project}}/{{location}}/{{blockchain_node_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:blockchainnodeengine/blockchainNodes:BlockchainNodes default {{location}}/{{blockchain_node_id}}
 * ```
 */
public class BlockchainNodes internal constructor(
    override val javaResource: com.pulumi.gcp.blockchainnodeengine.BlockchainNodes,
) : KotlinCustomResource(javaResource, BlockchainNodesMapper) {
    /**
     * ID of the requesting object.
     * - - -
     */
    public val blockchainNodeId: Output
        get() = javaResource.blockchainNodeId().applyValue({ args0 -> args0 })

    /**
     * User-provided key-value pairs
     * Possible values are: `ETHEREUM`.
     */
    public val blockchainType: Output?
        get() = javaResource.blockchainType().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The connection information through which to interact with a blockchain node.
     * Structure is documented below.
     */
    public val connectionInfos: Output>
        get() = javaResource.connectionInfos().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> blockchainNodesConnectionInfoToKotlin(args0) })
            })
        })

    /**
     * The timestamp at which the blockchain node was first created.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
     */
    public val effectiveLabels: Output>
        get() = javaResource.effectiveLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * User-provided key-value pairs
     * Structure is documented below.
     */
    public val ethereumDetails: Output?
        get() = javaResource.ethereumDetails().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> blockchainNodesEthereumDetailsToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * User-provided key-value pairs
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    public val labels: Output>?
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * Location of Blockchain Node being created.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * The fully qualified name of the blockchain node. e.g. projects/my-project/locations/us-central1/blockchainNodes/my-node.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * The combination of labels configured directly on the resource
     * and default labels configured on the provider.
     */
    public val pulumiLabels: Output>
        get() = javaResource.pulumiLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * The timestamp at which the blockchain node was last updated.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object BlockchainNodesMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.blockchainnodeengine.BlockchainNodes::class == javaResource::class

    override fun map(javaResource: Resource): BlockchainNodes = BlockchainNodes(
        javaResource as
            com.pulumi.gcp.blockchainnodeengine.BlockchainNodes,
    )
}

/**
 * @see [BlockchainNodes].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [BlockchainNodes].
 */
public suspend fun blockchainNodes(
    name: String,
    block: suspend BlockchainNodesResourceBuilder.() -> Unit,
): BlockchainNodes {
    val builder = BlockchainNodesResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [BlockchainNodes].
 * @param name The _unique_ name of the resulting resource.
 */
public fun blockchainNodes(name: String): BlockchainNodes {
    val builder = BlockchainNodesResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy