Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.gcp.edgecontainer.kotlin.NodePoolArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.edgecontainer.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.edgecontainer.NodePoolArgs.builder
import com.pulumi.gcp.edgecontainer.kotlin.inputs.NodePoolLocalDiskEncryptionArgs
import com.pulumi.gcp.edgecontainer.kotlin.inputs.NodePoolLocalDiskEncryptionArgsBuilder
import com.pulumi.gcp.edgecontainer.kotlin.inputs.NodePoolNodeConfigArgs
import com.pulumi.gcp.edgecontainer.kotlin.inputs.NodePoolNodeConfigArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* "A set of Kubernetes nodes in a cluster with common configuration and specification."
* To get more information about NodePool, see:
* * [API documentation](https://cloud.google.com/distributed-cloud/edge/latest/docs/reference/container/rest/v1/projects.locations.clusters.nodePools)
* * How-to Guides
* * [Google Distributed Cloud Edge](https://cloud.google.com/distributed-cloud/edge/latest/docs)
* ## Example Usage
* ### Edgecontainer Node Pool
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const project = gcp.organizations.getProject({});
* const cluster = new gcp.edgecontainer.Cluster("cluster", {
* name: "default",
* location: "us-central1",
* authorization: {
* adminUsers: {
* username: "[email protected] ",
* },
* },
* networking: {
* clusterIpv4CidrBlocks: ["10.0.0.0/16"],
* servicesIpv4CidrBlocks: ["10.1.0.0/16"],
* },
* fleet: {
* project: project.then(project => `projects/${project.number}`),
* },
* });
* const _default = new gcp.edgecontainer.NodePool("default", {
* name: "nodepool-1",
* cluster: cluster.name,
* location: "us-central1",
* nodeLocation: "us-central1-edge-example-edgesite",
* nodeCount: 3,
* labels: {
* my_key: "my_val",
* other_key: "other_val",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* project = gcp.organizations.get_project()
* cluster = gcp.edgecontainer.Cluster("cluster",
* name="default",
* location="us-central1",
* authorization={
* "admin_users": {
* "username": "[email protected] ",
* },
* },
* networking={
* "cluster_ipv4_cidr_blocks": ["10.0.0.0/16"],
* "services_ipv4_cidr_blocks": ["10.1.0.0/16"],
* },
* fleet={
* "project": f"projects/{project.number}",
* })
* default = gcp.edgecontainer.NodePool("default",
* name="nodepool-1",
* cluster=cluster.name,
* location="us-central1",
* node_location="us-central1-edge-example-edgesite",
* node_count=3,
* labels={
* "my_key": "my_val",
* "other_key": "other_val",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var project = Gcp.Organizations.GetProject.Invoke();
* var cluster = new Gcp.EdgeContainer.Cluster("cluster", new()
* {
* Name = "default",
* Location = "us-central1",
* Authorization = new Gcp.EdgeContainer.Inputs.ClusterAuthorizationArgs
* {
* AdminUsers = new Gcp.EdgeContainer.Inputs.ClusterAuthorizationAdminUsersArgs
* {
* Username = "[email protected] ",
* },
* },
* Networking = new Gcp.EdgeContainer.Inputs.ClusterNetworkingArgs
* {
* ClusterIpv4CidrBlocks = new[]
* {
* "10.0.0.0/16",
* },
* ServicesIpv4CidrBlocks = new[]
* {
* "10.1.0.0/16",
* },
* },
* Fleet = new Gcp.EdgeContainer.Inputs.ClusterFleetArgs
* {
* Project = $"projects/{project.Apply(getProjectResult => getProjectResult.Number)}",
* },
* });
* var @default = new Gcp.EdgeContainer.NodePool("default", new()
* {
* Name = "nodepool-1",
* Cluster = cluster.Name,
* Location = "us-central1",
* NodeLocation = "us-central1-edge-example-edgesite",
* NodeCount = 3,
* Labels =
* {
* { "my_key", "my_val" },
* { "other_key", "other_val" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/edgecontainer"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* project, err := organizations.LookupProject(ctx, nil, nil)
* if err != nil {
* return err
* }
* cluster, err := edgecontainer.NewCluster(ctx, "cluster", &edgecontainer.ClusterArgs{
* Name: pulumi.String("default"),
* Location: pulumi.String("us-central1"),
* Authorization: &edgecontainer.ClusterAuthorizationArgs{
* AdminUsers: &edgecontainer.ClusterAuthorizationAdminUsersArgs{
* Username: pulumi.String("[email protected] "),
* },
* },
* Networking: &edgecontainer.ClusterNetworkingArgs{
* ClusterIpv4CidrBlocks: pulumi.StringArray{
* pulumi.String("10.0.0.0/16"),
* },
* ServicesIpv4CidrBlocks: pulumi.StringArray{
* pulumi.String("10.1.0.0/16"),
* },
* },
* Fleet: &edgecontainer.ClusterFleetArgs{
* Project: pulumi.Sprintf("projects/%v", project.Number),
* },
* })
* if err != nil {
* return err
* }
* _, err = edgecontainer.NewNodePool(ctx, "default", &edgecontainer.NodePoolArgs{
* Name: pulumi.String("nodepool-1"),
* Cluster: cluster.Name,
* Location: pulumi.String("us-central1"),
* NodeLocation: pulumi.String("us-central1-edge-example-edgesite"),
* NodeCount: pulumi.Int(3),
* Labels: pulumi.StringMap{
* "my_key": pulumi.String("my_val"),
* "other_key": pulumi.String("other_val"),
* },
* })
* 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.organizations.OrganizationsFunctions;
* import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
* import com.pulumi.gcp.edgecontainer.Cluster;
* import com.pulumi.gcp.edgecontainer.ClusterArgs;
* import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationArgs;
* import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationAdminUsersArgs;
* import com.pulumi.gcp.edgecontainer.inputs.ClusterNetworkingArgs;
* import com.pulumi.gcp.edgecontainer.inputs.ClusterFleetArgs;
* import com.pulumi.gcp.edgecontainer.NodePool;
* import com.pulumi.gcp.edgecontainer.NodePoolArgs;
* 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) {
* final var project = OrganizationsFunctions.getProject();
* var cluster = new Cluster("cluster", ClusterArgs.builder()
* .name("default")
* .location("us-central1")
* .authorization(ClusterAuthorizationArgs.builder()
* .adminUsers(ClusterAuthorizationAdminUsersArgs.builder()
* .username("[email protected] ")
* .build())
* .build())
* .networking(ClusterNetworkingArgs.builder()
* .clusterIpv4CidrBlocks("10.0.0.0/16")
* .servicesIpv4CidrBlocks("10.1.0.0/16")
* .build())
* .fleet(ClusterFleetArgs.builder()
* .project(String.format("projects/%s", project.applyValue(getProjectResult -> getProjectResult.number())))
* .build())
* .build());
* var default_ = new NodePool("default", NodePoolArgs.builder()
* .name("nodepool-1")
* .cluster(cluster.name())
* .location("us-central1")
* .nodeLocation("us-central1-edge-example-edgesite")
* .nodeCount(3)
* .labels(Map.ofEntries(
* Map.entry("my_key", "my_val"),
* Map.entry("other_key", "other_val")
* ))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* cluster:
* type: gcp:edgecontainer:Cluster
* properties:
* name: default
* location: us-central1
* authorization:
* adminUsers:
* username: [email protected]
* networking:
* clusterIpv4CidrBlocks:
* - 10.0.0.0/16
* servicesIpv4CidrBlocks:
* - 10.1.0.0/16
* fleet:
* project: projects/${project.number}
* default:
* type: gcp:edgecontainer:NodePool
* properties:
* name: nodepool-1
* cluster: ${cluster.name}
* location: us-central1
* nodeLocation: us-central1-edge-example-edgesite
* nodeCount: 3
* labels:
* my_key: my_val
* other_key: other_val
* variables:
* project:
* fn::invoke:
* Function: gcp:organizations:getProject
* Arguments: {}
* ```
*
* ### Edgecontainer Node Pool With Cmek
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const project = gcp.organizations.getProject({});
* const cluster = new gcp.edgecontainer.Cluster("cluster", {
* name: "default",
* location: "us-central1",
* authorization: {
* adminUsers: {
* username: "[email protected] ",
* },
* },
* networking: {
* clusterIpv4CidrBlocks: ["10.0.0.0/16"],
* servicesIpv4CidrBlocks: ["10.1.0.0/16"],
* },
* fleet: {
* project: project.then(project => `projects/${project.number}`),
* },
* });
* const keyRing = new gcp.kms.KeyRing("key_ring", {
* name: "keyring",
* location: "us-central1",
* });
* const cryptoKeyCryptoKey = new gcp.kms.CryptoKey("crypto_key", {
* name: "key",
* keyRing: keyRing.id,
* });
* const cryptoKey = new gcp.kms.CryptoKeyIAMMember("crypto_key", {
* cryptoKeyId: cryptoKeyCryptoKey.id,
* role: "roles/cloudkms.cryptoKeyEncrypterDecrypter",
* member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-edgecontainer.iam.gserviceaccount.com`),
* });
* const _default = new gcp.edgecontainer.NodePool("default", {
* name: "nodepool-1",
* cluster: cluster.name,
* location: "us-central1",
* nodeLocation: "us-central1-edge-example-edgesite",
* nodeCount: 3,
* localDiskEncryption: {
* kmsKey: cryptoKeyCryptoKey.id,
* },
* }, {
* dependsOn: [cryptoKey],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* project = gcp.organizations.get_project()
* cluster = gcp.edgecontainer.Cluster("cluster",
* name="default",
* location="us-central1",
* authorization={
* "admin_users": {
* "username": "[email protected] ",
* },
* },
* networking={
* "cluster_ipv4_cidr_blocks": ["10.0.0.0/16"],
* "services_ipv4_cidr_blocks": ["10.1.0.0/16"],
* },
* fleet={
* "project": f"projects/{project.number}",
* })
* key_ring = gcp.kms.KeyRing("key_ring",
* name="keyring",
* location="us-central1")
* crypto_key_crypto_key = gcp.kms.CryptoKey("crypto_key",
* name="key",
* key_ring=key_ring.id)
* crypto_key = gcp.kms.CryptoKeyIAMMember("crypto_key",
* crypto_key_id=crypto_key_crypto_key.id,
* role="roles/cloudkms.cryptoKeyEncrypterDecrypter",
* member=f"serviceAccount:service-{project.number}@gcp-sa-edgecontainer.iam.gserviceaccount.com")
* default = gcp.edgecontainer.NodePool("default",
* name="nodepool-1",
* cluster=cluster.name,
* location="us-central1",
* node_location="us-central1-edge-example-edgesite",
* node_count=3,
* local_disk_encryption={
* "kms_key": crypto_key_crypto_key.id,
* },
* opts = pulumi.ResourceOptions(depends_on=[crypto_key]))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var project = Gcp.Organizations.GetProject.Invoke();
* var cluster = new Gcp.EdgeContainer.Cluster("cluster", new()
* {
* Name = "default",
* Location = "us-central1",
* Authorization = new Gcp.EdgeContainer.Inputs.ClusterAuthorizationArgs
* {
* AdminUsers = new Gcp.EdgeContainer.Inputs.ClusterAuthorizationAdminUsersArgs
* {
* Username = "[email protected] ",
* },
* },
* Networking = new Gcp.EdgeContainer.Inputs.ClusterNetworkingArgs
* {
* ClusterIpv4CidrBlocks = new[]
* {
* "10.0.0.0/16",
* },
* ServicesIpv4CidrBlocks = new[]
* {
* "10.1.0.0/16",
* },
* },
* Fleet = new Gcp.EdgeContainer.Inputs.ClusterFleetArgs
* {
* Project = $"projects/{project.Apply(getProjectResult => getProjectResult.Number)}",
* },
* });
* var keyRing = new Gcp.Kms.KeyRing("key_ring", new()
* {
* Name = "keyring",
* Location = "us-central1",
* });
* var cryptoKeyCryptoKey = new Gcp.Kms.CryptoKey("crypto_key", new()
* {
* Name = "key",
* KeyRing = keyRing.Id,
* });
* var cryptoKey = new Gcp.Kms.CryptoKeyIAMMember("crypto_key", new()
* {
* CryptoKeyId = cryptoKeyCryptoKey.Id,
* Role = "roles/cloudkms.cryptoKeyEncrypterDecrypter",
* Member = $"serviceAccount:service-{project.Apply(getProjectResult => getProjectResult.Number)}@gcp-sa-edgecontainer.iam.gserviceaccount.com",
* });
* var @default = new Gcp.EdgeContainer.NodePool("default", new()
* {
* Name = "nodepool-1",
* Cluster = cluster.Name,
* Location = "us-central1",
* NodeLocation = "us-central1-edge-example-edgesite",
* NodeCount = 3,
* LocalDiskEncryption = new Gcp.EdgeContainer.Inputs.NodePoolLocalDiskEncryptionArgs
* {
* KmsKey = cryptoKeyCryptoKey.Id,
* },
* }, new CustomResourceOptions
* {
* DependsOn =
* {
* cryptoKey,
* },
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/edgecontainer"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/kms"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* project, err := organizations.LookupProject(ctx, nil, nil)
* if err != nil {
* return err
* }
* cluster, err := edgecontainer.NewCluster(ctx, "cluster", &edgecontainer.ClusterArgs{
* Name: pulumi.String("default"),
* Location: pulumi.String("us-central1"),
* Authorization: &edgecontainer.ClusterAuthorizationArgs{
* AdminUsers: &edgecontainer.ClusterAuthorizationAdminUsersArgs{
* Username: pulumi.String("[email protected] "),
* },
* },
* Networking: &edgecontainer.ClusterNetworkingArgs{
* ClusterIpv4CidrBlocks: pulumi.StringArray{
* pulumi.String("10.0.0.0/16"),
* },
* ServicesIpv4CidrBlocks: pulumi.StringArray{
* pulumi.String("10.1.0.0/16"),
* },
* },
* Fleet: &edgecontainer.ClusterFleetArgs{
* Project: pulumi.Sprintf("projects/%v", project.Number),
* },
* })
* if err != nil {
* return err
* }
* keyRing, err := kms.NewKeyRing(ctx, "key_ring", &kms.KeyRingArgs{
* Name: pulumi.String("keyring"),
* Location: pulumi.String("us-central1"),
* })
* if err != nil {
* return err
* }
* cryptoKeyCryptoKey, err := kms.NewCryptoKey(ctx, "crypto_key", &kms.CryptoKeyArgs{
* Name: pulumi.String("key"),
* KeyRing: keyRing.ID(),
* })
* if err != nil {
* return err
* }
* cryptoKey, err := kms.NewCryptoKeyIAMMember(ctx, "crypto_key", &kms.CryptoKeyIAMMemberArgs{
* CryptoKeyId: cryptoKeyCryptoKey.ID(),
* Role: pulumi.String("roles/cloudkms.cryptoKeyEncrypterDecrypter"),
* Member: pulumi.Sprintf("serviceAccount:service-%[email protected] ", project.Number),
* })
* if err != nil {
* return err
* }
* _, err = edgecontainer.NewNodePool(ctx, "default", &edgecontainer.NodePoolArgs{
* Name: pulumi.String("nodepool-1"),
* Cluster: cluster.Name,
* Location: pulumi.String("us-central1"),
* NodeLocation: pulumi.String("us-central1-edge-example-edgesite"),
* NodeCount: pulumi.Int(3),
* LocalDiskEncryption: &edgecontainer.NodePoolLocalDiskEncryptionArgs{
* KmsKey: cryptoKeyCryptoKey.ID(),
* },
* }, pulumi.DependsOn([]pulumi.Resource{
* cryptoKey,
* }))
* 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.organizations.OrganizationsFunctions;
* import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
* import com.pulumi.gcp.edgecontainer.Cluster;
* import com.pulumi.gcp.edgecontainer.ClusterArgs;
* import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationArgs;
* import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationAdminUsersArgs;
* import com.pulumi.gcp.edgecontainer.inputs.ClusterNetworkingArgs;
* import com.pulumi.gcp.edgecontainer.inputs.ClusterFleetArgs;
* import com.pulumi.gcp.kms.KeyRing;
* import com.pulumi.gcp.kms.KeyRingArgs;
* import com.pulumi.gcp.kms.CryptoKey;
* import com.pulumi.gcp.kms.CryptoKeyArgs;
* import com.pulumi.gcp.kms.CryptoKeyIAMMember;
* import com.pulumi.gcp.kms.CryptoKeyIAMMemberArgs;
* import com.pulumi.gcp.edgecontainer.NodePool;
* import com.pulumi.gcp.edgecontainer.NodePoolArgs;
* import com.pulumi.gcp.edgecontainer.inputs.NodePoolLocalDiskEncryptionArgs;
* import com.pulumi.resources.CustomResourceOptions;
* 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) {
* final var project = OrganizationsFunctions.getProject();
* var cluster = new Cluster("cluster", ClusterArgs.builder()
* .name("default")
* .location("us-central1")
* .authorization(ClusterAuthorizationArgs.builder()
* .adminUsers(ClusterAuthorizationAdminUsersArgs.builder()
* .username("[email protected] ")
* .build())
* .build())
* .networking(ClusterNetworkingArgs.builder()
* .clusterIpv4CidrBlocks("10.0.0.0/16")
* .servicesIpv4CidrBlocks("10.1.0.0/16")
* .build())
* .fleet(ClusterFleetArgs.builder()
* .project(String.format("projects/%s", project.applyValue(getProjectResult -> getProjectResult.number())))
* .build())
* .build());
* var keyRing = new KeyRing("keyRing", KeyRingArgs.builder()
* .name("keyring")
* .location("us-central1")
* .build());
* var cryptoKeyCryptoKey = new CryptoKey("cryptoKeyCryptoKey", CryptoKeyArgs.builder()
* .name("key")
* .keyRing(keyRing.id())
* .build());
* var cryptoKey = new CryptoKeyIAMMember("cryptoKey", CryptoKeyIAMMemberArgs.builder()
* .cryptoKeyId(cryptoKeyCryptoKey.id())
* .role("roles/cloudkms.cryptoKeyEncrypterDecrypter")
* .member(String.format("serviceAccount:service-%[email protected] ", project.applyValue(getProjectResult -> getProjectResult.number())))
* .build());
* var default_ = new NodePool("default", NodePoolArgs.builder()
* .name("nodepool-1")
* .cluster(cluster.name())
* .location("us-central1")
* .nodeLocation("us-central1-edge-example-edgesite")
* .nodeCount(3)
* .localDiskEncryption(NodePoolLocalDiskEncryptionArgs.builder()
* .kmsKey(cryptoKeyCryptoKey.id())
* .build())
* .build(), CustomResourceOptions.builder()
* .dependsOn(cryptoKey)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* cluster:
* type: gcp:edgecontainer:Cluster
* properties:
* name: default
* location: us-central1
* authorization:
* adminUsers:
* username: [email protected]
* networking:
* clusterIpv4CidrBlocks:
* - 10.0.0.0/16
* servicesIpv4CidrBlocks:
* - 10.1.0.0/16
* fleet:
* project: projects/${project.number}
* cryptoKey:
* type: gcp:kms:CryptoKeyIAMMember
* name: crypto_key
* properties:
* cryptoKeyId: ${cryptoKeyCryptoKey.id}
* role: roles/cloudkms.cryptoKeyEncrypterDecrypter
* member: serviceAccount:service-${project.number}@gcp-sa-edgecontainer.iam.gserviceaccount.com
* cryptoKeyCryptoKey:
* type: gcp:kms:CryptoKey
* name: crypto_key
* properties:
* name: key
* keyRing: ${keyRing.id}
* keyRing:
* type: gcp:kms:KeyRing
* name: key_ring
* properties:
* name: keyring
* location: us-central1
* default:
* type: gcp:edgecontainer:NodePool
* properties:
* name: nodepool-1
* cluster: ${cluster.name}
* location: us-central1
* nodeLocation: us-central1-edge-example-edgesite
* nodeCount: 3
* localDiskEncryption:
* kmsKey: ${cryptoKeyCryptoKey.id}
* options:
* dependson:
* - ${cryptoKey}
* variables:
* project:
* fn::invoke:
* Function: gcp:organizations:getProject
* Arguments: {}
* ```
*
* ### Edgecontainer Local Control Plane Node Pool
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const project = gcp.organizations.getProject({});
* const _default = new gcp.edgecontainer.Cluster("default", {
* name: "",
* location: "us-central1",
* authorization: {
* adminUsers: {
* username: "[email protected] ",
* },
* },
* networking: {
* clusterIpv4CidrBlocks: ["10.0.0.0/16"],
* servicesIpv4CidrBlocks: ["10.1.0.0/16"],
* },
* fleet: {
* project: project.then(project => `projects/${project.number}`),
* },
* externalLoadBalancerIpv4AddressPools: ["10.100.0.0-10.100.0.10"],
* controlPlane: {
* local: {
* nodeLocation: "us-central1-edge-example-edgesite",
* nodeCount: 1,
* machineFilter: "machine-name",
* sharedDeploymentPolicy: "ALLOWED",
* },
* },
* });
* const defaultNodePool = new gcp.edgecontainer.NodePool("default", {
* name: "nodepool-1",
* cluster: cluster.name,
* location: "us-central1",
* nodeLocation: "us-central1-edge-example-edgesite",
* nodeCount: 3,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* project = gcp.organizations.get_project()
* default = gcp.edgecontainer.Cluster("default",
* name="",
* location="us-central1",
* authorization={
* "admin_users": {
* "username": "[email protected] ",
* },
* },
* networking={
* "cluster_ipv4_cidr_blocks": ["10.0.0.0/16"],
* "services_ipv4_cidr_blocks": ["10.1.0.0/16"],
* },
* fleet={
* "project": f"projects/{project.number}",
* },
* external_load_balancer_ipv4_address_pools=["10.100.0.0-10.100.0.10"],
* control_plane={
* "local": {
* "node_location": "us-central1-edge-example-edgesite",
* "node_count": 1,
* "machine_filter": "machine-name",
* "shared_deployment_policy": "ALLOWED",
* },
* })
* default_node_pool = gcp.edgecontainer.NodePool("default",
* name="nodepool-1",
* cluster=cluster["name"],
* location="us-central1",
* node_location="us-central1-edge-example-edgesite",
* node_count=3)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var project = Gcp.Organizations.GetProject.Invoke();
* var @default = new Gcp.EdgeContainer.Cluster("default", new()
* {
* Name = "",
* Location = "us-central1",
* Authorization = new Gcp.EdgeContainer.Inputs.ClusterAuthorizationArgs
* {
* AdminUsers = new Gcp.EdgeContainer.Inputs.ClusterAuthorizationAdminUsersArgs
* {
* Username = "[email protected] ",
* },
* },
* Networking = new Gcp.EdgeContainer.Inputs.ClusterNetworkingArgs
* {
* ClusterIpv4CidrBlocks = new[]
* {
* "10.0.0.0/16",
* },
* ServicesIpv4CidrBlocks = new[]
* {
* "10.1.0.0/16",
* },
* },
* Fleet = new Gcp.EdgeContainer.Inputs.ClusterFleetArgs
* {
* Project = $"projects/{project.Apply(getProjectResult => getProjectResult.Number)}",
* },
* ExternalLoadBalancerIpv4AddressPools = new[]
* {
* "10.100.0.0-10.100.0.10",
* },
* ControlPlane = new Gcp.EdgeContainer.Inputs.ClusterControlPlaneArgs
* {
* Local = new Gcp.EdgeContainer.Inputs.ClusterControlPlaneLocalArgs
* {
* NodeLocation = "us-central1-edge-example-edgesite",
* NodeCount = 1,
* MachineFilter = "machine-name",
* SharedDeploymentPolicy = "ALLOWED",
* },
* },
* });
* var defaultNodePool = new Gcp.EdgeContainer.NodePool("default", new()
* {
* Name = "nodepool-1",
* Cluster = cluster.Name,
* Location = "us-central1",
* NodeLocation = "us-central1-edge-example-edgesite",
* NodeCount = 3,
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/edgecontainer"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* project, err := organizations.LookupProject(ctx, nil, nil)
* if err != nil {
* return err
* }
* _, err = edgecontainer.NewCluster(ctx, "default", &edgecontainer.ClusterArgs{
* Name: pulumi.String(""),
* Location: pulumi.String("us-central1"),
* Authorization: &edgecontainer.ClusterAuthorizationArgs{
* AdminUsers: &edgecontainer.ClusterAuthorizationAdminUsersArgs{
* Username: pulumi.String("[email protected] "),
* },
* },
* Networking: &edgecontainer.ClusterNetworkingArgs{
* ClusterIpv4CidrBlocks: pulumi.StringArray{
* pulumi.String("10.0.0.0/16"),
* },
* ServicesIpv4CidrBlocks: pulumi.StringArray{
* pulumi.String("10.1.0.0/16"),
* },
* },
* Fleet: &edgecontainer.ClusterFleetArgs{
* Project: pulumi.Sprintf("projects/%v", project.Number),
* },
* ExternalLoadBalancerIpv4AddressPools: pulumi.StringArray{
* pulumi.String("10.100.0.0-10.100.0.10"),
* },
* ControlPlane: &edgecontainer.ClusterControlPlaneArgs{
* Local: &edgecontainer.ClusterControlPlaneLocalArgs{
* NodeLocation: pulumi.String("us-central1-edge-example-edgesite"),
* NodeCount: pulumi.Int(1),
* MachineFilter: pulumi.String("machine-name"),
* SharedDeploymentPolicy: pulumi.String("ALLOWED"),
* },
* },
* })
* if err != nil {
* return err
* }
* _, err = edgecontainer.NewNodePool(ctx, "default", &edgecontainer.NodePoolArgs{
* Name: pulumi.String("nodepool-1"),
* Cluster: pulumi.Any(cluster.Name),
* Location: pulumi.String("us-central1"),
* NodeLocation: pulumi.String("us-central1-edge-example-edgesite"),
* NodeCount: pulumi.Int(3),
* })
* 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.organizations.OrganizationsFunctions;
* import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
* import com.pulumi.gcp.edgecontainer.Cluster;
* import com.pulumi.gcp.edgecontainer.ClusterArgs;
* import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationArgs;
* import com.pulumi.gcp.edgecontainer.inputs.ClusterAuthorizationAdminUsersArgs;
* import com.pulumi.gcp.edgecontainer.inputs.ClusterNetworkingArgs;
* import com.pulumi.gcp.edgecontainer.inputs.ClusterFleetArgs;
* import com.pulumi.gcp.edgecontainer.inputs.ClusterControlPlaneArgs;
* import com.pulumi.gcp.edgecontainer.inputs.ClusterControlPlaneLocalArgs;
* import com.pulumi.gcp.edgecontainer.NodePool;
* import com.pulumi.gcp.edgecontainer.NodePoolArgs;
* 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) {
* final var project = OrganizationsFunctions.getProject();
* var default_ = new Cluster("default", ClusterArgs.builder()
* .name("")
* .location("us-central1")
* .authorization(ClusterAuthorizationArgs.builder()
* .adminUsers(ClusterAuthorizationAdminUsersArgs.builder()
* .username("[email protected] ")
* .build())
* .build())
* .networking(ClusterNetworkingArgs.builder()
* .clusterIpv4CidrBlocks("10.0.0.0/16")
* .servicesIpv4CidrBlocks("10.1.0.0/16")
* .build())
* .fleet(ClusterFleetArgs.builder()
* .project(String.format("projects/%s", project.applyValue(getProjectResult -> getProjectResult.number())))
* .build())
* .externalLoadBalancerIpv4AddressPools("10.100.0.0-10.100.0.10")
* .controlPlane(ClusterControlPlaneArgs.builder()
* .local(ClusterControlPlaneLocalArgs.builder()
* .nodeLocation("us-central1-edge-example-edgesite")
* .nodeCount(1)
* .machineFilter("machine-name")
* .sharedDeploymentPolicy("ALLOWED")
* .build())
* .build())
* .build());
* var defaultNodePool = new NodePool("defaultNodePool", NodePoolArgs.builder()
* .name("nodepool-1")
* .cluster(cluster.name())
* .location("us-central1")
* .nodeLocation("us-central1-edge-example-edgesite")
* .nodeCount(3)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:edgecontainer:Cluster
* properties:
* name:
* location: us-central1
* authorization:
* adminUsers:
* username: [email protected]
* networking:
* clusterIpv4CidrBlocks:
* - 10.0.0.0/16
* servicesIpv4CidrBlocks:
* - 10.1.0.0/16
* fleet:
* project: projects/${project.number}
* externalLoadBalancerIpv4AddressPools:
* - 10.100.0.0-10.100.0.10
* controlPlane:
* local:
* nodeLocation: us-central1-edge-example-edgesite
* nodeCount: 1
* machineFilter: machine-name
* sharedDeploymentPolicy: ALLOWED
* defaultNodePool:
* type: gcp:edgecontainer:NodePool
* name: default
* properties:
* name: nodepool-1
* cluster: ${cluster.name}
* location: us-central1
* nodeLocation: us-central1-edge-example-edgesite
* nodeCount: 3
* variables:
* project:
* fn::invoke:
* Function: gcp:organizations:getProject
* Arguments: {}
* ```
*
* ## Import
* NodePool can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/{{location}}/clusters/{{cluster}}/nodePools/{{name}}`
* * `{{project}}/{{location}}/{{cluster}}/{{name}}`
* * `{{location}}/{{cluster}}/{{name}}`
* When using the `pulumi import` command, NodePool can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:edgecontainer/nodePool:NodePool default projects/{{project}}/locations/{{location}}/clusters/{{cluster}}/nodePools/{{name}}
* ```
* ```sh
* $ pulumi import gcp:edgecontainer/nodePool:NodePool default {{project}}/{{location}}/{{cluster}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:edgecontainer/nodePool:NodePool default {{location}}/{{cluster}}/{{name}}
* ```
* @property cluster The name of the target Distributed Cloud Edge Cluster.
* - - -
* @property labels Labels associated with this resource.
* **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.
* @property localDiskEncryption Local disk encryption options. This field is only used when enabling CMEK support.
* Structure is documented below.
* @property location The location of the resource.
* @property machineFilter Only machines matching this filter will be allowed to join the node pool.
* The filtering language accepts strings like "name=", and is
* documented in more detail in [AIP-160](https://google.aip.dev/160).
* @property name The resource name of the node pool.
* @property nodeConfig Configuration for each node in the NodePool
* Structure is documented below.
* @property nodeCount The number of nodes in the pool.
* @property nodeLocation Name of the Google Distributed Cloud Edge zone where this node pool will be created. For example: `us-central1-edge-customer-a`.
* @property project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
public data class NodePoolArgs(
public val cluster: Output? = null,
public val labels: Output>? = null,
public val localDiskEncryption: Output? = null,
public val location: Output? = null,
public val machineFilter: Output? = null,
public val name: Output? = null,
public val nodeConfig: Output? = null,
public val nodeCount: Output? = null,
public val nodeLocation: Output? = null,
public val project: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.edgecontainer.NodePoolArgs =
com.pulumi.gcp.edgecontainer.NodePoolArgs.builder()
.cluster(cluster?.applyValue({ args0 -> args0 }))
.labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
.localDiskEncryption(
localDiskEncryption?.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
)
.location(location?.applyValue({ args0 -> args0 }))
.machineFilter(machineFilter?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.nodeConfig(nodeConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.nodeCount(nodeCount?.applyValue({ args0 -> args0 }))
.nodeLocation(nodeLocation?.applyValue({ args0 -> args0 }))
.project(project?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [NodePoolArgs].
*/
@PulumiTagMarker
public class NodePoolArgsBuilder internal constructor() {
private var cluster: Output? = null
private var labels: Output>? = null
private var localDiskEncryption: Output? = null
private var location: Output? = null
private var machineFilter: Output? = null
private var name: Output? = null
private var nodeConfig: Output? = null
private var nodeCount: Output? = null
private var nodeLocation: Output? = null
private var project: Output? = null
/**
* @param value The name of the target Distributed Cloud Edge Cluster.
* - - -
*/
@JvmName("viohrypxikdoehey")
public suspend fun cluster(`value`: Output) {
this.cluster = value
}
/**
* @param value Labels associated with this resource.
* **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.
*/
@JvmName("blukioqbyujvjkeq")
public suspend fun labels(`value`: Output>) {
this.labels = value
}
/**
* @param value Local disk encryption options. This field is only used when enabling CMEK support.
* Structure is documented below.
*/
@JvmName("uqoypnguwtcueunc")
public suspend fun localDiskEncryption(`value`: Output) {
this.localDiskEncryption = value
}
/**
* @param value The location of the resource.
*/
@JvmName("jxhiyjagccrubibt")
public suspend fun location(`value`: Output) {
this.location = value
}
/**
* @param value Only machines matching this filter will be allowed to join the node pool.
* The filtering language accepts strings like "name=", and is
* documented in more detail in [AIP-160](https://google.aip.dev/160).
*/
@JvmName("tubbrwwwbphkayti")
public suspend fun machineFilter(`value`: Output) {
this.machineFilter = value
}
/**
* @param value The resource name of the node pool.
*/
@JvmName("crmwrmqnkeecavpi")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value Configuration for each node in the NodePool
* Structure is documented below.
*/
@JvmName("ocqslvxktwfuidct")
public suspend fun nodeConfig(`value`: Output) {
this.nodeConfig = value
}
/**
* @param value The number of nodes in the pool.
*/
@JvmName("perdlmglyyxsydwu")
public suspend fun nodeCount(`value`: Output) {
this.nodeCount = value
}
/**
* @param value Name of the Google Distributed Cloud Edge zone where this node pool will be created. For example: `us-central1-edge-customer-a`.
*/
@JvmName("lonurldhfibgbcto")
public suspend fun nodeLocation(`value`: Output) {
this.nodeLocation = value
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("emjlqylgueiwebjj")
public suspend fun project(`value`: Output) {
this.project = value
}
/**
* @param value The name of the target Distributed Cloud Edge Cluster.
* - - -
*/
@JvmName("ldkgjrtwvigdcvoi")
public suspend fun cluster(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.cluster = mapped
}
/**
* @param value Labels associated with this resource.
* **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.
*/
@JvmName("anjwkvlfinieqltc")
public suspend fun labels(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.labels = mapped
}
/**
* @param values Labels associated with this resource.
* **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.
*/
@JvmName("pgwtuoxvhttpvynm")
public fun labels(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.labels = mapped
}
/**
* @param value Local disk encryption options. This field is only used when enabling CMEK support.
* Structure is documented below.
*/
@JvmName("sdqfwbobhawrqelr")
public suspend fun localDiskEncryption(`value`: NodePoolLocalDiskEncryptionArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.localDiskEncryption = mapped
}
/**
* @param argument Local disk encryption options. This field is only used when enabling CMEK support.
* Structure is documented below.
*/
@JvmName("ulushuvwaaihmjyc")
public suspend fun localDiskEncryption(argument: suspend NodePoolLocalDiskEncryptionArgsBuilder.() -> Unit) {
val toBeMapped = NodePoolLocalDiskEncryptionArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.localDiskEncryption = mapped
}
/**
* @param value The location of the resource.
*/
@JvmName("xibcppcpwayonvvx")
public suspend fun location(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.location = mapped
}
/**
* @param value Only machines matching this filter will be allowed to join the node pool.
* The filtering language accepts strings like "name=", and is
* documented in more detail in [AIP-160](https://google.aip.dev/160).
*/
@JvmName("jgopiboupfxgwkeg")
public suspend fun machineFilter(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.machineFilter = mapped
}
/**
* @param value The resource name of the node pool.
*/
@JvmName("dbfmjsiaskjejxuw")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value Configuration for each node in the NodePool
* Structure is documented below.
*/
@JvmName("qwufcfrhiyxxgueu")
public suspend fun nodeConfig(`value`: NodePoolNodeConfigArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.nodeConfig = mapped
}
/**
* @param argument Configuration for each node in the NodePool
* Structure is documented below.
*/
@JvmName("qxgbdivtarkvdwmu")
public suspend fun nodeConfig(argument: suspend NodePoolNodeConfigArgsBuilder.() -> Unit) {
val toBeMapped = NodePoolNodeConfigArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.nodeConfig = mapped
}
/**
* @param value The number of nodes in the pool.
*/
@JvmName("swnljjqariqcglaq")
public suspend fun nodeCount(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.nodeCount = mapped
}
/**
* @param value Name of the Google Distributed Cloud Edge zone where this node pool will be created. For example: `us-central1-edge-customer-a`.
*/
@JvmName("hukjfqudqisfbykd")
public suspend fun nodeLocation(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.nodeLocation = mapped
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("lonktyhvrjcbuejo")
public suspend fun project(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.project = mapped
}
internal fun build(): NodePoolArgs = NodePoolArgs(
cluster = cluster,
labels = labels,
localDiskEncryption = localDiskEncryption,
location = location,
machineFilter = machineFilter,
name = name,
nodeConfig = nodeConfig,
nodeCount = nodeCount,
nodeLocation = nodeLocation,
project = project,
)
}