AwsNodePool

An Anthos node pool running on AWS. For more information, see:

Example Usage

Basic_aws_cluster

A basic example of a containeraws node pool

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.container.ContainerFunctions;
import com.pulumi.gcp.container.inputs.GetAwsVersionsArgs;
import com.pulumi.gcp.container.AwsCluster;
import com.pulumi.gcp.container.AwsClusterArgs;
import com.pulumi.gcp.container.inputs.AwsClusterAuthorizationArgs;
import com.pulumi.gcp.container.inputs.AwsClusterControlPlaneArgs;
import com.pulumi.gcp.container.inputs.AwsClusterControlPlaneAwsServicesAuthenticationArgs;
import com.pulumi.gcp.container.inputs.AwsClusterControlPlaneConfigEncryptionArgs;
import com.pulumi.gcp.container.inputs.AwsClusterControlPlaneDatabaseEncryptionArgs;
import com.pulumi.gcp.container.inputs.AwsClusterControlPlaneMainVolumeArgs;
import com.pulumi.gcp.container.inputs.AwsClusterControlPlaneProxyConfigArgs;
import com.pulumi.gcp.container.inputs.AwsClusterControlPlaneRootVolumeArgs;
import com.pulumi.gcp.container.inputs.AwsClusterControlPlaneSshConfigArgs;
import com.pulumi.gcp.container.inputs.AwsClusterFleetArgs;
import com.pulumi.gcp.container.inputs.AwsClusterNetworkingArgs;
import com.pulumi.gcp.container.AwsNodePool;
import com.pulumi.gcp.container.AwsNodePoolArgs;
import com.pulumi.gcp.container.inputs.AwsNodePoolAutoscalingArgs;
import com.pulumi.gcp.container.inputs.AwsNodePoolConfigArgs;
import com.pulumi.gcp.container.inputs.AwsNodePoolConfigConfigEncryptionArgs;
import com.pulumi.gcp.container.inputs.AwsNodePoolConfigRootVolumeArgs;
import com.pulumi.gcp.container.inputs.AwsNodePoolConfigProxyConfigArgs;
import com.pulumi.gcp.container.inputs.AwsNodePoolConfigSshConfigArgs;
import com.pulumi.gcp.container.inputs.AwsNodePoolMaxPodsConstraintArgs;
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 versions = ContainerFunctions.getAwsVersions(GetAwsVersionsArgs.builder()
.project("my-project-name")
.location("us-west1")
.build());
var primaryAwsCluster = new AwsCluster("primaryAwsCluster", AwsClusterArgs.builder()
.authorization(AwsClusterAuthorizationArgs.builder()
.adminUsers(AwsClusterAuthorizationAdminUserArgs.builder()
.username("emailAddress:my@service-account.com")
.build())
.build())
.awsRegion("my-aws-region")
.controlPlane(AwsClusterControlPlaneArgs.builder()
.awsServicesAuthentication(AwsClusterControlPlaneAwsServicesAuthenticationArgs.builder()
.roleArn("arn:aws:iam::012345678910:role/my--1p-dev-oneplatform")
.roleSessionName("my--1p-dev-session")
.build())
.configEncryption(AwsClusterControlPlaneConfigEncryptionArgs.builder()
.kmsKeyArn("arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111")
.build())
.databaseEncryption(AwsClusterControlPlaneDatabaseEncryptionArgs.builder()
.kmsKeyArn("arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111")
.build())
.iamInstanceProfile("my--1p-dev-controlplane")
.subnetIds("subnet-00000000000000000")
.version(versions.applyValue(getAwsVersionsResult -> getAwsVersionsResult.validVersions()[0]))
.instanceType("t3.medium")
.mainVolume(AwsClusterControlPlaneMainVolumeArgs.builder()
.iops(3000)
.kmsKeyArn("arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111")
.sizeGib(10)
.volumeType("GP3")
.build())
.proxyConfig(AwsClusterControlPlaneProxyConfigArgs.builder()
.secretArn("arn:aws:secretsmanager:us-west-2:126285863215:secret:proxy_config20210824150329476300000001-ABCDEF")
.secretVersion("12345678-ABCD-EFGH-IJKL-987654321098")
.build())
.rootVolume(AwsClusterControlPlaneRootVolumeArgs.builder()
.iops(3000)
.kmsKeyArn("arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111")
.sizeGib(10)
.volumeType("GP3")
.build())
.securityGroupIds("sg-00000000000000000")
.sshConfig(AwsClusterControlPlaneSshConfigArgs.builder()
.ec2KeyPair("my--1p-dev-ssh")
.build())
.tags(Map.of("owner", "emailAddress:my@service-account.com"))
.build())
.fleet(AwsClusterFleetArgs.builder()
.project("my-project-number")
.build())
.location("us-west1")
.networking(AwsClusterNetworkingArgs.builder()
.podAddressCidrBlocks("10.2.0.0/16")
.serviceAddressCidrBlocks("10.1.0.0/16")
.vpcId("vpc-00000000000000000")
.build())
.annotations(Map.of("label-one", "value-one"))
.description("A sample aws cluster")
.project("my-project-name")
.build());
var primaryAwsNodePool = new AwsNodePool("primaryAwsNodePool", AwsNodePoolArgs.builder()
.autoscaling(AwsNodePoolAutoscalingArgs.builder()
.maxNodeCount(5)
.minNodeCount(1)
.build())
.cluster(primaryAwsCluster.name())
.config(AwsNodePoolConfigArgs.builder()
.configEncryption(AwsNodePoolConfigConfigEncryptionArgs.builder()
.kmsKeyArn("arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111")
.build())
.iamInstanceProfile("my--1p-dev-nodepool")
.instanceType("t3.medium")
.labels(Map.of("label-one", "value-one"))
.rootVolume(AwsNodePoolConfigRootVolumeArgs.builder()
.iops(3000)
.kmsKeyArn("arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111")
.sizeGib(10)
.volumeType("GP3")
.build())
.securityGroupIds("sg-00000000000000000")
.proxyConfig(AwsNodePoolConfigProxyConfigArgs.builder()
.secretArn("arn:aws:secretsmanager:us-west-2:126285863215:secret:proxy_config20210824150329476300000001-ABCDEF")
.secretVersion("12345678-ABCD-EFGH-IJKL-987654321098")
.build())
.sshConfig(AwsNodePoolConfigSshConfigArgs.builder()
.ec2KeyPair("my--1p-dev-ssh")
.build())
.tags(Map.of("tag-one", "value-one"))
.taints(AwsNodePoolConfigTaintArgs.builder()
.effect("PREFER_NO_SCHEDULE")
.key("taint-key")
.value("taint-value")
.build())
.build())
.location("us-west1")
.maxPodsConstraint(AwsNodePoolMaxPodsConstraintArgs.builder()
.maxPodsPerNode(110)
.build())
.subnetId("subnet-00000000000000000")
.version(versions.applyValue(getAwsVersionsResult -> getAwsVersionsResult.validVersions()[0]))
.annotations(Map.of("label-one", "value-one"))
.project("my-project-name")
.build());
}
}

