@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
301 lines • 11.6 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.BareMetalNodePool = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* A Google Bare Metal Node Pool.
*
* ## Example Usage
*
* ### Gkeonprem Bare Metal Node Pool Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const default_basic = new gcp.gkeonprem.BareMetalCluster("default-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",
* ],
* }],
* },
* },
* 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",
* }],
* },
* },
* });
* const nodepool_basic = new gcp.gkeonprem.BareMetalNodePool("nodepool-basic", {
* name: "my-nodepool",
* bareMetalCluster: default_basic.name,
* location: "us-west1",
* nodePoolConfig: {
* operatingSystem: "LINUX",
* nodeConfigs: [{
* nodeIp: "10.200.0.11",
* }],
* },
* });
* ```
* ### Gkeonprem Bare Metal Node Pool Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const default_full = new gcp.gkeonprem.BareMetalCluster("default-full", {
* 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",
* ],
* }],
* },
* },
* 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",
* }],
* },
* },
* });
* const nodepool_full = new gcp.gkeonprem.BareMetalNodePool("nodepool-full", {
* name: "my-nodepool",
* displayName: "test-name",
* bareMetalCluster: default_full.name,
* location: "us-west1",
* annotations: {},
* nodePoolConfig: {
* operatingSystem: "LINUX",
* labels: {},
* nodeConfigs: [{
* nodeIp: "10.200.0.11",
* labels: {},
* }],
* taints: [{
* key: "test-key",
* value: "test-value",
* effect: "NO_EXECUTE",
* }],
* },
* });
* ```
*
* ## Import
*
* BareMetalNodePool can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/bareMetalClusters/{{bare_metal_cluster}}/bareMetalNodePools/{{name}}`
*
* * `{{project}}/{{location}}/{{bare_metal_cluster}}/{{name}}`
*
* * `{{location}}/{{bare_metal_cluster}}/{{name}}`
*
* When using the `pulumi import` command, BareMetalNodePool can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:gkeonprem/bareMetalNodePool:BareMetalNodePool default projects/{{project}}/locations/{{location}}/bareMetalClusters/{{bare_metal_cluster}}/bareMetalNodePools/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:gkeonprem/bareMetalNodePool:BareMetalNodePool default {{project}}/{{location}}/{{bare_metal_cluster}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:gkeonprem/bareMetalNodePool:BareMetalNodePool default {{location}}/{{bare_metal_cluster}}/{{name}}
* ```
*/
class BareMetalNodePool extends pulumi.CustomResource {
/**
* Get an existing BareMetalNodePool 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 BareMetalNodePool(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of BareMetalNodePool. 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'] === BareMetalNodePool.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["annotations"] = state ? state.annotations : undefined;
resourceInputs["bareMetalCluster"] = state ? state.bareMetalCluster : undefined;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["deleteTime"] = state ? state.deleteTime : undefined;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["effectiveAnnotations"] = state ? state.effectiveAnnotations : undefined;
resourceInputs["etag"] = state ? state.etag : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["nodePoolConfig"] = state ? state.nodePoolConfig : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["reconciling"] = state ? state.reconciling : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["statuses"] = state ? state.statuses : undefined;
resourceInputs["uid"] = state ? state.uid : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
}
else {
const args = argsOrState;
if ((!args || args.bareMetalCluster === undefined) && !opts.urn) {
throw new Error("Missing required property 'bareMetalCluster'");
}
if ((!args || args.location === undefined) && !opts.urn) {
throw new Error("Missing required property 'location'");
}
if ((!args || args.nodePoolConfig === undefined) && !opts.urn) {
throw new Error("Missing required property 'nodePoolConfig'");
}
resourceInputs["annotations"] = args ? args.annotations : undefined;
resourceInputs["bareMetalCluster"] = args ? args.bareMetalCluster : undefined;
resourceInputs["displayName"] = args ? args.displayName : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["nodePoolConfig"] = args ? args.nodePoolConfig : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["deleteTime"] = undefined /*out*/;
resourceInputs["effectiveAnnotations"] = undefined /*out*/;
resourceInputs["etag"] = undefined /*out*/;
resourceInputs["reconciling"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["statuses"] = undefined /*out*/;
resourceInputs["uid"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(BareMetalNodePool.__pulumiType, name, resourceInputs, opts);
}
}
exports.BareMetalNodePool = BareMetalNodePool;
/** @internal */
BareMetalNodePool.__pulumiType = 'gcp:gkeonprem/bareMetalNodePool:BareMetalNodePool';
//# sourceMappingURL=bareMetalNodePool.js.map