UNPKG

@pulumi/aws

Version:

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

125 lines 5.04 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.Workforce = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a SageMaker AI Workforce resource. * * ## Example Usage * * ### Cognito Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const exampleUserPool = new aws.cognito.UserPool("example", {name: "example"}); * const exampleUserPoolClient = new aws.cognito.UserPoolClient("example", { * name: "example", * generateSecret: true, * userPoolId: exampleUserPool.id, * }); * const exampleUserPoolDomain = new aws.cognito.UserPoolDomain("example", { * domain: "example", * userPoolId: exampleUserPool.id, * }); * const example = new aws.sagemaker.Workforce("example", { * workforceName: "example", * cognitoConfig: { * clientId: exampleUserPoolClient.id, * userPool: exampleUserPoolDomain.userPoolId, * }, * }); * ``` * * ### Oidc Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.sagemaker.Workforce("example", { * workforceName: "example", * oidcConfig: { * authorizationEndpoint: "https://example.com", * clientId: "example", * clientSecret: "example", * issuer: "https://example.com", * jwksUri: "https://example.com", * logoutEndpoint: "https://example.com", * tokenEndpoint: "https://example.com", * userInfoEndpoint: "https://example.com", * }, * }); * ``` * * ## Import * * Using `pulumi import`, import SageMaker AI Workforces using the `workforce_name`. For example: * * ```sh * $ pulumi import aws:sagemaker/workforce:Workforce example example * ``` */ class Workforce extends pulumi.CustomResource { /** * Get an existing Workforce 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 Workforce(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Workforce. 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'] === Workforce.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["cognitoConfig"] = state ? state.cognitoConfig : undefined; resourceInputs["oidcConfig"] = state ? state.oidcConfig : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["sourceIpConfig"] = state ? state.sourceIpConfig : undefined; resourceInputs["subdomain"] = state ? state.subdomain : undefined; resourceInputs["workforceName"] = state ? state.workforceName : undefined; resourceInputs["workforceVpcConfig"] = state ? state.workforceVpcConfig : undefined; } else { const args = argsOrState; if ((!args || args.workforceName === undefined) && !opts.urn) { throw new Error("Missing required property 'workforceName'"); } resourceInputs["cognitoConfig"] = args ? args.cognitoConfig : undefined; resourceInputs["oidcConfig"] = args ? args.oidcConfig : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["sourceIpConfig"] = args ? args.sourceIpConfig : undefined; resourceInputs["workforceName"] = args ? args.workforceName : undefined; resourceInputs["workforceVpcConfig"] = args ? args.workforceVpcConfig : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["subdomain"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Workforce.__pulumiType, name, resourceInputs, opts); } } exports.Workforce = Workforce; /** @internal */ Workforce.__pulumiType = 'aws:sagemaker/workforce:Workforce'; //# sourceMappingURL=workforce.js.map