@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
265 lines • 13.4 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AzureCluster = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* An Anthos cluster running on Azure.
*
* For more information, see:
* * [Multicloud overview](https://cloud.google.com/kubernetes-engine/multi-cloud/docs)
* ## Example Usage
*
* ### Basic_azure_cluster
* A basic example of a containerazure azure cluster
* ```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",
* }],
* adminGroups: [{
* group: "group@domain.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",
* });
* ```
* ### Beta_basic_enum_azure_cluster
* A basic example of a containerazure azure cluster with lowercase enums (beta)
* ```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",
* loggingConfig: {
* componentConfig: {
* enableComponents: [
* "system_components",
* "workloads",
* ],
* },
* },
* });
* ```
*
* ## Import
*
* Cluster can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/{{location}}/azureClusters/{{name}}`
* * `{{project}}/{{location}}/{{name}}`
* * `{{location}}/{{name}}`
*
* When using the `pulumi import` command, Cluster can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:container/azureCluster:AzureCluster default projects/{{project}}/locations/{{location}}/azureClusters/{{name}}
* $ pulumi import gcp:container/azureCluster:AzureCluster default {{project}}/{{location}}/{{name}}
* $ pulumi import gcp:container/azureCluster:AzureCluster default {{location}}/{{name}}
* ```
*/
class AzureCluster extends pulumi.CustomResource {
/**
* Get an existing AzureCluster 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 AzureCluster(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:container/azureCluster:AzureCluster';
/**
* Returns true if the given object is an instance of AzureCluster. 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'] === AzureCluster.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["annotations"] = state?.annotations;
resourceInputs["authorization"] = state?.authorization;
resourceInputs["azureRegion"] = state?.azureRegion;
resourceInputs["azureServicesAuthentication"] = state?.azureServicesAuthentication;
resourceInputs["client"] = state?.client;
resourceInputs["controlPlane"] = state?.controlPlane;
resourceInputs["createTime"] = state?.createTime;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["description"] = state?.description;
resourceInputs["effectiveAnnotations"] = state?.effectiveAnnotations;
resourceInputs["endpoint"] = state?.endpoint;
resourceInputs["etag"] = state?.etag;
resourceInputs["fleet"] = state?.fleet;
resourceInputs["location"] = state?.location;
resourceInputs["loggingConfig"] = state?.loggingConfig;
resourceInputs["name"] = state?.name;
resourceInputs["networking"] = state?.networking;
resourceInputs["project"] = state?.project;
resourceInputs["reconciling"] = state?.reconciling;
resourceInputs["resourceGroupId"] = state?.resourceGroupId;
resourceInputs["state"] = state?.state;
resourceInputs["uid"] = state?.uid;
resourceInputs["updateTime"] = state?.updateTime;
resourceInputs["workloadIdentityConfigs"] = state?.workloadIdentityConfigs;
}
else {
const args = argsOrState;
if (args?.authorization === undefined && !opts.urn) {
throw new Error("Missing required property 'authorization'");
}
if (args?.azureRegion === undefined && !opts.urn) {
throw new Error("Missing required property 'azureRegion'");
}
if (args?.controlPlane === undefined && !opts.urn) {
throw new Error("Missing required property 'controlPlane'");
}
if (args?.fleet === undefined && !opts.urn) {
throw new Error("Missing required property 'fleet'");
}
if (args?.location === undefined && !opts.urn) {
throw new Error("Missing required property 'location'");
}
if (args?.networking === undefined && !opts.urn) {
throw new Error("Missing required property 'networking'");
}
if (args?.resourceGroupId === undefined && !opts.urn) {
throw new Error("Missing required property 'resourceGroupId'");
}
resourceInputs["annotations"] = args?.annotations;
resourceInputs["authorization"] = args?.authorization;
resourceInputs["azureRegion"] = args?.azureRegion;
resourceInputs["azureServicesAuthentication"] = args?.azureServicesAuthentication;
resourceInputs["client"] = args?.client;
resourceInputs["controlPlane"] = args?.controlPlane;
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["description"] = args?.description;
resourceInputs["fleet"] = args?.fleet;
resourceInputs["location"] = args?.location;
resourceInputs["loggingConfig"] = args?.loggingConfig;
resourceInputs["name"] = args?.name;
resourceInputs["networking"] = args?.networking;
resourceInputs["project"] = args?.project;
resourceInputs["resourceGroupId"] = args?.resourceGroupId;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["effectiveAnnotations"] = undefined /*out*/;
resourceInputs["endpoint"] = undefined /*out*/;
resourceInputs["etag"] = undefined /*out*/;
resourceInputs["reconciling"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["uid"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
resourceInputs["workloadIdentityConfigs"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AzureCluster.__pulumiType, name, resourceInputs, opts);
}
}
exports.AzureCluster = AzureCluster;
//# sourceMappingURL=azureCluster.js.map