@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
522 lines • 20.7 kB
JavaScript
"use strict";
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.AwsNodePool = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* An Anthos node pool running on AWS.
*
* For more information, see:
* * [Multicloud overview](https://cloud.google.com/kubernetes-engine/multi-cloud/docs)
* ## Example Usage
*
* ### Basic_aws_cluster
* A basic example of a containeraws node pool
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const versions = gcp.container.getAwsVersions({
* project: "my-project-name",
* location: "us-west1",
* });
* const primary = new gcp.container.AwsCluster("primary", {
* authorization: {
* adminUsers: [{
* username: "my@service-account.com",
* }],
* },
* awsRegion: "my-aws-region",
* controlPlane: {
* awsServicesAuthentication: {
* roleArn: "arn:aws:iam::012345678910:role/my--1p-dev-oneplatform",
* roleSessionName: "my--1p-dev-session",
* },
* configEncryption: {
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* },
* databaseEncryption: {
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* },
* iamInstanceProfile: "my--1p-dev-controlplane",
* subnetIds: ["subnet-00000000000000000"],
* version: versions.then(versions => versions.validVersions?.[0]),
* instanceType: "t3.medium",
* mainVolume: {
* iops: 3000,
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* sizeGib: 10,
* volumeType: "GP3",
* },
* proxyConfig: {
* secretArn: "arn:aws:secretsmanager:us-west-2:126285863215:secret:proxy_config20210824150329476300000001-ABCDEF",
* secretVersion: "12345678-ABCD-EFGH-IJKL-987654321098",
* },
* rootVolume: {
* iops: 3000,
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* sizeGib: 10,
* volumeType: "GP3",
* },
* securityGroupIds: ["sg-00000000000000000"],
* sshConfig: {
* ec2KeyPair: "my--1p-dev-ssh",
* },
* tags: {
* owner: "my@service-account.com",
* },
* },
* fleet: {
* project: "my-project-number",
* },
* location: "us-west1",
* name: "name",
* networking: {
* podAddressCidrBlocks: ["10.2.0.0/16"],
* serviceAddressCidrBlocks: ["10.1.0.0/16"],
* vpcId: "vpc-00000000000000000",
* },
* annotations: {
* "label-one": "value-one",
* },
* description: "A sample aws cluster",
* project: "my-project-name",
* });
* const primaryAwsNodePool = new gcp.container.AwsNodePool("primary", {
* autoscaling: {
* maxNodeCount: 5,
* minNodeCount: 1,
* },
* cluster: primary.name,
* config: {
* configEncryption: {
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* },
* iamInstanceProfile: "my--1p-dev-nodepool",
* instanceType: "t3.medium",
* labels: {
* "label-one": "value-one",
* },
* rootVolume: {
* iops: 3000,
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* sizeGib: 10,
* volumeType: "GP3",
* },
* securityGroupIds: ["sg-00000000000000000"],
* proxyConfig: {
* secretArn: "arn:aws:secretsmanager:us-west-2:126285863215:secret:proxy_config20210824150329476300000001-ABCDEF",
* secretVersion: "12345678-ABCD-EFGH-IJKL-987654321098",
* },
* sshConfig: {
* ec2KeyPair: "my--1p-dev-ssh",
* },
* tags: {
* "tag-one": "value-one",
* },
* taints: [{
* effect: "PREFER_NO_SCHEDULE",
* key: "taint-key",
* value: "taint-value",
* }],
* },
* location: "us-west1",
* maxPodsConstraint: {
* maxPodsPerNode: 110,
* },
* name: "node-pool-name",
* subnetId: "subnet-00000000000000000",
* version: versions.then(versions => versions.validVersions?.[0]),
* annotations: {
* "label-one": "value-one",
* },
* management: {
* autoRepair: true,
* },
* kubeletConfig: {
* cpuManagerPolicy: "none",
* cpuCfsQuota: true,
* cpuCfsQuotaPeriod: "100ms",
* podPidsLimit: 1024,
* },
* project: "my-project-name",
* });
* ```
* ### Basic_enum_aws_cluster
* A basic example of a containeraws node pool with lowercase enums
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const versions = gcp.container.getAwsVersions({
* project: "my-project-name",
* location: "us-west1",
* });
* const primary = new gcp.container.AwsCluster("primary", {
* authorization: {
* adminUsers: [{
* username: "my@service-account.com",
* }],
* },
* awsRegion: "my-aws-region",
* controlPlane: {
* awsServicesAuthentication: {
* roleArn: "arn:aws:iam::012345678910:role/my--1p-dev-oneplatform",
* roleSessionName: "my--1p-dev-session",
* },
* configEncryption: {
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* },
* databaseEncryption: {
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* },
* iamInstanceProfile: "my--1p-dev-controlplane",
* subnetIds: ["subnet-00000000000000000"],
* version: versions.then(versions => versions.validVersions?.[0]),
* instanceType: "t3.medium",
* mainVolume: {
* iops: 3000,
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* sizeGib: 10,
* volumeType: "GP3",
* },
* proxyConfig: {
* secretArn: "arn:aws:secretsmanager:us-west-2:126285863215:secret:proxy_config20210824150329476300000001-ABCDEF",
* secretVersion: "12345678-ABCD-EFGH-IJKL-987654321098",
* },
* rootVolume: {
* iops: 3000,
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* sizeGib: 10,
* volumeType: "GP3",
* },
* securityGroupIds: ["sg-00000000000000000"],
* sshConfig: {
* ec2KeyPair: "my--1p-dev-ssh",
* },
* tags: {
* owner: "my@service-account.com",
* },
* },
* fleet: {
* project: "my-project-number",
* },
* location: "us-west1",
* name: "name",
* networking: {
* podAddressCidrBlocks: ["10.2.0.0/16"],
* serviceAddressCidrBlocks: ["10.1.0.0/16"],
* vpcId: "vpc-00000000000000000",
* },
* annotations: {
* "label-one": "value-one",
* },
* description: "A sample aws cluster",
* project: "my-project-name",
* });
* const primaryAwsNodePool = new gcp.container.AwsNodePool("primary", {
* autoscaling: {
* maxNodeCount: 5,
* minNodeCount: 1,
* },
* cluster: primary.name,
* config: {
* configEncryption: {
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* },
* iamInstanceProfile: "my--1p-dev-nodepool",
* instanceType: "t3.medium",
* labels: {
* "label-one": "value-one",
* },
* rootVolume: {
* iops: 3000,
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* sizeGib: 10,
* volumeType: "gp3",
* },
* securityGroupIds: ["sg-00000000000000000"],
* proxyConfig: {
* secretArn: "arn:aws:secretsmanager:us-west-2:126285863215:secret:proxy_config20210824150329476300000001-ABCDEF",
* secretVersion: "12345678-ABCD-EFGH-IJKL-987654321098",
* },
* sshConfig: {
* ec2KeyPair: "my--1p-dev-ssh",
* },
* tags: {
* "tag-one": "value-one",
* },
* taints: [{
* effect: "prefer_no_schedule",
* key: "taint-key",
* value: "taint-value",
* }],
* },
* location: "us-west1",
* maxPodsConstraint: {
* maxPodsPerNode: 110,
* },
* name: "node-pool-name",
* subnetId: "subnet-00000000000000000",
* version: versions.then(versions => versions.validVersions?.[0]),
* annotations: {
* "label-one": "value-one",
* },
* project: "my-project-name",
* });
* ```
* ### Beta_basic_enum_aws_cluster
* A basic example of a containeraws node pool with lowercase enums (beta)
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const versions = gcp.container.getAwsVersions({
* project: "my-project-name",
* location: "us-west1",
* });
* const primary = new gcp.container.AwsCluster("primary", {
* authorization: {
* adminUsers: [{
* username: "my@service-account.com",
* }],
* },
* awsRegion: "my-aws-region",
* controlPlane: {
* awsServicesAuthentication: {
* roleArn: "arn:aws:iam::012345678910:role/my--1p-dev-oneplatform",
* roleSessionName: "my--1p-dev-session",
* },
* configEncryption: {
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* },
* databaseEncryption: {
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* },
* iamInstanceProfile: "my--1p-dev-controlplane",
* subnetIds: ["subnet-00000000000000000"],
* version: versions.then(versions => versions.validVersions?.[0]),
* instanceType: "t3.medium",
* mainVolume: {
* iops: 3000,
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* sizeGib: 10,
* volumeType: "GP3",
* },
* proxyConfig: {
* secretArn: "arn:aws:secretsmanager:us-west-2:126285863215:secret:proxy_config20210824150329476300000001-ABCDEF",
* secretVersion: "12345678-ABCD-EFGH-IJKL-987654321098",
* },
* rootVolume: {
* iops: 3000,
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* sizeGib: 10,
* volumeType: "GP3",
* },
* securityGroupIds: ["sg-00000000000000000"],
* sshConfig: {
* ec2KeyPair: "my--1p-dev-ssh",
* },
* tags: {
* owner: "my@service-account.com",
* },
* },
* fleet: {
* project: "my-project-number",
* },
* location: "us-west1",
* name: "name",
* networking: {
* podAddressCidrBlocks: ["10.2.0.0/16"],
* serviceAddressCidrBlocks: ["10.1.0.0/16"],
* vpcId: "vpc-00000000000000000",
* },
* annotations: {
* "label-one": "value-one",
* },
* description: "A sample aws cluster",
* project: "my-project-name",
* });
* const primaryAwsNodePool = new gcp.container.AwsNodePool("primary", {
* autoscaling: {
* maxNodeCount: 5,
* minNodeCount: 1,
* },
* cluster: primary.name,
* config: {
* configEncryption: {
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* },
* iamInstanceProfile: "my--1p-dev-nodepool",
* instanceType: "t3.medium",
* labels: {
* "label-one": "value-one",
* },
* rootVolume: {
* iops: 3000,
* kmsKeyArn: "arn:aws:kms:my-aws-region:012345678910:key/12345678-1234-1234-1234-123456789111",
* sizeGib: 10,
* volumeType: "gp3",
* },
* securityGroupIds: ["sg-00000000000000000"],
* proxyConfig: {
* secretArn: "arn:aws:secretsmanager:us-west-2:126285863215:secret:proxy_config20210824150329476300000001-ABCDEF",
* secretVersion: "12345678-ABCD-EFGH-IJKL-987654321098",
* },
* sshConfig: {
* ec2KeyPair: "my--1p-dev-ssh",
* },
* tags: {
* "tag-one": "value-one",
* },
* taints: [{
* effect: "prefer_no_schedule",
* key: "taint-key",
* value: "taint-value",
* }],
* instancePlacement: {
* tenancy: "dedicated",
* },
* imageType: "ubuntu",
* },
* location: "us-west1",
* maxPodsConstraint: {
* maxPodsPerNode: 110,
* },
* name: "node-pool-name",
* subnetId: "subnet-00000000000000000",
* version: versions.then(versions => versions.validVersions?.[0]),
* annotations: {
* "label-one": "value-one",
* },
* project: "my-project-name",
* });
* ```
*
* ## Import
*
* NodePool can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/awsClusters/{{cluster}}/awsNodePools/{{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:container/awsNodePool:AwsNodePool default projects/{{project}}/locations/{{location}}/awsClusters/{{cluster}}/awsNodePools/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:container/awsNodePool:AwsNodePool default {{project}}/{{location}}/{{cluster}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:container/awsNodePool:AwsNodePool default {{location}}/{{cluster}}/{{name}}
* ```
*/
class AwsNodePool extends pulumi.CustomResource {
/**
* Get an existing AwsNodePool resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new AwsNodePool(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AwsNodePool. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === AwsNodePool.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["annotations"] = state ? state.annotations : undefined;
resourceInputs["autoscaling"] = state ? state.autoscaling : undefined;
resourceInputs["cluster"] = state ? state.cluster : undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["effectiveAnnotations"] = state ? state.effectiveAnnotations : undefined;
resourceInputs["etag"] = state ? state.etag : undefined;
resourceInputs["kubeletConfig"] = state ? state.kubeletConfig : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["management"] = state ? state.management : undefined;
resourceInputs["maxPodsConstraint"] = state ? state.maxPodsConstraint : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["reconciling"] = state ? state.reconciling : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["subnetId"] = state ? state.subnetId : undefined;
resourceInputs["uid"] = state ? state.uid : undefined;
resourceInputs["updateSettings"] = state ? state.updateSettings : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
resourceInputs["version"] = state ? state.version : undefined;
}
else {
const args = argsOrState;
if ((!args || args.autoscaling === undefined) && !opts.urn) {
throw new Error("Missing required property 'autoscaling'");
}
if ((!args || args.cluster === undefined) && !opts.urn) {
throw new Error("Missing required property 'cluster'");
}
if ((!args || args.config === undefined) && !opts.urn) {
throw new Error("Missing required property 'config'");
}
if ((!args || args.location === undefined) && !opts.urn) {
throw new Error("Missing required property 'location'");
}
if ((!args || args.maxPodsConstraint === undefined) && !opts.urn) {
throw new Error("Missing required property 'maxPodsConstraint'");
}
if ((!args || args.subnetId === undefined) && !opts.urn) {
throw new Error("Missing required property 'subnetId'");
}
if ((!args || args.version === undefined) && !opts.urn) {
throw new Error("Missing required property 'version'");
}
resourceInputs["annotations"] = args ? args.annotations : undefined;
resourceInputs["autoscaling"] = args ? args.autoscaling : undefined;
resourceInputs["cluster"] = args ? args.cluster : undefined;
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["kubeletConfig"] = args ? args.kubeletConfig : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["management"] = args ? args.management : undefined;
resourceInputs["maxPodsConstraint"] = args ? args.maxPodsConstraint : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["subnetId"] = args ? args.subnetId : undefined;
resourceInputs["updateSettings"] = args ? args.updateSettings : undefined;
resourceInputs["version"] = args ? args.version : undefined;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["effectiveAnnotations"] = undefined /*out*/;
resourceInputs["etag"] = undefined /*out*/;
resourceInputs["reconciling"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["uid"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AwsNodePool.__pulumiType, name, resourceInputs, opts);
}
}
exports.AwsNodePool = AwsNodePool;
/** @internal */
AwsNodePool.__pulumiType = 'gcp:container/awsNodePool:AwsNodePool';
//# sourceMappingURL=awsNodePool.js.map