UNPKG

@pulumi/gcp

Version:

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

152 lines 8.11 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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.WorkloadIdentityPoolManagedIdentity = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * ## Example Usage * * ### Iam Workload Identity Pool Managed Identity Basic * * ```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 ns = new gcp.iam.WorkloadIdentityPoolNamespace("ns", { * workloadIdentityPoolId: pool.workloadIdentityPoolId, * workloadIdentityPoolNamespaceId: "example-namespace", * }); * const example = new gcp.iam.WorkloadIdentityPoolManagedIdentity("example", { * workloadIdentityPoolId: pool.workloadIdentityPoolId, * workloadIdentityPoolNamespaceId: ns.workloadIdentityPoolNamespaceId, * workloadIdentityPoolManagedIdentityId: "example-managed-identity", * }); * ``` * ### Iam Workload Identity Pool Managed Identity Full * * ```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 ns = new gcp.iam.WorkloadIdentityPoolNamespace("ns", { * workloadIdentityPoolId: pool.workloadIdentityPoolId, * workloadIdentityPoolNamespaceId: "example-namespace", * }); * const example = new gcp.iam.WorkloadIdentityPoolManagedIdentity("example", { * workloadIdentityPoolId: pool.workloadIdentityPoolId, * workloadIdentityPoolNamespaceId: ns.workloadIdentityPoolNamespaceId, * workloadIdentityPoolManagedIdentityId: "example-managed-identity", * description: "Example Managed Identity in a Workload Identity Pool Namespace", * disabled: true, * attestationRules: [ * { * googleCloudResource: "//compute.googleapis.com/projects/1111111111111/uid/zones/us-central1-a/instances/12345678", * }, * { * googleCloudResource: "//run.googleapis.com/projects/1111111111111/name/locations/us-east1/services/my-service", * }, * ], * }); * ``` * * ## Import * * WorkloadIdentityPoolManagedIdentity can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/global/workloadIdentityPools/{{workload_identity_pool_id}}/namespaces/{{workload_identity_pool_namespace_id}}/managedIdentities/{{workload_identity_pool_managed_identity_id}}` * * * `{{project}}/{{workload_identity_pool_id}}/{{workload_identity_pool_namespace_id}}/{{workload_identity_pool_managed_identity_id}}` * * * `{{workload_identity_pool_id}}/{{workload_identity_pool_namespace_id}}/{{workload_identity_pool_managed_identity_id}}` * * When using the `pulumi import` command, WorkloadIdentityPoolManagedIdentity can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:iam/workloadIdentityPoolManagedIdentity:WorkloadIdentityPoolManagedIdentity default projects/{{project}}/locations/global/workloadIdentityPools/{{workload_identity_pool_id}}/namespaces/{{workload_identity_pool_namespace_id}}/managedIdentities/{{workload_identity_pool_managed_identity_id}} * ``` * * ```sh * $ pulumi import gcp:iam/workloadIdentityPoolManagedIdentity:WorkloadIdentityPoolManagedIdentity default {{project}}/{{workload_identity_pool_id}}/{{workload_identity_pool_namespace_id}}/{{workload_identity_pool_managed_identity_id}} * ``` * * ```sh * $ pulumi import gcp:iam/workloadIdentityPoolManagedIdentity:WorkloadIdentityPoolManagedIdentity default {{workload_identity_pool_id}}/{{workload_identity_pool_namespace_id}}/{{workload_identity_pool_managed_identity_id}} * ``` */ class WorkloadIdentityPoolManagedIdentity extends pulumi.CustomResource { /** * Get an existing WorkloadIdentityPoolManagedIdentity 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 WorkloadIdentityPoolManagedIdentity(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of WorkloadIdentityPoolManagedIdentity. 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'] === WorkloadIdentityPoolManagedIdentity.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["attestationRules"] = state ? state.attestationRules : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["disabled"] = state ? state.disabled : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["workloadIdentityPoolId"] = state ? state.workloadIdentityPoolId : undefined; resourceInputs["workloadIdentityPoolManagedIdentityId"] = state ? state.workloadIdentityPoolManagedIdentityId : undefined; resourceInputs["workloadIdentityPoolNamespaceId"] = state ? state.workloadIdentityPoolNamespaceId : undefined; } else { const args = argsOrState; if ((!args || args.workloadIdentityPoolId === undefined) && !opts.urn) { throw new Error("Missing required property 'workloadIdentityPoolId'"); } if ((!args || args.workloadIdentityPoolManagedIdentityId === undefined) && !opts.urn) { throw new Error("Missing required property 'workloadIdentityPoolManagedIdentityId'"); } if ((!args || args.workloadIdentityPoolNamespaceId === undefined) && !opts.urn) { throw new Error("Missing required property 'workloadIdentityPoolNamespaceId'"); } resourceInputs["attestationRules"] = args ? args.attestationRules : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["disabled"] = args ? args.disabled : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["workloadIdentityPoolId"] = args ? args.workloadIdentityPoolId : undefined; resourceInputs["workloadIdentityPoolManagedIdentityId"] = args ? args.workloadIdentityPoolManagedIdentityId : undefined; resourceInputs["workloadIdentityPoolNamespaceId"] = args ? args.workloadIdentityPoolNamespaceId : undefined; resourceInputs["name"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(WorkloadIdentityPoolManagedIdentity.__pulumiType, name, resourceInputs, opts); } } exports.WorkloadIdentityPoolManagedIdentity = WorkloadIdentityPoolManagedIdentity; /** @internal */ WorkloadIdentityPoolManagedIdentity.__pulumiType = 'gcp:iam/workloadIdentityPoolManagedIdentity:WorkloadIdentityPoolManagedIdentity'; //# sourceMappingURL=workloadIdentityPoolManagedIdentity.js.map