UNPKG

@pulumi/gcp

Version:

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

354 lines • 16.9 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.WorkforcePoolProvider = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * A configuration for an external identity provider. * * To get more information about WorkforcePoolProvider, see: * * * [API documentation](https://cloud.google.com/iam/docs/reference/rest/v1/locations.workforcePools.providers) * * 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) * * > **Note:** Ask your Google Cloud account team to request access to workforce identity federation for your * billing/quota project. The account team notifies you when the project is granted access. * * ## Example Usage * * ### Iam Workforce Pool Provider Saml 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 example = new gcp.iam.WorkforcePoolProvider("example", { * 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/5qPhMA0GCSqGSIb3DQEBCwUAMIGSMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzENMAsGA1UECgwET2t0YTEUMBIGA1UEC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9KstZzA63i3VcfYv</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>", * }, * }); * ``` * ### Iam Workforce Pool Provider Saml Full * * ```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 example = new gcp.iam.WorkforcePoolProvider("example", { * 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://sts.windows.net/826602fe-2101-470c-9d71-ee1343668989\"><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/5qPhMA0GCSqGSIb3DQEBCwUAMIGSMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzENMAsGA1UECgwET2t0YTEUMBIGA1UECwwLU1NPUHJvdmlkZXIxEzARBgNVBAMMCmRldi00NTg0MjExHDAaBgkqhkiG9w0BCQEWDWluZm9Ab2t0YS5jb20wHhcNMjIwMjE2MDAxOTEyWhcNMzIwMjE2MDAyMDEyWjCBkjELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDVNhbiBGcmFuY2lzY28xDTALBgNVBAoMBE9rdGExFDASBgNVBAsMC1NTT1Byb3ZpZGVyMRMwEQYDVQQDDApkZXYtNDU4NDIxMRwwGgYJKoZIhvcNAQkBFg1pbmZvQG9rdGEuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxrBl7GKz52cRpxF9xCsirnRuMxnhFBaUrsHqAQrLqWmdlpNYZTVg+T9iQ+aq/iE68L+BRZcZniKIvW58wqqS0ltXVvIkXuDSvnvnkkI5yMIVErR20K8jSOKQm1FmK+fgAJ4koshFiu9oLiqu0Ejc0DuL3/XRsb4RuxjktKTb1khgBBtb+7idEk0sFR0RPefAweXImJkDHDm7SxjDwGJUubbqpdTxasPr0W+AHI1VUzsUsTiHAoyb0XDkYqHfDzhj/ZdIEl4zHQ3bEZvlD984ztAnmX2SuFLLKfXeAAGHei8MMixJvwxYkkPeYZ/5h8WgBZPP4heS2CPjwYExt29L8QIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQARjJFz++a9Z5IQGFzsZMrX2EDR5ML4xxUiQkbhld1S1PljOLcYFARDmUC2YYHOueU4ee8Jid9nPGEUebV/4Jok+b+oQh+dWMgiWjSLI7h5q4OYZ3VJtdlVwgMFt2iz+/4yBKMUZ50g3Qgg36vE34us+eKitg759JgCNsibxn0qtJgSPm0sgP2L6yTaLnoEUbXBRxCwynTSkp9ZijZqEzbhN0e2dWv7Rx/nfpohpDP6vEiFImKFHpDSv3M/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>", * }, * extraAttributesOauth2Client: { * issuerUri: "https://login.microsoftonline.com/826602fe-2101-470c-9d71-ee1343668989/v2.0", * clientId: "client-id", * clientSecret: { * value: { * plainText: "client-secret", * }, * }, * attributesType: "AZURE_AD_GROUPS_ID", * queryParameters: { * filter: "mail:gcp", * }, * }, * displayName: "Display name", * description: "A sample SAML workforce pool provider.", * disabled: false, * attributeCondition: "true", * }); * ``` * ### Iam Workforce Pool Provider Oidc 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 example = new gcp.iam.WorkforcePoolProvider("example", { * workforcePoolId: pool.workforcePoolId, * location: pool.location, * providerId: "example-prvdr", * attributeMapping: { * "google.subject": "assertion.sub", * }, * oidc: { * issuerUri: "https://accounts.thirdparty.com", * clientId: "client-id", * clientSecret: { * value: { * plainText: "client-secret", * }, * }, * webSsoConfig: { * responseType: "CODE", * assertionClaimsBehavior: "MERGE_USER_INFO_OVER_ID_TOKEN_CLAIMS", * }, * }, * }); * ``` * ### Iam Workforce Pool Provider Oidc Full * * ```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 example = new gcp.iam.WorkforcePoolProvider("example", { * workforcePoolId: pool.workforcePoolId, * location: pool.location, * providerId: "example-prvdr", * attributeMapping: { * "google.subject": "assertion.sub", * }, * oidc: { * issuerUri: "https://login.microsoftonline.com/826602fe-2101-470c-9d71-ee1343668989/v2.0", * clientId: "client-id", * clientSecret: { * value: { * plainText: "client-secret", * }, * }, * webSsoConfig: { * responseType: "CODE", * assertionClaimsBehavior: "MERGE_USER_INFO_OVER_ID_TOKEN_CLAIMS", * additionalScopes: [ * "groups", * "roles", * ], * }, * }, * extraAttributesOauth2Client: { * issuerUri: "https://login.microsoftonline.com/826602fe-2101-470c-9d71-ee1343668989/v2.0", * clientId: "client-id", * clientSecret: { * value: { * plainText: "client-secret", * }, * }, * attributesType: "AZURE_AD_GROUPS_MAIL", * queryParameters: { * filter: "mail:sales", * }, * }, * displayName: "Display name", * description: "A sample OIDC workforce pool provider.", * disabled: false, * attributeCondition: "true", * }); * ``` * ### Iam Workforce Pool Provider Extra Attributes Oauth2 Config Client 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 example = new gcp.iam.WorkforcePoolProvider("example", { * workforcePoolId: pool.workforcePoolId, * location: pool.location, * providerId: "example-prvdr", * attributeMapping: { * "google.subject": "assertion.sub", * }, * oidc: { * issuerUri: "https://sts.windows.net/826602fe-2101-470c-9d71-ee1343668989/", * clientId: "https://analysis.windows.net/powerbi/connector/GoogleBigQuery", * webSsoConfig: { * responseType: "CODE", * assertionClaimsBehavior: "MERGE_USER_INFO_OVER_ID_TOKEN_CLAIMS", * }, * clientSecret: { * value: { * plainText: "client-secret", * }, * }, * }, * extraAttributesOauth2Client: { * issuerUri: "https://login.microsoftonline.com/826602fe-2101-470c-9d71-ee1343668989/v2.0", * clientId: "client-id", * clientSecret: { * value: { * plainText: "client-secret", * }, * }, * attributesType: "AZURE_AD_GROUPS_MAIL", * }, * }); * ``` * ### Iam Workforce Pool Provider Extra Attributes Oauth2 Config Client Full * * ```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 example = new gcp.iam.WorkforcePoolProvider("example", { * workforcePoolId: pool.workforcePoolId, * location: pool.location, * providerId: "example-prvdr", * attributeMapping: { * "google.subject": "assertion.sub", * }, * oidc: { * issuerUri: "https://sts.windows.net/826602fe-2101-470c-9d71-ee1343668989/", * clientId: "https://analysis.windows.net/powerbi/connector/GoogleBigQuery", * clientSecret: { * value: { * plainText: "client-secret", * }, * }, * webSsoConfig: { * responseType: "CODE", * assertionClaimsBehavior: "MERGE_USER_INFO_OVER_ID_TOKEN_CLAIMS", * }, * }, * extraAttributesOauth2Client: { * issuerUri: "https://login.microsoftonline.com/826602fe-2101-470c-9d71-ee1343668989/v2.0", * clientId: "client-id", * clientSecret: { * value: { * plainText: "client-secret", * }, * }, * attributesType: "AZURE_AD_GROUPS_MAIL", * queryParameters: { * filter: "mail:gcp", * }, * }, * }); * ``` * * ## Import * * WorkforcePoolProvider can be imported using any of these accepted formats: * * * `locations/{{location}}/workforcePools/{{workforce_pool_id}}/providers/{{provider_id}}` * * * `{{location}}/{{workforce_pool_id}}/{{provider_id}}` * * When using the `pulumi import` command, WorkforcePoolProvider can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:iam/workforcePoolProvider:WorkforcePoolProvider default locations/{{location}}/workforcePools/{{workforce_pool_id}}/providers/{{provider_id}} * ``` * * ```sh * $ pulumi import gcp:iam/workforcePoolProvider:WorkforcePoolProvider default {{location}}/{{workforce_pool_id}}/{{provider_id}} * ``` */ class WorkforcePoolProvider extends pulumi.CustomResource { /** * Get an existing WorkforcePoolProvider 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 WorkforcePoolProvider(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of WorkforcePoolProvider. 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'] === WorkforcePoolProvider.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["attributeCondition"] = state?.attributeCondition; resourceInputs["attributeMapping"] = state?.attributeMapping; resourceInputs["description"] = state?.description; resourceInputs["disabled"] = state?.disabled; resourceInputs["displayName"] = state?.displayName; resourceInputs["extraAttributesOauth2Client"] = state?.extraAttributesOauth2Client; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["oidc"] = state?.oidc; resourceInputs["providerId"] = state?.providerId; resourceInputs["saml"] = state?.saml; resourceInputs["state"] = state?.state; resourceInputs["workforcePoolId"] = state?.workforcePoolId; } else { const args = argsOrState; 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?.workforcePoolId === undefined && !opts.urn) { throw new Error("Missing required property 'workforcePoolId'"); } resourceInputs["attributeCondition"] = args?.attributeCondition; resourceInputs["attributeMapping"] = args?.attributeMapping; resourceInputs["description"] = args?.description; resourceInputs["disabled"] = args?.disabled; resourceInputs["displayName"] = args?.displayName; resourceInputs["extraAttributesOauth2Client"] = args?.extraAttributesOauth2Client; resourceInputs["location"] = args?.location; resourceInputs["oidc"] = args?.oidc; resourceInputs["providerId"] = args?.providerId; resourceInputs["saml"] = args?.saml; resourceInputs["workforcePoolId"] = args?.workforcePoolId; resourceInputs["name"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(WorkforcePoolProvider.__pulumiType, name, resourceInputs, opts); } } exports.WorkforcePoolProvider = WorkforcePoolProvider; /** @internal */ WorkforcePoolProvider.__pulumiType = 'gcp:iam/workforcePoolProvider:WorkforcePoolProvider'; //# sourceMappingURL=workforcePoolProvider.js.map