@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
148 lines • 8.33 kB
JavaScript
// *** 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.WorkforcePoolProviderKey = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Represents a public key configuration for a Workforce Pool Provider. The key can be configured in your identity provider to encrypt SAML assertions.
* Google holds the corresponding private key, which it uses to decrypt encrypted tokens.
*
* To get more information about WorkforcePoolProviderKey, see:
*
* * [API documentation](https://cloud.google.com/iam/docs/reference/rest/v1/locations.workforcePools.providers.keys)
* * How-to Guides
* * [Configure a provider within the workforce pool](https://cloud.google.com/iam/docs/manage-workforce-identity-pools-providers#configure_a_provider_within_the_workforce_pool)
* * [Workforce Identity Federation Overview](https://cloud.google.com/iam/docs/workforce-identity-federation)
*
* ## Example Usage
*
* ### Iam Workforce Pool Provider Saml Key Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const pool = new gcp.iam.WorkforcePool("pool", {
* workforcePoolId: "example-pool",
* parent: "organizations/123456789",
* location: "global",
* });
* const provider = new gcp.iam.WorkforcePoolProvider("provider", {
* workforcePoolId: pool.workforcePoolId,
* location: pool.location,
* providerId: "example-prvdr",
* attributeMapping: {
* "google.subject": "assertion.sub",
* },
* saml: {
* idpMetadataXml: "<?xml version=\"1.0\"?><md:EntityDescriptor xmlns:md=\"urn:oasis:names:tc:SAML:2.0:metadata\" entityID=\"https://test.com\"><md:IDPSSODescriptor protocolSupportEnumeration=\"urn:oasis:names:tc:SAML:2.0:protocol\"> <md:KeyDescriptor use=\"signing\"><ds:KeyInfo xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\"><ds:X509Data><ds:X509Certificate>MIIDpDCCAoygAwIBAgIGAX7/5qPhMA0GCSqGSIb3DQEBCwUAMIGSMQswCQYDVQQGEwJVU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iFImKFHpDSv3M/5de1ytQzPFrZBYt9WlzlYwE1aD9FHCxdd+rWgYMVVoRaRmndpV/Rq3QUuDuFJtaoX11bC7ExkOpg9KstZzA63i3VcfYv</ds:X509Certificate></ds:X509Data></ds:KeyInfo></md:KeyDescriptor><md:SingleSignOnService Binding=\"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect\" Location=\"https://test.com/sso\"/></md:IDPSSODescriptor></md:EntityDescriptor>",
* },
* });
* const example = new gcp.iam.WorkforcePoolProviderKey("example", {
* workforcePoolId: pool.workforcePoolId,
* location: pool.location,
* providerId: provider.providerId,
* keyId: "example-key",
* keyData: {
* keySpec: "RSA_2048",
* },
* use: "ENCRYPTION",
* });
* ```
*
* ## Import
*
* WorkforcePoolProviderKey can be imported using any of these accepted formats:
*
* * `locations/{{location}}/workforcePools/{{workforce_pool_id}}/providers/{{provider_id}}/keys/{{key_id}}`
*
* * `{{location}}/{{workforce_pool_id}}/{{provider_id}}/{{key_id}}`
*
* When using the `pulumi import` command, WorkforcePoolProviderKey can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:iam/workforcePoolProviderKey:WorkforcePoolProviderKey default locations/{{location}}/workforcePools/{{workforce_pool_id}}/providers/{{provider_id}}/keys/{{key_id}}
* ```
*
* ```sh
* $ pulumi import gcp:iam/workforcePoolProviderKey:WorkforcePoolProviderKey default {{location}}/{{workforce_pool_id}}/{{provider_id}}/{{key_id}}
* ```
*/
class WorkforcePoolProviderKey extends pulumi.CustomResource {
/**
* Get an existing WorkforcePoolProviderKey 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 WorkforcePoolProviderKey(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of WorkforcePoolProviderKey. 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'] === WorkforcePoolProviderKey.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["expireTime"] = state?.expireTime;
resourceInputs["keyData"] = state?.keyData;
resourceInputs["keyId"] = state?.keyId;
resourceInputs["location"] = state?.location;
resourceInputs["name"] = state?.name;
resourceInputs["providerId"] = state?.providerId;
resourceInputs["state"] = state?.state;
resourceInputs["use"] = state?.use;
resourceInputs["workforcePoolId"] = state?.workforcePoolId;
}
else {
const args = argsOrState;
if (args?.keyData === undefined && !opts.urn) {
throw new Error("Missing required property 'keyData'");
}
if (args?.keyId === undefined && !opts.urn) {
throw new Error("Missing required property 'keyId'");
}
if (args?.location === undefined && !opts.urn) {
throw new Error("Missing required property 'location'");
}
if (args?.providerId === undefined && !opts.urn) {
throw new Error("Missing required property 'providerId'");
}
if (args?.use === undefined && !opts.urn) {
throw new Error("Missing required property 'use'");
}
if (args?.workforcePoolId === undefined && !opts.urn) {
throw new Error("Missing required property 'workforcePoolId'");
}
resourceInputs["keyData"] = args?.keyData;
resourceInputs["keyId"] = args?.keyId;
resourceInputs["location"] = args?.location;
resourceInputs["providerId"] = args?.providerId;
resourceInputs["use"] = args?.use;
resourceInputs["workforcePoolId"] = args?.workforcePoolId;
resourceInputs["expireTime"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(WorkforcePoolProviderKey.__pulumiType, name, resourceInputs, opts);
}
}
exports.WorkforcePoolProviderKey = WorkforcePoolProviderKey;
/** @internal */
WorkforcePoolProviderKey.__pulumiType = 'gcp:iam/workforcePoolProviderKey:WorkforcePoolProviderKey';
//# sourceMappingURL=workforcePoolProviderKey.js.map
;