1. Packages
  2. AWS
  3. API Docs
  4. datasync
  5. S3Location
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.datasync.S3Location

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Manages an S3 Location within AWS DataSync.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.datasync.S3Location("example", {
        s3BucketArn: exampleAwsS3Bucket.arn,
        subdirectory: "/example/prefix",
        s3Config: {
            bucketAccessRoleArn: exampleAwsIamRole.arn,
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.datasync.S3Location("example",
        s3_bucket_arn=example_aws_s3_bucket["arn"],
        subdirectory="/example/prefix",
        s3_config={
            "bucket_access_role_arn": example_aws_iam_role["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(exampleAwsS3Bucket.Arn),
    			Subdirectory: pulumi.String("/example/prefix"),
    			S3Config: &datasync.S3LocationS3ConfigArgs{
    				BucketAccessRoleArn: pulumi.Any(exampleAwsIamRole.Arn),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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 = exampleAwsS3Bucket.Arn,
            Subdirectory = "/example/prefix",
            S3Config = new Aws.DataSync.Inputs.S3LocationS3ConfigArgs
            {
                BucketAccessRoleArn = exampleAwsIamRole.Arn,
            },
        });
    
    });
    
    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(exampleAwsS3Bucket.arn())
                .subdirectory("/example/prefix")
                .s3Config(S3LocationS3ConfigArgs.builder()
                    .bucketAccessRoleArn(exampleAwsIamRole.arn())
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:datasync:S3Location
        properties:
          s3BucketArn: ${exampleAwsS3Bucket.arn}
          subdirectory: /example/prefix
          s3Config:
            bucketAccessRoleArn: ${exampleAwsIamRole.arn}
    

    Create S3Location Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new S3Location(name: string, args: S3LocationArgs, opts?: CustomResourceOptions);
    @overload
    def S3Location(resource_name: str,
                   args: S3LocationArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def S3Location(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   s3_bucket_arn: Optional[str] = None,
                   s3_config: Optional[S3LocationS3ConfigArgs] = None,
                   subdirectory: Optional[str] = None,
                   agent_arns: Optional[Sequence[str]] = None,
                   s3_storage_class: Optional[str] = None,
                   tags: Optional[Mapping[str, str]] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var s3locationResource = new Aws.DataSync.S3Location("s3locationResource", new()
    {
        S3BucketArn = "string",
        S3Config = new Aws.DataSync.Inputs.S3LocationS3ConfigArgs
        {
            BucketAccessRoleArn = "string",
        },
        Subdirectory = "string",
        AgentArns = new[]
        {
            "string",
        },
        S3StorageClass = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := datasync.NewS3Location(ctx, "s3locationResource", &datasync.S3LocationArgs{
    	S3BucketArn: pulumi.String("string"),
    	S3Config: &datasync.S3LocationS3ConfigArgs{
    		BucketAccessRoleArn: pulumi.String("string"),
    	},
    	Subdirectory: pulumi.String("string"),
    	AgentArns: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	S3StorageClass: pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var s3locationResource = new S3Location("s3locationResource", S3LocationArgs.builder()
        .s3BucketArn("string")
        .s3Config(S3LocationS3ConfigArgs.builder()
            .bucketAccessRoleArn("string")
            .build())
        .subdirectory("string")
        .agentArns("string")
        .s3StorageClass("string")
        .tags(Map.of("string", "string"))
        .build());
    
    s3location_resource = aws.datasync.S3Location("s3locationResource",
        s3_bucket_arn="string",
        s3_config={
            "bucket_access_role_arn": "string",
        },
        subdirectory="string",
        agent_arns=["string"],
        s3_storage_class="string",
        tags={
            "string": "string",
        })
    
    const s3locationResource = new aws.datasync.S3Location("s3locationResource", {
        s3BucketArn: "string",
        s3Config: {
            bucketAccessRoleArn: "string",
        },
        subdirectory: "string",
        agentArns: ["string"],
        s3StorageClass: "string",
        tags: {
            string: "string",
        },
    });
    
    type: aws:datasync:S3Location
    properties:
        agentArns:
            - string
        s3BucketArn: string
        s3Config:
            bucketAccessRoleArn: string
        s3StorageClass: string
        subdirectory: string
        tags:
            string: string
    

    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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    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
    

    To learn more about importing existing cloud resources, see Importing resources.

    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
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi