Access
Provides a AWS Transfer Access resource.
NOTE: We suggest using explicit JSON encoding or
aws.iam.getPolicyDocumentwhen assigning a value topolicy. They seamlessly translate configuration to JSON, enabling you to maintain consistency within your configuration without the need for context switches. Also, you can sidestep potential complications arising from formatting discrepancies, whitespace inconsistencies, and other nuances inherent to JSON.
Example Usage
Basic S3
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.transfer.Access("example", {
externalId: "S-1-1-12-1234567890-123456789-1234567890-1234",
serverId: exampleAwsTransferServer.id,
role: exampleAwsIamRole.arn,
homeDirectory: `/${exampleAwsS3Bucket.id}/`,
});import pulumi
import pulumi_aws as aws
example = aws.transfer.Access("example",
external_id="S-1-1-12-1234567890-123456789-1234567890-1234",
server_id=example_aws_transfer_server["id"],
role=example_aws_iam_role["arn"],
home_directory=f"/{example_aws_s3_bucket['id']}/")using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Transfer.Access("example", new()
{
ExternalId = "S-1-1-12-1234567890-123456789-1234567890-1234",
ServerId = exampleAwsTransferServer.Id,
Role = exampleAwsIamRole.Arn,
HomeDirectory = $"/{exampleAwsS3Bucket.Id}/",
});
});package main
import (
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/transfer"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := transfer.NewAccess(ctx, "example", &transfer.AccessArgs{
ExternalId: pulumi.String("S-1-1-12-1234567890-123456789-1234567890-1234"),
ServerId: pulumi.Any(exampleAwsTransferServer.Id),
Role: pulumi.Any(exampleAwsIamRole.Arn),
HomeDirectory: pulumi.String(fmt.Sprintf("/%v/", exampleAwsS3Bucket.Id)),
})
if err != nil {
return err
}
return nil
})
}package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.transfer.Access;
import com.pulumi.aws.transfer.AccessArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Access("example", AccessArgs.builder()
.externalId("S-1-1-12-1234567890-123456789-1234567890-1234")
.serverId(exampleAwsTransferServer.id())
.role(exampleAwsIamRole.arn())
.homeDirectory(String.format("/%s/", exampleAwsS3Bucket.id()))
.build());
}
}resources:
example:
type: aws:transfer:Access
properties:
externalId: S-1-1-12-1234567890-123456789-1234567890-1234
serverId: ${exampleAwsTransferServer.id}
role: ${exampleAwsIamRole.arn}
homeDirectory: /${exampleAwsS3Bucket.id}/Basic EFS
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.transfer.Access("test", {
externalId: "S-1-1-12-1234567890-123456789-1234567890-1234",
serverId: testAwsTransferServer.id,
role: testAwsIamRole.arn,
homeDirectory: `/${testAwsEfsFileSystem.id}/`,
posixProfile: {
gid: 1000,
uid: 1000,
},
});import pulumi
import pulumi_aws as aws
test = aws.transfer.Access("test",
external_id="S-1-1-12-1234567890-123456789-1234567890-1234",
server_id=test_aws_transfer_server["id"],
role=test_aws_iam_role["arn"],
home_directory=f"/{test_aws_efs_file_system['id']}/",
posix_profile=aws.transfer.AccessPosixProfileArgs(
gid=1000,
uid=1000,
))using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = new Aws.Transfer.Access("test", new()
{
ExternalId = "S-1-1-12-1234567890-123456789-1234567890-1234",
ServerId = testAwsTransferServer.Id,
Role = testAwsIamRole.Arn,
HomeDirectory = $"/{testAwsEfsFileSystem.Id}/",
PosixProfile = new Aws.Transfer.Inputs.AccessPosixProfileArgs
{
Gid = 1000,
Uid = 1000,
},
});
});package main
import (
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/transfer"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := transfer.NewAccess(ctx, "test", &transfer.AccessArgs{
ExternalId: pulumi.String("S-1-1-12-1234567890-123456789-1234567890-1234"),
ServerId: pulumi.Any(testAwsTransferServer.Id),
Role: pulumi.Any(testAwsIamRole.Arn),
HomeDirectory: pulumi.String(fmt.Sprintf("/%v/", testAwsEfsFileSystem.Id)),
PosixProfile: &transfer.AccessPosixProfileArgs{
Gid: pulumi.Int(1000),
Uid: pulumi.Int(1000),
},
})
if err != nil {
return err
}
return nil
})
}package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.transfer.Access;
import com.pulumi.aws.transfer.AccessArgs;
import com.pulumi.aws.transfer.inputs.AccessPosixProfileArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var test = new Access("test", AccessArgs.builder()
.externalId("S-1-1-12-1234567890-123456789-1234567890-1234")
.serverId(testAwsTransferServer.id())
.role(testAwsIamRole.arn())
.homeDirectory(String.format("/%s/", testAwsEfsFileSystem.id()))
.posixProfile(AccessPosixProfileArgs.builder()
.gid(1000)
.uid(1000)
.build())
.build());
}
}resources:
test:
type: aws:transfer:Access
properties:
externalId: S-1-1-12-1234567890-123456789-1234567890-1234
serverId: ${testAwsTransferServer.id}
role: ${testAwsIamRole.arn}
homeDirectory: /${testAwsEfsFileSystem.id}/
posixProfile:
gid: 1000
uid: 1000Import
Using pulumi import, import Transfer Accesses using the server_id and external_id. For example:
$ pulumi import aws:transfer/access:Access example s-12345678/S-1-1-12-1234567890-123456789-1234567890-1234Properties
The landing directory (folder) for a user when they log in to the server using their SFTP client. It should begin with a /. The first item in the path is the name of the home bucket (accessible as ${Transfer:HomeBucket} in the policy) and the rest is the home directory (accessible as ${Transfer:HomeDirectory} in the policy). For example, /example-bucket-1234/username would set the home bucket to example-bucket-1234 and the home directory to username.