UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

472 lines • 16.1 kB
"use strict"; // *** 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.Feature = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Feature represents the settings and status of any Hub Feature. * * To get more information about Feature, see: * * * [API documentation](https://cloud.google.com/anthos/fleet-management/docs/reference/rest/v1/projects.locations.features) * * How-to Guides * * [Registering a Cluster](https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster#register_cluster) * * ## Example Usage * * ### Gkehub Feature Multi Cluster Ingress * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const cluster = new gcp.container.Cluster("cluster", { * name: "my-cluster", * location: "us-central1-a", * initialNodeCount: 1, * }); * const membership = new gcp.gkehub.Membership("membership", { * membershipId: "my-membership", * endpoint: { * gkeCluster: { * resourceLink: pulumi.interpolate`//container.googleapis.com/${cluster.id}`, * }, * }, * }); * const feature = new gcp.gkehub.Feature("feature", { * name: "multiclusteringress", * location: "global", * spec: { * multiclusteringress: { * configMembership: membership.id, * }, * }, * }); * ``` * ### Gkehub Feature Multi Cluster Service Discovery * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const feature = new gcp.gkehub.Feature("feature", { * name: "multiclusterservicediscovery", * location: "global", * labels: { * foo: "bar", * }, * }); * ``` * ### Gkehub Feature Anthos Service Mesh * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const feature = new gcp.gkehub.Feature("feature", { * name: "servicemesh", * location: "global", * }); * ``` * ### Enable Fleet Observability For Default Logs With Copy * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const feature = new gcp.gkehub.Feature("feature", { * name: "fleetobservability", * location: "global", * spec: { * fleetobservability: { * loggingConfig: { * defaultConfig: { * mode: "COPY", * }, * }, * }, * }, * }); * ``` * ### Enable Fleet Observability For Scope Logs With Move * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const feature = new gcp.gkehub.Feature("feature", { * name: "fleetobservability", * location: "global", * spec: { * fleetobservability: { * loggingConfig: { * fleetScopeLogsConfig: { * mode: "MOVE", * }, * }, * }, * }, * }); * ``` * ### Enable Fleet Observability For Both Default And Scope Logs * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const feature = new gcp.gkehub.Feature("feature", { * name: "fleetobservability", * location: "global", * spec: { * fleetobservability: { * loggingConfig: { * defaultConfig: { * mode: "COPY", * }, * fleetScopeLogsConfig: { * mode: "MOVE", * }, * }, * }, * }, * }); * ``` * ### Enable Fleet Default Member Config Service Mesh * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const feature = new gcp.gkehub.Feature("feature", { * name: "servicemesh", * location: "global", * fleetDefaultMemberConfig: { * mesh: { * management: "MANAGEMENT_AUTOMATIC", * }, * }, * }); * ``` * ### Enable Fleet Default Member Config Configmanagement * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const feature = new gcp.gkehub.Feature("feature", { * name: "configmanagement", * location: "global", * fleetDefaultMemberConfig: { * configmanagement: { * configSync: { * git: { * syncRepo: "https://github.com/hashicorp/terraform", * }, * }, * }, * }, * }); * ``` * ### Enable Fleet Default Member Config Policycontroller * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const feature = new gcp.gkehub.Feature("feature", { * name: "policycontroller", * location: "global", * fleetDefaultMemberConfig: { * policycontroller: { * policyControllerHubConfig: { * installSpec: "INSTALL_SPEC_ENABLED", * exemptableNamespaces: ["foo"], * policyContent: { * bundles: [{ * bundle: "policy-essentials-v2022", * exemptedNamespaces: [ * "foo", * "bar", * ], * }], * templateLibrary: { * installation: "ALL", * }, * }, * auditIntervalSeconds: 30, * referentialRulesEnabled: true, * }, * }, * }, * }); * ``` * ### Enable Fleet Default Member Config Policycontroller Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const feature = new gcp.gkehub.Feature("feature", { * name: "policycontroller", * location: "global", * fleetDefaultMemberConfig: { * policycontroller: { * policyControllerHubConfig: { * installSpec: "INSTALL_SPEC_SUSPENDED", * policyContent: { * bundles: [ * { * bundle: "pci-dss-v3.2.1", * exemptedNamespaces: [ * "baz", * "bar", * ], * }, * { * bundle: "nist-sp-800-190", * exemptedNamespaces: [], * }, * ], * templateLibrary: { * installation: "ALL", * }, * }, * constraintViolationLimit: 50, * referentialRulesEnabled: true, * logDeniesEnabled: true, * mutationEnabled: true, * deploymentConfigs: [ * { * component: "admission", * replicaCount: 2, * podAffinity: "ANTI_AFFINITY", * }, * { * component: "audit", * containerResources: { * limits: { * memory: "1Gi", * cpu: "1.5", * }, * requests: { * memory: "500Mi", * cpu: "150m", * }, * }, * podTolerations: [{ * key: "key1", * operator: "Equal", * value: "value1", * effect: "NoSchedule", * }], * }, * ], * monitoring: { * backends: ["PROMETHEUS"], * }, * }, * }, * }, * }); * ``` * ### Enable Fleet Default Member Config Policycontroller Minimal * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const feature = new gcp.gkehub.Feature("feature", { * name: "policycontroller", * location: "global", * fleetDefaultMemberConfig: { * policycontroller: { * policyControllerHubConfig: { * installSpec: "INSTALL_SPEC_ENABLED", * policyContent: {}, * constraintViolationLimit: 50, * referentialRulesEnabled: true, * logDeniesEnabled: true, * mutationEnabled: true, * deploymentConfigs: [{ * component: "admission", * }], * monitoring: {}, * }, * }, * }, * }); * ``` * ### Gkehub Feature Clusterupgrade * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const feature = new gcp.gkehub.Feature("feature", { * name: "clusterupgrade", * location: "global", * spec: { * clusterupgrade: { * upstreamFleets: [], * postConditions: { * soaking: "60s", * }, * }, * }, * }); * ``` * ### Gkehub Feature Rbacrolebinding Actuation * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const feature = new gcp.gkehub.Feature("feature", { * name: "rbacrolebindingactuation", * location: "global", * spec: { * rbacrolebindingactuation: { * allowedCustomRoles: [ * "custom-role1", * "custom-role2", * "custom-role3", * ], * }, * }, * }); * ``` * ### Gkehub Feature Workload Identity * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const pool = new gcp.iam.WorkloadIdentityPool("pool", { * workloadIdentityPoolId: "example-pool", * mode: "TRUST_DOMAIN", * }); * const feature = new gcp.gkehub.Feature("feature", { * name: "workloadidentity", * location: "global", * spec: { * workloadidentity: { * scopeTenancyPool: pool.name, * }, * }, * }); * ``` * * ## Import * * Feature can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/features/{{name}}` * * `{{project}}/{{location}}/{{name}}` * * `{{location}}/{{name}}` * * When using the `pulumi import` command, Feature can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:gkehub/feature:Feature default projects/{{project}}/locations/{{location}}/features/{{name}} * $ pulumi import gcp:gkehub/feature:Feature default {{project}}/{{location}}/{{name}} * $ pulumi import gcp:gkehub/feature:Feature default {{location}}/{{name}} * ``` */ class Feature extends pulumi.CustomResource { /** * Get an existing Feature 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 Feature(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:gkehub/feature:Feature'; /** * Returns true if the given object is an instance of Feature. 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'] === Feature.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createTime"] = state?.createTime; resourceInputs["deleteTime"] = state?.deleteTime; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["fleetDefaultMemberConfig"] = state?.fleetDefaultMemberConfig; resourceInputs["labels"] = state?.labels; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["resourceStates"] = state?.resourceStates; resourceInputs["spec"] = state?.spec; resourceInputs["states"] = state?.states; resourceInputs["updateTime"] = state?.updateTime; } else { const args = argsOrState; if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["fleetDefaultMemberConfig"] = args?.fleetDefaultMemberConfig; resourceInputs["labels"] = args?.labels; resourceInputs["location"] = args?.location; resourceInputs["name"] = args?.name; resourceInputs["project"] = args?.project; resourceInputs["spec"] = args?.spec; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["deleteTime"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["resourceStates"] = undefined /*out*/; resourceInputs["states"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Feature.__pulumiType, name, resourceInputs, opts); } } exports.Feature = Feature; //# sourceMappingURL=feature.js.map