UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

110 lines 4.18 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.ResourceServer = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a Cognito Resource Server. * * ## Example Usage * * ### Create a basic resource server * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const pool = new aws.cognito.UserPool("pool", {name: "pool"}); * const resource = new aws.cognito.ResourceServer("resource", { * identifier: "https://example.com", * name: "example", * userPoolId: pool.id, * }); * ``` * * ### Create a resource server with sample-scope * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const pool = new aws.cognito.UserPool("pool", {name: "pool"}); * const resource = new aws.cognito.ResourceServer("resource", { * identifier: "https://example.com", * name: "example", * scopes: [{ * scopeName: "sample-scope", * scopeDescription: "a Sample Scope Description", * }], * userPoolId: pool.id, * }); * ``` * * ## Import * * Using `pulumi import`, import `aws_cognito_resource_server` using their User Pool ID and Identifier. For example: * * ```sh * $ pulumi import aws:cognito/resourceServer:ResourceServer example "us-west-2_abc123|https://example.com" * ``` */ class ResourceServer extends pulumi.CustomResource { /** * Get an existing ResourceServer 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 ResourceServer(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ResourceServer. 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'] === ResourceServer.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["identifier"] = state?.identifier; resourceInputs["name"] = state?.name; resourceInputs["region"] = state?.region; resourceInputs["scopeIdentifiers"] = state?.scopeIdentifiers; resourceInputs["scopes"] = state?.scopes; resourceInputs["userPoolId"] = state?.userPoolId; } else { const args = argsOrState; if (args?.identifier === undefined && !opts.urn) { throw new Error("Missing required property 'identifier'"); } if (args?.userPoolId === undefined && !opts.urn) { throw new Error("Missing required property 'userPoolId'"); } resourceInputs["identifier"] = args?.identifier; resourceInputs["name"] = args?.name; resourceInputs["region"] = args?.region; resourceInputs["scopes"] = args?.scopes; resourceInputs["userPoolId"] = args?.userPoolId; resourceInputs["scopeIdentifiers"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ResourceServer.__pulumiType, name, resourceInputs, opts); } } exports.ResourceServer = ResourceServer; /** @internal */ ResourceServer.__pulumiType = 'aws:cognito/resourceServer:ResourceServer'; //# sourceMappingURL=resourceServer.js.map