Access class

Provides a AWS Transfer Access resource.

> NOTE: We suggest using explicit JSON encoding or aws.iam.getPolicyDocument when assigning a value to policy. 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 (
	"github.com/pulumi/pulumi-aws/sdk/v7/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.Sprintf("/%v/", exampleAwsS3Bucket.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_transfer_access" "example" {
  external_id    = "S-1-1-12-1234567890-123456789-1234567890-1234"
  server_id      = exampleAwsTransferServer.id
  role           = exampleAwsIamRole.arn
  home_directory ="/${exampleAwsS3Bucket.id}/"
}
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.ArrayList;
import java.util.Arrays;
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", {
    posixProfile: {
        gid: 1000,
        uid: 1000,
    },
    externalId: "S-1-1-12-1234567890-123456789-1234567890-1234",
    serverId: testAwsTransferServer.id,
    role: testAwsIamRole.arn,
    homeDirectory: `/${testAwsEfsFileSystem.id}/`,
});
import pulumi
import pulumi_aws as aws

test = aws.transfer.Access("test",
    posix_profile={
        "gid": 1000,
        "uid": 1000,
    },
    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']}/")
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()
    {
        PosixProfile = new Aws.Transfer.Inputs.AccessPosixProfileArgs
        {
            Gid = 1000,
            Uid = 1000,
        },
        ExternalId = "S-1-1-12-1234567890-123456789-1234567890-1234",
        ServerId = testAwsTransferServer.Id,
        Role = testAwsIamRole.Arn,
        HomeDirectory = $"/{testAwsEfsFileSystem.Id}/",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/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{
			PosixProfile: &transfer.AccessPosixProfileArgs{
				Gid: pulumi.Int(1000),
				Uid: pulumi.Int(1000),
			},
			ExternalId:    pulumi.String("S-1-1-12-1234567890-123456789-1234567890-1234"),
			ServerId:      pulumi.Any(testAwsTransferServer.Id),
			Role:          pulumi.Any(testAwsIamRole.Arn),
			HomeDirectory: pulumi.Sprintf("/%v/", testAwsEfsFileSystem.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_transfer_access" "test" {
  posix_profile = {
    gid = 1000
    uid = 1000
  }
  external_id    = "S-1-1-12-1234567890-123456789-1234567890-1234"
  server_id      = testAwsTransferServer.id
  role           = testAwsIamRole.arn
  home_directory ="/${testAwsEfsFileSystem.id}/"
}
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.ArrayList;
import java.util.Arrays;
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()
            .posixProfile(AccessPosixProfileArgs.builder()
                .gid(1000)
                .uid(1000)
                .build())
            .externalId("S-1-1-12-1234567890-123456789-1234567890-1234")
            .serverId(testAwsTransferServer.id())
            .role(testAwsIamRole.arn())
            .homeDirectory(String.format("/%s/", testAwsEfsFileSystem.id()))
            .build());

    }
}
resources:
  test:
    type: aws:transfer:Access
    properties:
      posixProfile:
        gid: 1000
        uid: 1000
      externalId: S-1-1-12-1234567890-123456789-1234567890-1234
      serverId: ${testAwsTransferServer.id}
      role: ${testAwsIamRole.arn}
      homeDirectory: /${testAwsEfsFileSystem.id}/

Import

Using pulumi import, import Transfer Accesses using the serverId and externalId. For example:

$ pulumi import aws:transfer/access:Access example s-12345678/S-1-1-12-1234567890-123456789-1234567890-1234

Constructors

Access(String name, {AccessArgs? args, CustomResourceOptions? options})
Creates a new Access. name The Pulumi resource name. args Arguments used to configure this Access. The set of arguments for Access. options Resource options controlling this resource's behavior.
Access.reference(String urn)
Creates a typed reference to an existing Access resource.

Properties

childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
externalId ↔ Output<String>
SID of a group in the directory connected to the Transfer Server (e.g., S-1-1-12-1234567890-123456789-1234567890-1234)
latefinal
hashCode → int
The hash code for this object.
no setterinherited
homeDirectory ↔ Output<String?>
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.
latefinal
homeDirectoryMappings ↔ Output<List<AccessHomeDirectoryMapping>?>
Logical directory mappings that specify what S3 paths and keys should be visible to your user and how you want to make them visible. See homeDirectoryMappings Block below.
latefinal
homeDirectoryType ↔ Output<String?>
Type of landing directory (folder) you mapped for your users' home directory. Valid values are PATH and LOGICAL.
latefinal
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
policy ↔ Output<String?>
IAM JSON policy document that scopes down user access to portions of their Amazon S3 bucket. IAM variables you can use inside this policy include ${Transfer:UserName}, ${Transfer:HomeDirectory}, and ${Transfer:HomeBucket}. These are evaluated on-the-fly when navigating the bucket.
latefinal
posixProfile ↔ Output<AccessPosixProfile?>
Full POSIX identity, including user ID (Uid), group ID (Gid), and any secondary groups IDs (SecondaryGids), that controls your users' access to your Amazon EFS file systems. See posixProfile Block below.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
role ↔ Output<String?>
ARN of an IAM role that allows the service to controls your user’s access to your Amazon S3 bucket.
latefinal
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
serverId ↔ Output<String>
Server ID of the Transfer Server (e.g., s-12345678)
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {AccessState? state, CustomResourceOptions? options}) → Access
Gets an existing Access resource's state with the given name and id.