UNPKG

@pulumi/aws

Version:

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

157 lines 6.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.WebApp = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an AWS Transfer Family Web App. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getCallerIdentity({}); * const currentGetRegion = aws.getRegion({}); * const currentGetPartition = aws.getPartition({}); * const example = aws.ssoadmin.getInstances({}); * const assumeRoleTransfer = current.then(current => aws.iam.getPolicyDocument({ * statements: [{ * effect: "Allow", * actions: [ * "sts:AssumeRole", * "sts:SetContext", * ], * principals: [{ * type: "Service", * identifiers: ["transfer.amazonaws.com"], * }], * conditions: [{ * test: "StringEquals", * values: [current.accountId], * variable: "aws:SourceAccount", * }], * }], * })); * const exampleRole = new aws.iam.Role("example", { * name: "example", * assumeRolePolicy: assumeRoleTransfer.then(assumeRoleTransfer => assumeRoleTransfer.json), * }); * const exampleGetPolicyDocument = Promise.all([currentGetPartition, currentGetRegion, current, current, current]).then(([currentGetPartition, currentGetRegion, current, current1, current2]) => aws.iam.getPolicyDocument({ * statements: [ * { * effect: "Allow", * actions: [ * "s3:GetDataAccess", * "s3:ListCallerAccessGrants", * ], * resources: [`arn:${currentGetPartition.partition}:s3:${currentGetRegion.name}:${current.accountId}:access-grants/*`], * conditions: [{ * test: "StringEquals", * values: [current1.accountId], * variable: "s3:ResourceAccount", * }], * }, * { * effect: "Allow", * actions: ["s3:ListAccessGrantsInstances"], * resources: ["*"], * conditions: [{ * test: "StringEquals", * values: [current2.accountId], * variable: "s3:ResourceAccount", * }], * }, * ], * })); * const exampleRolePolicy = new aws.iam.RolePolicy("example", { * policy: exampleGetPolicyDocument.then(exampleGetPolicyDocument => exampleGetPolicyDocument.json), * role: exampleRole.name, * }); * const exampleWebApp = new aws.transfer.WebApp("example", { * identityProviderDetails: { * identityCenterConfig: { * instanceArn: example.then(example => example.arns?.[0]), * role: exampleRole.arn, * }, * }, * webAppUnits: [{ * provisioned: 1, * }], * tags: { * Name: "test", * }, * }); * ``` * * ## Import * * Using `pulumi import`, import Transfer Family Web App using the `web_app_id`. For example: * * ```sh * $ pulumi import aws:transfer/webApp:WebApp example web_app-id-12345678 * ``` */ class WebApp extends pulumi.CustomResource { /** * Get an existing WebApp 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 WebApp(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of WebApp. 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'] === WebApp.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessEndpoint"] = state?.accessEndpoint; resourceInputs["arn"] = state?.arn; resourceInputs["identityProviderDetails"] = state?.identityProviderDetails; resourceInputs["region"] = state?.region; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["webAppEndpointPolicy"] = state?.webAppEndpointPolicy; resourceInputs["webAppId"] = state?.webAppId; resourceInputs["webAppUnits"] = state?.webAppUnits; } else { const args = argsOrState; resourceInputs["accessEndpoint"] = args?.accessEndpoint; resourceInputs["identityProviderDetails"] = args?.identityProviderDetails; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; resourceInputs["webAppEndpointPolicy"] = args?.webAppEndpointPolicy; resourceInputs["webAppUnits"] = args?.webAppUnits; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["webAppId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(WebApp.__pulumiType, name, resourceInputs, opts); } } exports.WebApp = WebApp; /** @internal */ WebApp.__pulumiType = 'aws:transfer/webApp:WebApp'; //# sourceMappingURL=webApp.js.map