UNPKG

@pulumi/aws

Version:

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

235 lines • 10.2 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.Server = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a AWS Transfer Server resource. * * > **NOTE on AWS IAM permissions:** If the `endpointType` is set to `VPC`, the `ec2:DescribeVpcEndpoints` and `ec2:ModifyVpcEndpoint` [actions](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonec2.html#amazonec2-actions-as-permissions) are used. * * > **NOTE:** Use the `aws.transfer.Tag` resource to manage the system tags used for [custom hostnames](https://docs.aws.amazon.com/transfer/latest/userguide/requirements-dns.html#tag-custom-hostname-cdk). * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.transfer.Server("example", {tags: { * Name: "Example", * }}); * ``` * * ### Security Policy Name * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.transfer.Server("example", {securityPolicyName: "TransferSecurityPolicy-2020-06"}); * ``` * * ### VPC Endpoint * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.transfer.Server("example", { * endpointType: "VPC", * endpointDetails: { * addressAllocationIds: [exampleAwsEip.id], * subnetIds: [exampleAwsSubnet.id], * vpcId: exampleAwsVpc.id, * }, * }); * ``` * * ### AWS Directory authentication * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.transfer.Server("example", { * identityProviderType: "AWS_DIRECTORY_SERVICE", * directoryId: exampleAwsDirectoryServiceDirectory.id, * }); * ``` * * ### AWS Lambda authentication * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.transfer.Server("example", { * identityProviderType: "AWS_LAMBDA", * "function": exampleAwsLambdaIdentityProvider.arn, * }); * ``` * * ### Protocols * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.transfer.Server("example", { * endpointType: "VPC", * endpointDetails: { * subnetIds: [exampleAwsSubnet.id], * vpcId: exampleAwsVpc.id, * }, * protocols: [ * "FTP", * "FTPS", * ], * certificate: exampleAwsAcmCertificate.arn, * identityProviderType: "API_GATEWAY", * url: `${exampleAwsApiGatewayDeployment.invokeUrl}${exampleAwsApiGatewayResource.path}`, * }); * ``` * * ### Using Structured Logging Destinations * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const transfer = new aws.cloudwatch.LogGroup("transfer", {namePrefix: "transfer_test_"}); * const transferAssumeRole = aws.iam.getPolicyDocument({ * statements: [{ * effect: "Allow", * principals: [{ * type: "Service", * identifiers: ["transfer.amazonaws.com"], * }], * actions: ["sts:AssumeRole"], * }], * }); * const iamForTransfer = new aws.iam.Role("iam_for_transfer", { * namePrefix: "iam_for_transfer_", * assumeRolePolicy: transferAssumeRole.then(transferAssumeRole => transferAssumeRole.json), * managedPolicyArns: ["arn:aws:iam::aws:policy/service-role/AWSTransferLoggingAccess"], * }); * const transferServer = new aws.transfer.Server("transfer", { * endpointType: "PUBLIC", * loggingRole: iamForTransfer.arn, * protocols: ["SFTP"], * structuredLogDestinations: [pulumi.interpolate`${transfer.arn}:*`], * }); * ``` * * ## Import * * In Terraform v1.5.0 and later, use an `import` Block to import Transfer Servers using the server `id`. For example: * * Using `pulumi import`, import Transfer Servers using the server `id`. For example: * * ```sh * $ pulumi import aws:transfer/server:Server example s-12345678 * ``` * Certain resource arguments, such as `host_key`, cannot be read via the API and imported into the provider. This provider will display a difference for these arguments the first run after import if declared in the provider configuration for an imported resource. */ class Server extends pulumi.CustomResource { /** * Get an existing Server 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 Server(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Server. 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'] === Server.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["certificate"] = state?.certificate; resourceInputs["directoryId"] = state?.directoryId; resourceInputs["domain"] = state?.domain; resourceInputs["endpoint"] = state?.endpoint; resourceInputs["endpointDetails"] = state?.endpointDetails; resourceInputs["endpointType"] = state?.endpointType; resourceInputs["forceDestroy"] = state?.forceDestroy; resourceInputs["function"] = state?.function; resourceInputs["hostKey"] = state?.hostKey; resourceInputs["hostKeyFingerprint"] = state?.hostKeyFingerprint; resourceInputs["identityProviderType"] = state?.identityProviderType; resourceInputs["invocationRole"] = state?.invocationRole; resourceInputs["loggingRole"] = state?.loggingRole; resourceInputs["postAuthenticationLoginBanner"] = state?.postAuthenticationLoginBanner; resourceInputs["preAuthenticationLoginBanner"] = state?.preAuthenticationLoginBanner; resourceInputs["protocolDetails"] = state?.protocolDetails; resourceInputs["protocols"] = state?.protocols; resourceInputs["region"] = state?.region; resourceInputs["s3StorageOptions"] = state?.s3StorageOptions; resourceInputs["securityPolicyName"] = state?.securityPolicyName; resourceInputs["sftpAuthenticationMethods"] = state?.sftpAuthenticationMethods; resourceInputs["structuredLogDestinations"] = state?.structuredLogDestinations; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["url"] = state?.url; resourceInputs["workflowDetails"] = state?.workflowDetails; } else { const args = argsOrState; resourceInputs["certificate"] = args?.certificate; resourceInputs["directoryId"] = args?.directoryId; resourceInputs["domain"] = args?.domain; resourceInputs["endpointDetails"] = args?.endpointDetails; resourceInputs["endpointType"] = args?.endpointType; resourceInputs["forceDestroy"] = args?.forceDestroy; resourceInputs["function"] = args?.function; resourceInputs["hostKey"] = args?.hostKey ? pulumi.secret(args.hostKey) : undefined; resourceInputs["identityProviderType"] = args?.identityProviderType; resourceInputs["invocationRole"] = args?.invocationRole; resourceInputs["loggingRole"] = args?.loggingRole; resourceInputs["postAuthenticationLoginBanner"] = args?.postAuthenticationLoginBanner ? pulumi.secret(args.postAuthenticationLoginBanner) : undefined; resourceInputs["preAuthenticationLoginBanner"] = args?.preAuthenticationLoginBanner ? pulumi.secret(args.preAuthenticationLoginBanner) : undefined; resourceInputs["protocolDetails"] = args?.protocolDetails; resourceInputs["protocols"] = args?.protocols; resourceInputs["region"] = args?.region; resourceInputs["s3StorageOptions"] = args?.s3StorageOptions; resourceInputs["securityPolicyName"] = args?.securityPolicyName; resourceInputs["sftpAuthenticationMethods"] = args?.sftpAuthenticationMethods; resourceInputs["structuredLogDestinations"] = args?.structuredLogDestinations; resourceInputs["tags"] = args?.tags; resourceInputs["url"] = args?.url; resourceInputs["workflowDetails"] = args?.workflowDetails; resourceInputs["arn"] = undefined /*out*/; resourceInputs["endpoint"] = undefined /*out*/; resourceInputs["hostKeyFingerprint"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["hostKey", "postAuthenticationLoginBanner", "preAuthenticationLoginBanner"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Server.__pulumiType, name, resourceInputs, opts); } } exports.Server = Server; /** @internal */ Server.__pulumiType = 'aws:transfer/server:Server'; //# sourceMappingURL=server.js.map