"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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.FeatureMembership = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Contains information about a GKEHub Feature Memberships. Feature Memberships configure GKEHub Features that apply to specific memberships rather than the project as a whole. The googleGkeHub is the Fleet API.
 *
 * ## Example Usage
 *
 * ### Config Management With Config Sync Auto-Upgrades And Without Git/OCI
 *
 * With [Config Sync auto-upgrades](https://cloud.devsite.corp.google.com/kubernetes-engine/enterprise/config-sync/docs/how-to/upgrade-config-sync#auto-upgrade-config), Google assumes responsibility for automatically upgrading Config Sync versions
 * and overseeing the lifecycle of its components.
 *
 * ```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: "configmanagement",
 *     location: "global",
 *     labels: {
 *         foo: "bar",
 *     },
 * });
 * const featureMember = new gcp.gkehub.FeatureMembership("feature_member", {
 *     location: "global",
 *     feature: feature.name,
 *     membership: membership.membershipId,
 *     configmanagement: {
 *         management: "MANAGEMENT_AUTOMATIC",
 *         configSync: {
 *             enabled: true,
 *         },
 *     },
 * });
 * ```
 *
 * ### Config Management With Git
 *
 * ```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: "configmanagement",
 *     location: "global",
 *     labels: {
 *         foo: "bar",
 *     },
 * });
 * const featureMember = new gcp.gkehub.FeatureMembership("feature_member", {
 *     location: "global",
 *     feature: feature.name,
 *     membership: membership.membershipId,
 *     configmanagement: {
 *         version: "1.19.0",
 *         configSync: {
 *             enabled: true,
 *             git: {
 *                 syncRepo: "https://github.com/hashicorp/terraform",
 *             },
 *         },
 *     },
 * });
 * ```
 *
 * ### Config Management With OCI
 *
 * ```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: "configmanagement",
 *     location: "global",
 *     labels: {
 *         foo: "bar",
 *     },
 * });
 * const featureMember = new gcp.gkehub.FeatureMembership("feature_member", {
 *     location: "global",
 *     feature: feature.name,
 *     membership: membership.membershipId,
 *     configmanagement: {
 *         version: "1.19.0",
 *         configSync: {
 *             enabled: true,
 *             oci: {
 *                 syncRepo: "us-central1-docker.pkg.dev/sample-project/config-repo/config-sync-gke:latest",
 *                 policyDir: "config-connector",
 *                 syncWaitSecs: "20",
 *                 secretType: "gcpserviceaccount",
 *                 gcpServiceAccountEmail: "sa@project-id.iam.gserviceaccount.com",
 *             },
 *         },
 *     },
 * });
 * ```
 *
 * ### Config Management With Deployment Override
 *
 * ```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: "configmanagement",
 *     location: "global",
 *     labels: {
 *         foo: "bar",
 *     },
 * });
 * const featureMember = new gcp.gkehub.FeatureMembership("feature_member", {
 *     location: "global",
 *     feature: feature.name,
 *     membership: membership.membershipId,
 *     configmanagement: {
 *         version: "1.20.1",
 *         configSync: {
 *             enabled: true,
 *             deploymentOverrides: [{
 *                 deploymentName: "reconciler-manager",
 *                 deploymentNamespace: "config-management-system",
 *                 containers: [{
 *                     containerName: "reconciler-manager",
 *                     cpuRequest: "100m",
 *                     memoryRequest: "64Mi",
 *                     cpuLimit: "250m",
 *                     memoryLimit: "128Mi",
 *                 }],
 *             }],
 *         },
 *     },
 * });
 * ```
 *
 * ### Config Management With Regional Membership
 *
 * ```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",
 *     location: "us-central1",
 *     endpoint: {
 *         gkeCluster: {
 *             resourceLink: pulumi.interpolate`//container.googleapis.com/${cluster.id}`,
 *         },
 *     },
 * });
 * const feature = new gcp.gkehub.Feature("feature", {
 *     name: "configmanagement",
 *     location: "global",
 *     labels: {
 *         foo: "bar",
 *     },
 * });
 * const featureMember = new gcp.gkehub.FeatureMembership("feature_member", {
 *     location: "global",
 *     feature: feature.name,
 *     membership: membership.membershipId,
 *     membershipLocation: membership.location,
 *     configmanagement: {
 *         version: "1.19.0",
 *         configSync: {
 *             enabled: true,
 *             git: {
 *                 syncRepo: "https://github.com/hashicorp/terraform",
 *             },
 *         },
 *     },
 * });
 * ```
 *
 * ### 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",
 *     },
 * });
 * ```
 *
 * ### Service Mesh
 *
 * ```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: "servicemesh",
 *     location: "global",
 * });
 * const featureMember = new gcp.gkehub.FeatureMembership("feature_member", {
 *     location: "global",
 *     feature: feature.name,
 *     membership: membership.membershipId,
 *     mesh: {
 *         management: "MANAGEMENT_AUTOMATIC",
 *     },
 * });
 * ```
 *
 * ### Policy Controller With Minimal Configuration
 *
 * ```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: "policycontroller",
 *     location: "global",
 * });
 * const featureMember = new gcp.gkehub.FeatureMembership("feature_member", {
 *     location: "global",
 *     feature: feature.name,
 *     membership: membership.membershipId,
 *     policycontroller: {
 *         policyControllerHubConfig: {
 *             installSpec: "INSTALL_SPEC_ENABLED",
 *         },
 *     },
 * });
 * ```
 *
 * ### Policy Controller With Custom Configurations
 *
 * ```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: "policycontroller",
 *     location: "global",
 * });
 * const featureMember = new gcp.gkehub.FeatureMembership("feature_member", {
 *     location: "global",
 *     feature: feature.name,
 *     membership: membership.membershipId,
 *     policycontroller: {
 *         policyControllerHubConfig: {
 *             installSpec: "INSTALL_SPEC_SUSPENDED",
 *             policyContent: {
 *                 templateLibrary: {
 *                     installation: "NOT_INSTALLED",
 *                 },
 *             },
 *             constraintViolationLimit: 50,
 *             auditIntervalSeconds: 120,
 *             referentialRulesEnabled: true,
 *             logDeniesEnabled: true,
 *             mutationEnabled: true,
 *         },
 *         version: "1.17.0",
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * FeatureMembership can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/features/{{feature}}/membershipId/{{membership}}`
 *
 * * `{{project}}/{{location}}/{{feature}}/{{membership}}`
 *
 * * `{{location}}/{{feature}}/{{membership}}`
 *
 * When using the `pulumi import` command, FeatureMembership can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:gkehub/featureMembership:FeatureMembership default projects/{{project}}/locations/{{location}}/features/{{feature}}/membershipId/{{membership}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:gkehub/featureMembership:FeatureMembership default {{project}}/{{location}}/{{feature}}/{{membership}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:gkehub/featureMembership:FeatureMembership default {{location}}/{{feature}}/{{membership}}
 * ```
 */
class FeatureMembership extends pulumi.CustomResource {
    /**
     * Get an existing FeatureMembership 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 FeatureMembership(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of FeatureMembership.  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'] === FeatureMembership.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["configmanagement"] = state?.configmanagement;
            resourceInputs["feature"] = state?.feature;
            resourceInputs["location"] = state?.location;
            resourceInputs["membership"] = state?.membership;
            resourceInputs["membershipLocation"] = state?.membershipLocation;
            resourceInputs["mesh"] = state?.mesh;
            resourceInputs["policycontroller"] = state?.policycontroller;
            resourceInputs["project"] = state?.project;
        }
        else {
            const args = argsOrState;
            if (args?.feature === undefined && !opts.urn) {
                throw new Error("Missing required property 'feature'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.membership === undefined && !opts.urn) {
                throw new Error("Missing required property 'membership'");
            }
            resourceInputs["configmanagement"] = args?.configmanagement;
            resourceInputs["feature"] = args?.feature;
            resourceInputs["location"] = args?.location;
            resourceInputs["membership"] = args?.membership;
            resourceInputs["membershipLocation"] = args?.membershipLocation;
            resourceInputs["mesh"] = args?.mesh;
            resourceInputs["policycontroller"] = args?.policycontroller;
            resourceInputs["project"] = args?.project;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(FeatureMembership.__pulumiType, name, resourceInputs, opts);
    }
}
exports.FeatureMembership = FeatureMembership;
/** @internal */
FeatureMembership.__pulumiType = 'gcp:gkehub/featureMembership:FeatureMembership';
//# sourceMappingURL=featureMembership.js.map