@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
235 lines • 11.3 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.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, Object.assign(Object.assign({}, 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 ? state.arn : undefined;
resourceInputs["certificate"] = state ? state.certificate : undefined;
resourceInputs["directoryId"] = state ? state.directoryId : undefined;
resourceInputs["domain"] = state ? state.domain : undefined;
resourceInputs["endpoint"] = state ? state.endpoint : undefined;
resourceInputs["endpointDetails"] = state ? state.endpointDetails : undefined;
resourceInputs["endpointType"] = state ? state.endpointType : undefined;
resourceInputs["forceDestroy"] = state ? state.forceDestroy : undefined;
resourceInputs["function"] = state ? state.function : undefined;
resourceInputs["hostKey"] = state ? state.hostKey : undefined;
resourceInputs["hostKeyFingerprint"] = state ? state.hostKeyFingerprint : undefined;
resourceInputs["identityProviderType"] = state ? state.identityProviderType : undefined;
resourceInputs["invocationRole"] = state ? state.invocationRole : undefined;
resourceInputs["loggingRole"] = state ? state.loggingRole : undefined;
resourceInputs["postAuthenticationLoginBanner"] = state ? state.postAuthenticationLoginBanner : undefined;
resourceInputs["preAuthenticationLoginBanner"] = state ? state.preAuthenticationLoginBanner : undefined;
resourceInputs["protocolDetails"] = state ? state.protocolDetails : undefined;
resourceInputs["protocols"] = state ? state.protocols : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["s3StorageOptions"] = state ? state.s3StorageOptions : undefined;
resourceInputs["securityPolicyName"] = state ? state.securityPolicyName : undefined;
resourceInputs["sftpAuthenticationMethods"] = state ? state.sftpAuthenticationMethods : undefined;
resourceInputs["structuredLogDestinations"] = state ? state.structuredLogDestinations : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["url"] = state ? state.url : undefined;
resourceInputs["workflowDetails"] = state ? state.workflowDetails : undefined;
}
else {
const args = argsOrState;
resourceInputs["certificate"] = args ? args.certificate : undefined;
resourceInputs["directoryId"] = args ? args.directoryId : undefined;
resourceInputs["domain"] = args ? args.domain : undefined;
resourceInputs["endpointDetails"] = args ? args.endpointDetails : undefined;
resourceInputs["endpointType"] = args ? args.endpointType : undefined;
resourceInputs["forceDestroy"] = args ? args.forceDestroy : undefined;
resourceInputs["function"] = args ? args.function : undefined;
resourceInputs["hostKey"] = (args === null || args === void 0 ? void 0 : args.hostKey) ? pulumi.secret(args.hostKey) : undefined;
resourceInputs["identityProviderType"] = args ? args.identityProviderType : undefined;
resourceInputs["invocationRole"] = args ? args.invocationRole : undefined;
resourceInputs["loggingRole"] = args ? args.loggingRole : undefined;
resourceInputs["postAuthenticationLoginBanner"] = (args === null || args === void 0 ? void 0 : args.postAuthenticationLoginBanner) ? pulumi.secret(args.postAuthenticationLoginBanner) : undefined;
resourceInputs["preAuthenticationLoginBanner"] = (args === null || args === void 0 ? void 0 : args.preAuthenticationLoginBanner) ? pulumi.secret(args.preAuthenticationLoginBanner) : undefined;
resourceInputs["protocolDetails"] = args ? args.protocolDetails : undefined;
resourceInputs["protocols"] = args ? args.protocols : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["s3StorageOptions"] = args ? args.s3StorageOptions : undefined;
resourceInputs["securityPolicyName"] = args ? args.securityPolicyName : undefined;
resourceInputs["sftpAuthenticationMethods"] = args ? args.sftpAuthenticationMethods : undefined;
resourceInputs["structuredLogDestinations"] = args ? args.structuredLogDestinations : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["url"] = args ? args.url : undefined;
resourceInputs["workflowDetails"] = args ? args.workflowDetails : undefined;
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