NodePoolArgs

data class NodePoolArgs(val cluster: Output<String>? = null, val labels: Output<Map<String, String>>? = null, val localDiskEncryption: Output<NodePoolLocalDiskEncryptionArgs>? = null, val location: Output<String>? = null, val machineFilter: Output<String>? = null, val name: Output<String>? = null, val nodeConfig: Output<NodePoolNodeConfigArgs>? = null, val nodeCount: Output<Int>? = null, val nodeLocation: Output<String>? = null, val project: Output<String>? = null) : ConvertibleToJava<NodePoolArgs>

"A set of Kubernetes nodes in a cluster with common configuration and specification." To get more information about NodePool, see:

Example Usage

Edgecontainer Node Pool

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: "admin@hashicorptest.com",
},
},
networking: {
clusterIpv4CidrBlocks: ["10&#46;0&#46;0&#46;0/16"],
servicesIpv4CidrBlocks: ["10&#46;1&#46;0&#46;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",
},
});
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": "admin@hashicorptest.com",
},
},
networking={
"cluster_ipv4_cidr_blocks": ["10&#46;0&#46;0&#46;0/16"],
"services_ipv4_cidr_blocks": ["10&#46;1&#46;0&#46;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",
})
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 = "admin@hashicorptest.com",
},
},
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" },
},
});
});
package main
import (
"fmt"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/edgecontainer"
"github.com/pulumi/pulumi-gcp/sdk/v8/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, &organizations.LookupProjectArgs{}, 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("admin@hashicorptest.com"),
},
},
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
})
}
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(GetProjectArgs.builder()
.build());
var cluster = new Cluster("cluster", ClusterArgs.builder()
.name("default")
.location("us-central1")
.authorization(ClusterAuthorizationArgs.builder()
.adminUsers(ClusterAuthorizationAdminUsersArgs.builder()
.username("admin@hashicorptest.com")
.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.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());
}
}
resources:
cluster:
type: gcp:edgecontainer:Cluster
properties:
name: default
location: us-central1
authorization:
adminUsers:
username: admin@hashicorptest.com
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

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: "admin@hashicorptest.com",
},
},
networking: {
clusterIpv4CidrBlocks: ["10&#46;0&#46;0&#46;0/16"],
servicesIpv4CidrBlocks: ["10&#46;1&#46;0&#46;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],
});
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": "admin@hashicorptest.com",
},
},
networking={
"cluster_ipv4_cidr_blocks": ["10&#46;0&#46;0&#46;0/16"],
"services_ipv4_cidr_blocks": ["10&#46;1&#46;0&#46;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]))
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 = "admin@hashicorptest.com",
},
},
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,
},
});
});
package main
import (
"fmt"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/edgecontainer"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/kms"
"github.com/pulumi/pulumi-gcp/sdk/v8/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, &organizations.LookupProjectArgs{}, 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("admin@hashicorptest.com"),
},
},
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-%v@gcp-sa-edgecontainer.iam.gserviceaccount.com", 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
})
}
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(GetProjectArgs.builder()
.build());
var cluster = new Cluster("cluster", ClusterArgs.builder()
.name("default")
.location("us-central1")
.authorization(ClusterAuthorizationArgs.builder()
.adminUsers(ClusterAuthorizationAdminUsersArgs.builder()
.username("admin@hashicorptest.com")
.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.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-%s@gcp-sa-edgecontainer.iam.gserviceaccount.com", project.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());
}
}
resources:
cluster:
type: gcp:edgecontainer:Cluster
properties:
name: default
location: us-central1
authorization:
adminUsers:
username: admin@hashicorptest.com
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

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: "admin@hashicorptest.com",
},
},
networking: {
clusterIpv4CidrBlocks: ["10&#46;0&#46;0&#46;0/16"],
servicesIpv4CidrBlocks: ["10&#46;1&#46;0&#46;0/16"],
},
fleet: {
project: project.then(project => `projects/${project.number}`),
},
externalLoadBalancerIpv4AddressPools: ["10&#46;100&#46;0&#46;0-10&#46;100&#46;0&#46;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,
});
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": "admin@hashicorptest.com",
},
},
networking={
"cluster_ipv4_cidr_blocks": ["10&#46;0&#46;0&#46;0/16"],
"services_ipv4_cidr_blocks": ["10&#46;1&#46;0&#46;0/16"],
},
fleet={
"project": f"projects/{project.number}",
},
external_load_balancer_ipv4_address_pools=["10&#46;100&#46;0&#46;0-10&#46;100&#46;0&#46;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)
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 = "admin@hashicorptest.com",
},
},
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,
});
});
package main
import (
"fmt"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/edgecontainer"
"github.com/pulumi/pulumi-gcp/sdk/v8/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, &organizations.LookupProjectArgs{}, 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("admin@hashicorptest.com"),
},
},
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
})
}
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(GetProjectArgs.builder()
.build());
var default_ = new Cluster("default", ClusterArgs.builder()
.name("")
.location("us-central1")
.authorization(ClusterAuthorizationArgs.builder()
.adminUsers(ClusterAuthorizationAdminUsersArgs.builder()
.username("admin@hashicorptest.com")
.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.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());
}
}
resources:
default:
type: gcp:edgecontainer:Cluster
properties:
name: ""
location: us-central1
authorization:
adminUsers:
username: admin@hashicorptest.com
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:

$ pulumi import gcp:edgecontainer/nodePool:NodePool default projects/{{project}}/locations/{{location}}/clusters/{{cluster}}/nodePools/{{name}}
$ pulumi import gcp:edgecontainer/nodePool:NodePool default {{project}}/{{location}}/{{cluster}}/{{name}}
$ pulumi import gcp:edgecontainer/nodePool:NodePool default {{location}}/{{cluster}}/{{name}}

Constructors

Link copied to clipboard
constructor(cluster: Output<String>? = null, labels: Output<Map<String, String>>? = null, localDiskEncryption: Output<NodePoolLocalDiskEncryptionArgs>? = null, location: Output<String>? = null, machineFilter: Output<String>? = null, name: Output<String>? = null, nodeConfig: Output<NodePoolNodeConfigArgs>? = null, nodeCount: Output<Int>? = null, nodeLocation: Output<String>? = null, project: Output<String>? = null)

Properties

Link copied to clipboard
val cluster: Output<String>? = null

The name of the target Distributed Cloud Edge Cluster.

Link copied to clipboard
val labels: Output<Map<String, String>>? = null

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.

Link copied to clipboard

Local disk encryption options. This field is only used when enabling CMEK support. Structure is documented below.

Link copied to clipboard
val location: Output<String>? = null

The location of the resource.

Link copied to clipboard
val machineFilter: Output<String>? = null

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.

Link copied to clipboard
val name: Output<String>? = null

The resource name of the node pool.

Link copied to clipboard
val nodeConfig: Output<NodePoolNodeConfigArgs>? = null

Configuration for each node in the NodePool Structure is documented below.

Link copied to clipboard
val nodeCount: Output<Int>? = null

The number of nodes in the pool.

Link copied to clipboard
val nodeLocation: Output<String>? = null

Name of the Google Distributed Cloud Edge zone where this node pool will be created. For example: us-central1-edge-customer-a.

Link copied to clipboard
val project: Output<String>? = null

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Functions

Link copied to clipboard
open override fun toJava(): NodePoolArgs