1. Packages
  2. AWS Classic
  3. API Docs
  4. datasync
  5. S3Location

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.13.1 published on Tuesday, Dec 5, 2023 by Pulumi

aws.datasync.S3Location

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.13.1 published on Tuesday, Dec 5, 2023 by Pulumi

    Manages an S3 Location within AWS DataSync.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.DataSync.S3Location("example", new()
        {
            S3BucketArn = aws_s3_bucket.Example.Arn,
            Subdirectory = "/example/prefix",
            S3Config = new Aws.DataSync.Inputs.S3LocationS3ConfigArgs
            {
                BucketAccessRoleArn = aws_iam_role.Example.Arn,
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/datasync"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := datasync.NewS3Location(ctx, "example", &datasync.S3LocationArgs{
    			S3BucketArn:  pulumi.Any(aws_s3_bucket.Example.Arn),
    			Subdirectory: pulumi.String("/example/prefix"),
    			S3Config: &datasync.S3LocationS3ConfigArgs{
    				BucketAccessRoleArn: pulumi.Any(aws_iam_role.Example.Arn),
    			},
    		})
    		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.datasync.S3Location;
    import com.pulumi.aws.datasync.S3LocationArgs;
    import com.pulumi.aws.datasync.inputs.S3LocationS3ConfigArgs;
    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 S3Location("example", S3LocationArgs.builder()        
                .s3BucketArn(aws_s3_bucket.example().arn())
                .subdirectory("/example/prefix")
                .s3Config(S3LocationS3ConfigArgs.builder()
                    .bucketAccessRoleArn(aws_iam_role.example().arn())
                    .build())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.datasync.S3Location("example",
        s3_bucket_arn=aws_s3_bucket["example"]["arn"],
        subdirectory="/example/prefix",
        s3_config=aws.datasync.S3LocationS3ConfigArgs(
            bucket_access_role_arn=aws_iam_role["example"]["arn"],
        ))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.datasync.S3Location("example", {
        s3BucketArn: aws_s3_bucket.example.arn,
        subdirectory: "/example/prefix",
        s3Config: {
            bucketAccessRoleArn: aws_iam_role.example.arn,
        },
    });
    
    resources:
      example:
        type: aws:datasync:S3Location
        properties:
          s3BucketArn: ${aws_s3_bucket.example.arn}
          subdirectory: /example/prefix
          s3Config:
            bucketAccessRoleArn: ${aws_iam_role.example.arn}
    

    Create S3Location Resource

    new S3Location(name: string, args: S3LocationArgs, opts?: CustomResourceOptions);
    @overload
    def S3Location(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   agent_arns: Optional[Sequence[str]] = None,
                   s3_bucket_arn: Optional[str] = None,
                   s3_config: Optional[S3LocationS3ConfigArgs] = None,
                   s3_storage_class: Optional[str] = None,
                   subdirectory: Optional[str] = None,
                   tags: Optional[Mapping[str, str]] = None)
    @overload
    def S3Location(resource_name: str,
                   args: S3LocationArgs,
                   opts: Optional[ResourceOptions] = None)
    func NewS3Location(ctx *Context, name string, args S3LocationArgs, opts ...ResourceOption) (*S3Location, error)
    public S3Location(string name, S3LocationArgs args, CustomResourceOptions? opts = null)
    public S3Location(String name, S3LocationArgs args)
    public S3Location(String name, S3LocationArgs args, CustomResourceOptions options)
    
    type: aws:datasync:S3Location
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args S3LocationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args S3LocationArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args S3LocationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args S3LocationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args S3LocationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    S3Location Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The S3Location resource accepts the following input properties:

    S3BucketArn string

    Amazon Resource Name (ARN) of the S3 Bucket.

    S3Config S3LocationS3Config

    Configuration block containing information for connecting to S3.

    Subdirectory string

    Prefix to perform actions as source or destination.

    AgentArns List<string>

    A list of DataSync Agent ARNs with which this location will be associated.

    S3StorageClass string

    The Amazon S3 storage class that you want to store your files in when this location is used as a task destination. Valid values

    Tags Dictionary<string, string>

    Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    S3BucketArn string

    Amazon Resource Name (ARN) of the S3 Bucket.

    S3Config S3LocationS3ConfigArgs

    Configuration block containing information for connecting to S3.

    Subdirectory string

    Prefix to perform actions as source or destination.

    AgentArns []string

    A list of DataSync Agent ARNs with which this location will be associated.

    S3StorageClass string

    The Amazon S3 storage class that you want to store your files in when this location is used as a task destination. Valid values

    Tags map[string]string

    Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    s3BucketArn String

    Amazon Resource Name (ARN) of the S3 Bucket.

    s3Config S3LocationS3Config

    Configuration block containing information for connecting to S3.

    subdirectory String

    Prefix to perform actions as source or destination.

    agentArns List<String>

    A list of DataSync Agent ARNs with which this location will be associated.

    s3StorageClass String

    The Amazon S3 storage class that you want to store your files in when this location is used as a task destination. Valid values

    tags Map<String,String>

    Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    s3BucketArn ARN

    Amazon Resource Name (ARN) of the S3 Bucket.

    s3Config S3LocationS3Config

    Configuration block containing information for connecting to S3.

    subdirectory string

    Prefix to perform actions as source or destination.

    agentArns string[]

    A list of DataSync Agent ARNs with which this location will be associated.

    s3StorageClass string

    The Amazon S3 storage class that you want to store your files in when this location is used as a task destination. Valid values

    tags {[key: string]: string}

    Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    s3_bucket_arn str

    Amazon Resource Name (ARN) of the S3 Bucket.

    s3_config S3LocationS3ConfigArgs

    Configuration block containing information for connecting to S3.

    subdirectory str

    Prefix to perform actions as source or destination.

    agent_arns Sequence[str]

    A list of DataSync Agent ARNs with which this location will be associated.

    s3_storage_class str

    The Amazon S3 storage class that you want to store your files in when this location is used as a task destination. Valid values

    tags Mapping[str, str]

    Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    s3BucketArn

    Amazon Resource Name (ARN) of the S3 Bucket.

    s3Config Property Map

    Configuration block containing information for connecting to S3.

    subdirectory String

    Prefix to perform actions as source or destination.

    agentArns List<String>

    A list of DataSync Agent ARNs with which this location will be associated.

    s3StorageClass String

    The Amazon S3 storage class that you want to store your files in when this location is used as a task destination. Valid values

    tags Map<String>

    Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the S3Location resource produces the following output properties:

    Arn string

    Amazon Resource Name (ARN) of the DataSync Location.

    Id string

    The provider-assigned unique ID for this managed resource.

    TagsAll Dictionary<string, string>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    Uri string
    Arn string

    Amazon Resource Name (ARN) of the DataSync Location.

    Id string

    The provider-assigned unique ID for this managed resource.

    TagsAll map[string]string

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    Uri string
    arn String

    Amazon Resource Name (ARN) of the DataSync Location.

    id String

    The provider-assigned unique ID for this managed resource.

    tagsAll Map<String,String>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    uri String
    arn string

    Amazon Resource Name (ARN) of the DataSync Location.

    id string

    The provider-assigned unique ID for this managed resource.

    tagsAll {[key: string]: string}

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    uri string
    arn str

    Amazon Resource Name (ARN) of the DataSync Location.

    id str

    The provider-assigned unique ID for this managed resource.

    tags_all Mapping[str, str]

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    uri str
    arn String

    Amazon Resource Name (ARN) of the DataSync Location.

    id String

    The provider-assigned unique ID for this managed resource.

    tagsAll Map<String>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    uri String

    Look up Existing S3Location Resource

    Get an existing S3Location resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: S3LocationState, opts?: CustomResourceOptions): S3Location
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            agent_arns: Optional[Sequence[str]] = None,
            arn: Optional[str] = None,
            s3_bucket_arn: Optional[str] = None,
            s3_config: Optional[S3LocationS3ConfigArgs] = None,
            s3_storage_class: Optional[str] = None,
            subdirectory: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None,
            uri: Optional[str] = None) -> S3Location
    func GetS3Location(ctx *Context, name string, id IDInput, state *S3LocationState, opts ...ResourceOption) (*S3Location, error)
    public static S3Location Get(string name, Input<string> id, S3LocationState? state, CustomResourceOptions? opts = null)
    public static S3Location get(String name, Output<String> id, S3LocationState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AgentArns List<string>

    A list of DataSync Agent ARNs with which this location will be associated.

    Arn string

    Amazon Resource Name (ARN) of the DataSync Location.

    S3BucketArn string

    Amazon Resource Name (ARN) of the S3 Bucket.

    S3Config S3LocationS3Config

    Configuration block containing information for connecting to S3.

    S3StorageClass string

    The Amazon S3 storage class that you want to store your files in when this location is used as a task destination. Valid values

    Subdirectory string

    Prefix to perform actions as source or destination.

    Tags Dictionary<string, string>

    Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    TagsAll Dictionary<string, string>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    Uri string
    AgentArns []string

    A list of DataSync Agent ARNs with which this location will be associated.

    Arn string

    Amazon Resource Name (ARN) of the DataSync Location.

    S3BucketArn string

    Amazon Resource Name (ARN) of the S3 Bucket.

    S3Config S3LocationS3ConfigArgs

    Configuration block containing information for connecting to S3.

    S3StorageClass string

    The Amazon S3 storage class that you want to store your files in when this location is used as a task destination. Valid values

    Subdirectory string

    Prefix to perform actions as source or destination.

    Tags map[string]string

    Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    TagsAll map[string]string

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    Uri string
    agentArns List<String>

    A list of DataSync Agent ARNs with which this location will be associated.

    arn String

    Amazon Resource Name (ARN) of the DataSync Location.

    s3BucketArn String

    Amazon Resource Name (ARN) of the S3 Bucket.

    s3Config S3LocationS3Config

    Configuration block containing information for connecting to S3.

    s3StorageClass String

    The Amazon S3 storage class that you want to store your files in when this location is used as a task destination. Valid values

    subdirectory String

    Prefix to perform actions as source or destination.

    tags Map<String,String>

    Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    tagsAll Map<String,String>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    uri String
    agentArns string[]

    A list of DataSync Agent ARNs with which this location will be associated.

    arn string

    Amazon Resource Name (ARN) of the DataSync Location.

    s3BucketArn ARN

    Amazon Resource Name (ARN) of the S3 Bucket.

    s3Config S3LocationS3Config

    Configuration block containing information for connecting to S3.

    s3StorageClass string

    The Amazon S3 storage class that you want to store your files in when this location is used as a task destination. Valid values

    subdirectory string

    Prefix to perform actions as source or destination.

    tags {[key: string]: string}

    Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    tagsAll {[key: string]: string}

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    uri string
    agent_arns Sequence[str]

    A list of DataSync Agent ARNs with which this location will be associated.

    arn str

    Amazon Resource Name (ARN) of the DataSync Location.

    s3_bucket_arn str

    Amazon Resource Name (ARN) of the S3 Bucket.

    s3_config S3LocationS3ConfigArgs

    Configuration block containing information for connecting to S3.

    s3_storage_class str

    The Amazon S3 storage class that you want to store your files in when this location is used as a task destination. Valid values

    subdirectory str

    Prefix to perform actions as source or destination.

    tags Mapping[str, str]

    Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    tags_all Mapping[str, str]

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    uri str
    agentArns List<String>

    A list of DataSync Agent ARNs with which this location will be associated.

    arn String

    Amazon Resource Name (ARN) of the DataSync Location.

    s3BucketArn

    Amazon Resource Name (ARN) of the S3 Bucket.

    s3Config Property Map

    Configuration block containing information for connecting to S3.

    s3StorageClass String

    The Amazon S3 storage class that you want to store your files in when this location is used as a task destination. Valid values

    subdirectory String

    Prefix to perform actions as source or destination.

    tags Map<String>

    Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    tagsAll Map<String>

    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:

    Please use tags instead.

    uri String

    Supporting Types

    S3LocationS3Config, S3LocationS3ConfigArgs

    BucketAccessRoleArn string

    ARN of the IAM Role used to connect to the S3 Bucket.

    BucketAccessRoleArn string

    ARN of the IAM Role used to connect to the S3 Bucket.

    bucketAccessRoleArn String

    ARN of the IAM Role used to connect to the S3 Bucket.

    bucketAccessRoleArn string

    ARN of the IAM Role used to connect to the S3 Bucket.

    bucket_access_role_arn str

    ARN of the IAM Role used to connect to the S3 Bucket.

    bucketAccessRoleArn String

    ARN of the IAM Role used to connect to the S3 Bucket.

    Import

    Using pulumi import, import aws_datasync_location_s3 using the DataSync Task Amazon Resource Name (ARN). For example:

     $ pulumi import aws:datasync/s3Location:S3Location example arn:aws:datasync:us-east-1:123456789012:location/loc-12345678901234567
    

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the aws Terraform Provider.

    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.13.1 published on Tuesday, Dec 5, 2023 by Pulumi