@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
187 lines • 7.81 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.Domain = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a SageMaker AI Domain resource.
*
* ## Example Usage
*
* ### Basic usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = aws.iam.getPolicyDocument({
* statements: [{
* actions: ["sts:AssumeRole"],
* principals: [{
* type: "Service",
* identifiers: ["sagemaker.amazonaws.com"],
* }],
* }],
* });
* const exampleRole = new aws.iam.Role("example", {
* name: "example",
* path: "/",
* assumeRolePolicy: example.then(example => example.json),
* });
* const exampleDomain = new aws.sagemaker.Domain("example", {
* domainName: "example",
* authMode: "IAM",
* vpcId: exampleAwsVpc.id,
* subnetIds: [exampleAwsSubnet.id],
* defaultUserSettings: {
* executionRole: exampleRole.arn,
* },
* });
* ```
*
* ### Using Custom Images
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.sagemaker.Image("example", {
* imageName: "example",
* roleArn: exampleAwsIamRole.arn,
* });
* const exampleAppImageConfig = new aws.sagemaker.AppImageConfig("example", {
* appImageConfigName: "example",
* kernelGatewayImageConfig: {
* kernelSpecs: [{
* name: "example",
* }],
* },
* });
* const exampleImageVersion = new aws.sagemaker.ImageVersion("example", {
* imageName: example.id,
* baseImage: "base-image",
* });
* const exampleDomain = new aws.sagemaker.Domain("example", {
* domainName: "example",
* authMode: "IAM",
* vpcId: exampleAwsVpc.id,
* subnetIds: [exampleAwsSubnet.id],
* defaultUserSettings: {
* executionRole: exampleAwsIamRole.arn,
* kernelGatewayAppSettings: {
* customImages: [{
* appImageConfigName: exampleAppImageConfig.appImageConfigName,
* imageName: exampleImageVersion.imageName,
* }],
* },
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import SageMaker AI Domains using the `id`. For example:
*
* ```sh
* $ pulumi import aws:sagemaker/domain:Domain test_domain d-8jgsjtilstu8
* ```
*/
class Domain extends pulumi.CustomResource {
/**
* Get an existing Domain 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 Domain(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Domain. 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'] === Domain.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["appNetworkAccessType"] = state?.appNetworkAccessType;
resourceInputs["appSecurityGroupManagement"] = state?.appSecurityGroupManagement;
resourceInputs["arn"] = state?.arn;
resourceInputs["authMode"] = state?.authMode;
resourceInputs["defaultSpaceSettings"] = state?.defaultSpaceSettings;
resourceInputs["defaultUserSettings"] = state?.defaultUserSettings;
resourceInputs["domainName"] = state?.domainName;
resourceInputs["domainSettings"] = state?.domainSettings;
resourceInputs["homeEfsFileSystemId"] = state?.homeEfsFileSystemId;
resourceInputs["kmsKeyId"] = state?.kmsKeyId;
resourceInputs["region"] = state?.region;
resourceInputs["retentionPolicy"] = state?.retentionPolicy;
resourceInputs["securityGroupIdForDomainBoundary"] = state?.securityGroupIdForDomainBoundary;
resourceInputs["singleSignOnApplicationArn"] = state?.singleSignOnApplicationArn;
resourceInputs["singleSignOnManagedApplicationInstanceId"] = state?.singleSignOnManagedApplicationInstanceId;
resourceInputs["subnetIds"] = state?.subnetIds;
resourceInputs["tagPropagation"] = state?.tagPropagation;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["url"] = state?.url;
resourceInputs["vpcId"] = state?.vpcId;
}
else {
const args = argsOrState;
if (args?.authMode === undefined && !opts.urn) {
throw new Error("Missing required property 'authMode'");
}
if (args?.defaultUserSettings === undefined && !opts.urn) {
throw new Error("Missing required property 'defaultUserSettings'");
}
if (args?.domainName === undefined && !opts.urn) {
throw new Error("Missing required property 'domainName'");
}
if (args?.subnetIds === undefined && !opts.urn) {
throw new Error("Missing required property 'subnetIds'");
}
if (args?.vpcId === undefined && !opts.urn) {
throw new Error("Missing required property 'vpcId'");
}
resourceInputs["appNetworkAccessType"] = args?.appNetworkAccessType;
resourceInputs["appSecurityGroupManagement"] = args?.appSecurityGroupManagement;
resourceInputs["authMode"] = args?.authMode;
resourceInputs["defaultSpaceSettings"] = args?.defaultSpaceSettings;
resourceInputs["defaultUserSettings"] = args?.defaultUserSettings;
resourceInputs["domainName"] = args?.domainName;
resourceInputs["domainSettings"] = args?.domainSettings;
resourceInputs["kmsKeyId"] = args?.kmsKeyId;
resourceInputs["region"] = args?.region;
resourceInputs["retentionPolicy"] = args?.retentionPolicy;
resourceInputs["subnetIds"] = args?.subnetIds;
resourceInputs["tagPropagation"] = args?.tagPropagation;
resourceInputs["tags"] = args?.tags;
resourceInputs["vpcId"] = args?.vpcId;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["homeEfsFileSystemId"] = undefined /*out*/;
resourceInputs["securityGroupIdForDomainBoundary"] = undefined /*out*/;
resourceInputs["singleSignOnApplicationArn"] = undefined /*out*/;
resourceInputs["singleSignOnManagedApplicationInstanceId"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["url"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Domain.__pulumiType, name, resourceInputs, opts);
}
}
exports.Domain = Domain;
/** @internal */
Domain.__pulumiType = 'aws:sagemaker/domain:Domain';
//# sourceMappingURL=domain.js.map
;