@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
415 lines • 14.3 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.Feature = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = 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",
* },
* },
* },
* });
* ```
*
* ## 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}}
* ```
*
* ```sh
* $ pulumi import gcp:gkehub/feature:Feature default {{project}}/{{location}}/{{name}}
* ```
*
* ```sh
* $ 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, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* 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 ? state.createTime : undefined;
resourceInputs["deleteTime"] = state ? state.deleteTime : undefined;
resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined;
resourceInputs["fleetDefaultMemberConfig"] = state ? state.fleetDefaultMemberConfig : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined;
resourceInputs["resourceStates"] = state ? state.resourceStates : undefined;
resourceInputs["spec"] = state ? state.spec : undefined;
resourceInputs["states"] = state ? state.states : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
}
else {
const args = argsOrState;
if ((!args || args.location === undefined) && !opts.urn) {
throw new Error("Missing required property 'location'");
}
resourceInputs["fleetDefaultMemberConfig"] = args ? args.fleetDefaultMemberConfig : undefined;
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["spec"] = args ? args.spec : undefined;
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;
/** @internal */
Feature.__pulumiType = 'gcp:gkehub/feature:Feature';
//# sourceMappingURL=feature.js.map