@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
125 lines • 4.73 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.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, { ...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?.arn;
resourceInputs["cognitoConfig"] = state?.cognitoConfig;
resourceInputs["oidcConfig"] = state?.oidcConfig;
resourceInputs["region"] = state?.region;
resourceInputs["sourceIpConfig"] = state?.sourceIpConfig;
resourceInputs["subdomain"] = state?.subdomain;
resourceInputs["workforceName"] = state?.workforceName;
resourceInputs["workforceVpcConfig"] = state?.workforceVpcConfig;
}
else {
const args = argsOrState;
if (args?.workforceName === undefined && !opts.urn) {
throw new Error("Missing required property 'workforceName'");
}
resourceInputs["cognitoConfig"] = args?.cognitoConfig;
resourceInputs["oidcConfig"] = args?.oidcConfig;
resourceInputs["region"] = args?.region;
resourceInputs["sourceIpConfig"] = args?.sourceIpConfig;
resourceInputs["workforceName"] = args?.workforceName;
resourceInputs["workforceVpcConfig"] = args?.workforceVpcConfig;
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