Import

NodePool can be imported using any of these accepted formats

$ pulumi import gcp:container/awsNodePool:AwsNodePool default projects/{{project}}/locations/{{location}}/awsClusters/{{cluster}}/awsNodePools/{{name}}
$ pulumi import gcp:container/awsNodePool:AwsNodePool default {{project}}/{{location}}/{{cluster}}/{{name}}
$ pulumi import gcp:container/awsNodePool:AwsNodePool default {{location}}/{{cluster}}/{{name}}

Properties

Link copied to clipboard
val annotations: Output<Map<String, String>>?

Optional. Annotations on the node pool. This field has the same restrictions as Kubernetes annotations. The total size of all keys and values combined is limited to 256k. Key can have 2 segments: prefix (optional) and name (required), separated by a slash (/). Prefix must be a DNS subdomain. Name must be 63 characters or less, begin and end with alphanumerics, with dashes (-), underscores (_), dots (.), and alphanumerics between.

Link copied to clipboard

Autoscaler configuration for this node pool.

Link copied to clipboard
val cluster: Output<String>

The awsCluster for the resource

Link copied to clipboard

The configuration of the node pool.

Link copied to clipboard
val createTime: Output<String>

Output only. The time at which this node pool was created.

Link copied to clipboard
val etag: Output<String>

Allows clients to perform consistent read-modify-writes through optimistic concurrency control. May be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val location: Output<String>

The location for the resource

Link copied to clipboard

The constraint on the maximum number of pods that can be run simultaneously on a node in the node pool.

Link copied to clipboard
val name: Output<String>

The name of this resource.

Link copied to clipboard
val project: Output<String>

The project for the resource

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val reconciling: Output<Boolean>

Output only. If set, there are currently changes in flight to the node pool.

Link copied to clipboard
val state: Output<String>

Output only. The lifecycle state of the node pool. Possible values: STATE_UNSPECIFIED, PROVISIONING, RUNNING, RECONCILING, STOPPING, ERROR, DEGRADED

Link copied to clipboard
val subnetId: Output<String>

The subnet where the node pool node run.

Link copied to clipboard
val uid: Output<String>

Output only. A globally unique identifier for the node pool.

Link copied to clipboard
val updateTime: Output<String>

Output only. The time at which this node pool was last updated.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val version: Output<String>

The Kubernetes version to run on this node pool (e.g. 1.19.10-gke.1000). You can list all supported versions on a given Google Cloud region by calling GetAwsServerConfig.