@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
224 lines • 11.7 kB
JavaScript
;
// *** 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.AzureNodePool = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* An Anthos node pool running on Azure.
*
* For more information, see:
* * [Multicloud overview](https://cloud.google.com/kubernetes-engine/multi-cloud/docs)
* ## Example Usage
*
* ### Basic_azure_node_pool
* A basic example of a containerazure azure node pool
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const versions = gcp.container.getAzureVersions({
* project: "my-project-name",
* location: "us-west1",
* });
* const basic = new gcp.container.AzureClient("basic", {
* applicationId: "12345678-1234-1234-1234-123456789111",
* location: "us-west1",
* name: "client-name",
* tenantId: "12345678-1234-1234-1234-123456789111",
* project: "my-project-name",
* });
* const primary = new gcp.container.AzureCluster("primary", {
* authorization: {
* adminUsers: [{
* username: "mmv2@google.com",
* }],
* },
* azureRegion: "westus2",
* client: pulumi.interpolate`projects/my-project-number/locations/us-west1/azureClients/${basic.name}`,
* controlPlane: {
* sshConfig: {
* authorizedKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC8yaayO6lnb2v+SedxUMa2c8vtIEzCzBjM3EJJsv8Vm9zUDWR7dXWKoNGARUb2mNGXASvI6mFIDXTIlkQ0poDEPpMaXR0g2cb5xT8jAAJq7fqXL3+0rcJhY/uigQ+MrT6s+ub0BFVbsmGHNrMQttXX9gtmwkeAEvj3mra9e5pkNf90qlKnZz6U0SVArxVsLx07vHPHDIYrl0OPG4zUREF52igbBPiNrHJFDQJT/4YlDMJmo/QT/A1D6n9ocemvZSzhRx15/Arjowhr+VVKSbaxzPtEfY0oIg2SrqJnnr/l3Du5qIefwh5VmCZe4xopPUaDDoOIEFriZ88sB+3zz8ib8sk8zJJQCgeP78tQvXCgS+4e5W3TUg9mxjB6KjXTyHIVhDZqhqde0OI3Fy1UuVzRUwnBaLjBnAwP5EoFQGRmDYk/rEYe7HTmovLeEBUDQocBQKT4Ripm/xJkkWY7B07K/tfo56dGUCkvyIVXKBInCh+dLK7gZapnd4UWkY0xBYcwo1geMLRq58iFTLA2j/JmpmHXp7m0l7jJii7d44uD3tTIFYThn7NlOnvhLim/YcBK07GMGIN7XwrrKZKmxXaspw6KBWVhzuw1UPxctxshYEaMLfFg/bwOw8HvMPr9VtrElpSB7oiOh91PDIPdPBgHCi7N2QgQ5l/ZDBHieSpNrQ== thomasrodgers",
* },
* subnetId: "/subscriptions/12345678-1234-1234-1234-123456789111/resourceGroups/my--dev-byo/providers/Microsoft.Network/virtualNetworks/my--dev-vnet/subnets/default",
* version: versions.then(versions => versions.validVersions?.[0]),
* },
* fleet: {
* project: "my-project-number",
* },
* location: "us-west1",
* name: "name",
* networking: {
* podAddressCidrBlocks: ["10.200.0.0/16"],
* serviceAddressCidrBlocks: ["10.32.0.0/24"],
* virtualNetworkId: "/subscriptions/12345678-1234-1234-1234-123456789111/resourceGroups/my--dev-byo/providers/Microsoft.Network/virtualNetworks/my--dev-vnet",
* },
* resourceGroupId: "/subscriptions/12345678-1234-1234-1234-123456789111/resourceGroups/my--dev-cluster",
* project: "my-project-name",
* });
* const primaryAzureNodePool = new gcp.container.AzureNodePool("primary", {
* autoscaling: {
* maxNodeCount: 3,
* minNodeCount: 2,
* },
* cluster: primary.name,
* config: {
* sshConfig: {
* authorizedKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC8yaayO6lnb2v+SedxUMa2c8vtIEzCzBjM3EJJsv8Vm9zUDWR7dXWKoNGARUb2mNGXASvI6mFIDXTIlkQ0poDEPpMaXR0g2cb5xT8jAAJq7fqXL3+0rcJhY/uigQ+MrT6s+ub0BFVbsmGHNrMQttXX9gtmwkeAEvj3mra9e5pkNf90qlKnZz6U0SVArxVsLx07vHPHDIYrl0OPG4zUREF52igbBPiNrHJFDQJT/4YlDMJmo/QT/A1D6n9ocemvZSzhRx15/Arjowhr+VVKSbaxzPtEfY0oIg2SrqJnnr/l3Du5qIefwh5VmCZe4xopPUaDDoOIEFriZ88sB+3zz8ib8sk8zJJQCgeP78tQvXCgS+4e5W3TUg9mxjB6KjXTyHIVhDZqhqde0OI3Fy1UuVzRUwnBaLjBnAwP5EoFQGRmDYk/rEYe7HTmovLeEBUDQocBQKT4Ripm/xJkkWY7B07K/tfo56dGUCkvyIVXKBInCh+dLK7gZapnd4UWkY0xBYcwo1geMLRq58iFTLA2j/JmpmHXp7m0l7jJii7d44uD3tTIFYThn7NlOnvhLim/YcBK07GMGIN7XwrrKZKmxXaspw6KBWVhzuw1UPxctxshYEaMLfFg/bwOw8HvMPr9VtrElpSB7oiOh91PDIPdPBgHCi7N2QgQ5l/ZDBHieSpNrQ== thomasrodgers",
* },
* proxyConfig: {
* resourceGroupId: "/subscriptions/12345678-1234-1234-1234-123456789111/resourceGroups/my--dev-cluster",
* secretId: "https://my--dev-keyvault.vault.azure.net/secrets/my--dev-secret/0000000000000000000000000000000000",
* },
* rootVolume: {
* sizeGib: 32,
* },
* tags: {
* owner: "mmv2",
* },
* labels: {
* key_one: "label_one",
* },
* vmSize: "Standard_DS2_v2",
* },
* location: "us-west1",
* maxPodsConstraint: {
* maxPodsPerNode: 110,
* },
* name: "node-pool-name",
* subnetId: "/subscriptions/12345678-1234-1234-1234-123456789111/resourceGroups/my--dev-byo/providers/Microsoft.Network/virtualNetworks/my--dev-vnet/subnets/default",
* version: versions.then(versions => versions.validVersions?.[0]),
* annotations: {
* "annotation-one": "value-one",
* },
* management: {
* autoRepair: true,
* },
* project: "my-project-name",
* });
* ```
*
* ## Import
*
* NodePool can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/azureClusters/{{cluster}}/azureNodePools/{{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/azureNodePool:AzureNodePool default projects/{{project}}/locations/{{location}}/azureClusters/{{cluster}}/azureNodePools/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:container/azureNodePool:AzureNodePool default {{project}}/{{location}}/{{cluster}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:container/azureNodePool:AzureNodePool default {{location}}/{{cluster}}/{{name}}
* ```
*/
class AzureNodePool extends pulumi.CustomResource {
/**
* Get an existing AzureNodePool 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 AzureNodePool(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AzureNodePool. 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'] === AzureNodePool.__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["azureAvailabilityZone"] = state ? state.azureAvailabilityZone : 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["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["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["azureAvailabilityZone"] = args ? args.azureAvailabilityZone : undefined;
resourceInputs["cluster"] = args ? args.cluster : undefined;
resourceInputs["config"] = args ? args.config : 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["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(AzureNodePool.__pulumiType, name, resourceInputs, opts);
}
}
exports.AzureNodePool = AzureNodePool;
/** @internal */
AzureNodePool.__pulumiType = 'gcp:container/azureNodePool:AzureNodePool';
//# sourceMappingURL=azureNodePool.js.map