@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
110 lines • 4.54 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.IdentityProvider = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a Cognito User Identity Provider resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.cognito.UserPool("example", {
* name: "example-pool",
* autoVerifiedAttributes: ["email"],
* });
* const exampleProvider = new aws.cognito.IdentityProvider("example_provider", {
* userPoolId: example.id,
* providerName: "Google",
* providerType: "Google",
* providerDetails: {
* authorize_scopes: "email",
* client_id: "your client_id",
* client_secret: "your client_secret",
* },
* attributeMapping: {
* email: "email",
* username: "sub",
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import `aws_cognito_identity_provider` resources using their User Pool ID and Provider Name. For example:
*
* ```sh
* $ pulumi import aws:cognito/identityProvider:IdentityProvider example us-west-2_abc123:CorpAD
* ```
*/
class IdentityProvider extends pulumi.CustomResource {
/**
* Get an existing IdentityProvider 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 IdentityProvider(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of IdentityProvider. 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'] === IdentityProvider.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["attributeMapping"] = state?.attributeMapping;
resourceInputs["idpIdentifiers"] = state?.idpIdentifiers;
resourceInputs["providerDetails"] = state?.providerDetails;
resourceInputs["providerName"] = state?.providerName;
resourceInputs["providerType"] = state?.providerType;
resourceInputs["region"] = state?.region;
resourceInputs["userPoolId"] = state?.userPoolId;
}
else {
const args = argsOrState;
if (args?.providerDetails === undefined && !opts.urn) {
throw new Error("Missing required property 'providerDetails'");
}
if (args?.providerName === undefined && !opts.urn) {
throw new Error("Missing required property 'providerName'");
}
if (args?.providerType === undefined && !opts.urn) {
throw new Error("Missing required property 'providerType'");
}
if (args?.userPoolId === undefined && !opts.urn) {
throw new Error("Missing required property 'userPoolId'");
}
resourceInputs["attributeMapping"] = args?.attributeMapping;
resourceInputs["idpIdentifiers"] = args?.idpIdentifiers;
resourceInputs["providerDetails"] = args?.providerDetails;
resourceInputs["providerName"] = args?.providerName;
resourceInputs["providerType"] = args?.providerType;
resourceInputs["region"] = args?.region;
resourceInputs["userPoolId"] = args?.userPoolId;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(IdentityProvider.__pulumiType, name, resourceInputs, opts);
}
}
exports.IdentityProvider = IdentityProvider;
/** @internal */
IdentityProvider.__pulumiType = 'aws:cognito/identityProvider:IdentityProvider';
//# sourceMappingURL=identityProvider.js.map
;