@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
449 lines • 18.1 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.BareMetalCluster = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* A Google Bare Metal User Cluster.
*
* ## Example Usage
*
* ### Gkeonprem Bare Metal Cluster Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const cluster_basic = new gcp.gkeonprem.BareMetalCluster("cluster-basic", {
* name: "my-cluster",
* location: "us-west1",
* adminClusterMembership: "projects/870316890899/locations/global/memberships/gkeonprem-terraform-test",
* bareMetalVersion: "1.12.3",
* networkConfig: {
* islandModeCidr: {
* serviceAddressCidrBlocks: ["172.26.0.0/16"],
* podAddressCidrBlocks: ["10.240.0.0/13"],
* },
* },
* controlPlane: {
* controlPlaneNodePoolConfig: {
* nodePoolConfig: {
* labels: {},
* operatingSystem: "LINUX",
* nodeConfigs: [{
* labels: {},
* nodeIp: "10.200.0.9",
* }],
* },
* },
* },
* loadBalancer: {
* portConfig: {
* controlPlaneLoadBalancerPort: 443,
* },
* vipConfig: {
* controlPlaneVip: "10.200.0.13",
* ingressVip: "10.200.0.14",
* },
* metalLbConfig: {
* addressPools: [{
* pool: "pool1",
* addresses: [
* "10.200.0.14/32",
* "10.200.0.15/32",
* "10.200.0.16/32",
* "10.200.0.17/32",
* "10.200.0.18/32",
* "fd00:1::f/128",
* "fd00:1::10/128",
* "fd00:1::11/128",
* "fd00:1::12/128",
* ],
* avoidBuggyIps: true,
* manualAssign: true,
* }],
* },
* },
* storage: {
* lvpShareConfig: {
* lvpConfig: {
* path: "/mnt/localpv-share",
* storageClass: "local-shared",
* },
* sharedPathPvCount: 5,
* },
* lvpNodeMountsConfig: {
* path: "/mnt/localpv-disk",
* storageClass: "local-disks",
* },
* },
* securityConfig: {
* authorization: {
* adminUsers: [{
* username: "admin@hashicorptest.com",
* }],
* },
* },
* });
* ```
* ### Gkeonprem Bare Metal Cluster Manuallb
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const cluster_manuallb = new gcp.gkeonprem.BareMetalCluster("cluster-manuallb", {
* name: "cluster-manuallb",
* location: "us-west1",
* adminClusterMembership: "projects/870316890899/locations/global/memberships/gkeonprem-terraform-test",
* bareMetalVersion: "1.12.3",
* networkConfig: {
* islandModeCidr: {
* serviceAddressCidrBlocks: ["172.26.0.0/16"],
* podAddressCidrBlocks: ["10.240.0.0/13"],
* },
* },
* controlPlane: {
* controlPlaneNodePoolConfig: {
* nodePoolConfig: {
* labels: {},
* operatingSystem: "LINUX",
* nodeConfigs: [{
* labels: {},
* nodeIp: "10.200.0.9",
* }],
* },
* },
* },
* loadBalancer: {
* portConfig: {
* controlPlaneLoadBalancerPort: 443,
* },
* vipConfig: {
* controlPlaneVip: "10.200.0.13",
* ingressVip: "10.200.0.14",
* },
* manualLbConfig: {
* enabled: true,
* },
* },
* storage: {
* lvpShareConfig: {
* lvpConfig: {
* path: "/mnt/localpv-share",
* storageClass: "local-shared",
* },
* sharedPathPvCount: 5,
* },
* lvpNodeMountsConfig: {
* path: "/mnt/localpv-disk",
* storageClass: "local-disks",
* },
* },
* securityConfig: {
* authorization: {
* adminUsers: [{
* username: "admin@hashicorptest.com",
* }],
* },
* },
* binaryAuthorization: {
* evaluationMode: "DISABLED",
* },
* upgradePolicy: {
* policy: "SERIAL",
* },
* });
* ```
* ### Gkeonprem Bare Metal Cluster Bgplb
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const cluster_bgplb = new gcp.gkeonprem.BareMetalCluster("cluster-bgplb", {
* name: "cluster-bgplb",
* location: "us-west1",
* adminClusterMembership: "projects/870316890899/locations/global/memberships/gkeonprem-terraform-test",
* bareMetalVersion: "1.12.3",
* networkConfig: {
* islandModeCidr: {
* serviceAddressCidrBlocks: ["172.26.0.0/16"],
* podAddressCidrBlocks: ["10.240.0.0/13"],
* },
* advancedNetworking: true,
* multipleNetworkInterfacesConfig: {
* enabled: true,
* },
* srIovConfig: {
* enabled: true,
* },
* },
* controlPlane: {
* controlPlaneNodePoolConfig: {
* nodePoolConfig: {
* labels: {},
* operatingSystem: "LINUX",
* nodeConfigs: [{
* labels: {},
* nodeIp: "10.200.0.9",
* }],
* taints: [{
* key: "test-key",
* value: "test-value",
* effect: "NO_EXECUTE",
* }],
* },
* },
* apiServerArgs: [{
* argument: "test-argument",
* value: "test-value",
* }],
* },
* loadBalancer: {
* portConfig: {
* controlPlaneLoadBalancerPort: 443,
* },
* vipConfig: {
* controlPlaneVip: "10.200.0.13",
* ingressVip: "10.200.0.14",
* },
* bgpLbConfig: {
* asn: 123456,
* bgpPeerConfigs: [{
* asn: 123457,
* ipAddress: "10.0.0.1",
* controlPlaneNodes: ["test-node"],
* }],
* addressPools: [{
* pool: "pool1",
* addresses: [
* "10.200.0.14/32",
* "10.200.0.15/32",
* "10.200.0.16/32",
* "10.200.0.17/32",
* "10.200.0.18/32",
* "fd00:1::f/128",
* "fd00:1::10/128",
* "fd00:1::11/128",
* "fd00:1::12/128",
* ],
* }],
* loadBalancerNodePoolConfig: {
* nodePoolConfig: {
* labels: {},
* operatingSystem: "LINUX",
* nodeConfigs: [{
* labels: {},
* nodeIp: "10.200.0.9",
* }],
* taints: [{
* key: "test-key",
* value: "test-value",
* effect: "NO_EXECUTE",
* }],
* kubeletConfig: {
* registryPullQps: 10,
* registryBurst: 12,
* serializeImagePullsDisabled: true,
* },
* },
* },
* },
* },
* storage: {
* lvpShareConfig: {
* lvpConfig: {
* path: "/mnt/localpv-share",
* storageClass: "local-shared",
* },
* sharedPathPvCount: 5,
* },
* lvpNodeMountsConfig: {
* path: "/mnt/localpv-disk",
* storageClass: "local-disks",
* },
* },
* securityConfig: {
* authorization: {
* adminUsers: [{
* username: "admin@hashicorptest.com",
* }],
* },
* },
* proxy: {
* uri: "http://test-domain/test",
* noProxies: ["127.0.0.1"],
* },
* clusterOperations: {
* enableApplicationLogs: true,
* },
* maintenanceConfig: {
* maintenanceAddressCidrBlocks: ["192.168.0.1/20"],
* },
* nodeConfig: {
* maxPodsPerNode: 10,
* containerRuntime: "CONTAINERD",
* },
* nodeAccessConfig: {
* loginUser: "test@example.com",
* },
* osEnvironmentConfig: {
* packageRepoExcluded: true,
* },
* });
* ```
*
* ## Import
*
* BareMetalCluster can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/bareMetalClusters/{{name}}`
*
* * `{{project}}/{{location}}/{{name}}`
*
* * `{{location}}/{{name}}`
*
* When using the `pulumi import` command, BareMetalCluster can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:gkeonprem/bareMetalCluster:BareMetalCluster default projects/{{project}}/locations/{{location}}/bareMetalClusters/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:gkeonprem/bareMetalCluster:BareMetalCluster default {{project}}/{{location}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:gkeonprem/bareMetalCluster:BareMetalCluster default {{location}}/{{name}}
* ```
*/
class BareMetalCluster extends pulumi.CustomResource {
/**
* Get an existing BareMetalCluster 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 BareMetalCluster(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of BareMetalCluster. 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'] === BareMetalCluster.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["adminClusterMembership"] = state ? state.adminClusterMembership : undefined;
resourceInputs["annotations"] = state ? state.annotations : undefined;
resourceInputs["bareMetalVersion"] = state ? state.bareMetalVersion : undefined;
resourceInputs["binaryAuthorization"] = state ? state.binaryAuthorization : undefined;
resourceInputs["clusterOperations"] = state ? state.clusterOperations : undefined;
resourceInputs["controlPlane"] = state ? state.controlPlane : undefined;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["deleteTime"] = state ? state.deleteTime : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["effectiveAnnotations"] = state ? state.effectiveAnnotations : undefined;
resourceInputs["endpoint"] = state ? state.endpoint : undefined;
resourceInputs["etag"] = state ? state.etag : undefined;
resourceInputs["fleets"] = state ? state.fleets : undefined;
resourceInputs["loadBalancer"] = state ? state.loadBalancer : undefined;
resourceInputs["localName"] = state ? state.localName : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["maintenanceConfig"] = state ? state.maintenanceConfig : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["networkConfig"] = state ? state.networkConfig : undefined;
resourceInputs["nodeAccessConfig"] = state ? state.nodeAccessConfig : undefined;
resourceInputs["nodeConfig"] = state ? state.nodeConfig : undefined;
resourceInputs["osEnvironmentConfig"] = state ? state.osEnvironmentConfig : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["proxy"] = state ? state.proxy : undefined;
resourceInputs["reconciling"] = state ? state.reconciling : undefined;
resourceInputs["securityConfig"] = state ? state.securityConfig : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["statuses"] = state ? state.statuses : undefined;
resourceInputs["storage"] = state ? state.storage : undefined;
resourceInputs["uid"] = state ? state.uid : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
resourceInputs["upgradePolicy"] = state ? state.upgradePolicy : undefined;
resourceInputs["validationChecks"] = state ? state.validationChecks : undefined;
}
else {
const args = argsOrState;
if ((!args || args.adminClusterMembership === undefined) && !opts.urn) {
throw new Error("Missing required property 'adminClusterMembership'");
}
if ((!args || args.bareMetalVersion === undefined) && !opts.urn) {
throw new Error("Missing required property 'bareMetalVersion'");
}
if ((!args || args.controlPlane === undefined) && !opts.urn) {
throw new Error("Missing required property 'controlPlane'");
}
if ((!args || args.loadBalancer === undefined) && !opts.urn) {
throw new Error("Missing required property 'loadBalancer'");
}
if ((!args || args.location === undefined) && !opts.urn) {
throw new Error("Missing required property 'location'");
}
if ((!args || args.networkConfig === undefined) && !opts.urn) {
throw new Error("Missing required property 'networkConfig'");
}
if ((!args || args.storage === undefined) && !opts.urn) {
throw new Error("Missing required property 'storage'");
}
resourceInputs["adminClusterMembership"] = args ? args.adminClusterMembership : undefined;
resourceInputs["annotations"] = args ? args.annotations : undefined;
resourceInputs["bareMetalVersion"] = args ? args.bareMetalVersion : undefined;
resourceInputs["binaryAuthorization"] = args ? args.binaryAuthorization : undefined;
resourceInputs["clusterOperations"] = args ? args.clusterOperations : undefined;
resourceInputs["controlPlane"] = args ? args.controlPlane : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["loadBalancer"] = args ? args.loadBalancer : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["maintenanceConfig"] = args ? args.maintenanceConfig : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["networkConfig"] = args ? args.networkConfig : undefined;
resourceInputs["nodeAccessConfig"] = args ? args.nodeAccessConfig : undefined;
resourceInputs["nodeConfig"] = args ? args.nodeConfig : undefined;
resourceInputs["osEnvironmentConfig"] = args ? args.osEnvironmentConfig : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["proxy"] = args ? args.proxy : undefined;
resourceInputs["securityConfig"] = args ? args.securityConfig : undefined;
resourceInputs["storage"] = args ? args.storage : undefined;
resourceInputs["upgradePolicy"] = args ? args.upgradePolicy : undefined;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["deleteTime"] = undefined /*out*/;
resourceInputs["effectiveAnnotations"] = undefined /*out*/;
resourceInputs["endpoint"] = undefined /*out*/;
resourceInputs["etag"] = undefined /*out*/;
resourceInputs["fleets"] = undefined /*out*/;
resourceInputs["localName"] = undefined /*out*/;
resourceInputs["reconciling"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["statuses"] = undefined /*out*/;
resourceInputs["uid"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
resourceInputs["validationChecks"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(BareMetalCluster.__pulumiType, name, resourceInputs, opts);
}
}
exports.BareMetalCluster = BareMetalCluster;
/** @internal */
BareMetalCluster.__pulumiType = 'gcp:gkeonprem/bareMetalCluster:BareMetalCluster';
//# sourceMappingURL=bareMetalCluster.js.map