aws.datasync.S3Location
Explore with Pulumi AI
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:
- S3Bucket
Arn string - Amazon Resource Name (ARN) of the S3 Bucket.
- S3Config
S3Location
S3Config - Configuration block containing information for connecting to S3.
- Subdirectory string
- Prefix to perform actions as source or destination.
- Agent
Arns List<string> - A list of DataSync Agent ARNs with which this location will be associated.
- S3Storage
Class 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
- 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.
- S3Bucket
Arn string - Amazon Resource Name (ARN) of the S3 Bucket.
- S3Config
S3Location
S3Config Args - Configuration block containing information for connecting to S3.
- Subdirectory string
- Prefix to perform actions as source or destination.
- Agent
Arns []string - A list of DataSync Agent ARNs with which this location will be associated.
- S3Storage
Class 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
- 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.
- s3Bucket
Arn String - Amazon Resource Name (ARN) of the S3 Bucket.
- s3Config
S3Location
S3Config - Configuration block containing information for connecting to S3.
- subdirectory String
- Prefix to perform actions as source or destination.
- agent
Arns List<String> - A list of DataSync Agent ARNs with which this location will be associated.
- s3Storage
Class 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
- 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.
- s3Bucket
Arn ARN - Amazon Resource Name (ARN) of the S3 Bucket.
- s3Config
S3Location
S3Config - Configuration block containing information for connecting to S3.
- subdirectory string
- Prefix to perform actions as source or destination.
- agent
Arns string[] - A list of DataSync Agent ARNs with which this location will be associated.
- s3Storage
Class 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
- {[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_ strarn - Amazon Resource Name (ARN) of the S3 Bucket.
- s3_
config S3LocationS3Config Args - 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_ strclass - The Amazon S3 storage class that you want to store your files in when this location is used as a task destination. Valid values
- 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.
- s3Bucket
Arn - 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.
- agent
Arns List<String> - A list of DataSync Agent ARNs with which this location will be associated.
- s3Storage
Class 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
- 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:
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.
- Agent
Arns 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.
- S3Bucket
Arn string - Amazon Resource Name (ARN) of the S3 Bucket.
- S3Config
S3Location
S3Config - Configuration block containing information for connecting to S3.
- S3Storage
Class 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.
- 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. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Uri string
- Agent
Arns []string - A list of DataSync Agent ARNs with which this location will be associated.
- Arn string
- Amazon Resource Name (ARN) of the DataSync Location.
- S3Bucket
Arn string - Amazon Resource Name (ARN) of the S3 Bucket.
- S3Config
S3Location
S3Config Args - Configuration block containing information for connecting to S3.
- S3Storage
Class 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.
- 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. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Uri string
- agent
Arns 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.
- s3Bucket
Arn String - Amazon Resource Name (ARN) of the S3 Bucket.
- s3Config
S3Location
S3Config - Configuration block containing information for connecting to S3.
- s3Storage
Class 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.
- 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. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - uri String
- agent
Arns string[] - A list of DataSync Agent ARNs with which this location will be associated.
- arn string
- Amazon Resource Name (ARN) of the DataSync Location.
- s3Bucket
Arn ARN - Amazon Resource Name (ARN) of the S3 Bucket.
- s3Config
S3Location
S3Config - Configuration block containing information for connecting to S3.
- s3Storage
Class 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.
- {[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. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - 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_ strarn - Amazon Resource Name (ARN) of the S3 Bucket.
- s3_
config S3LocationS3Config Args - Configuration block containing information for connecting to S3.
- s3_
storage_ strclass - 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.
- 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. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - uri str
- agent
Arns 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.
- s3Bucket
Arn - Amazon Resource Name (ARN) of the S3 Bucket.
- s3Config Property Map
- Configuration block containing information for connecting to S3.
- s3Storage
Class 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.
- 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. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - uri String
Supporting Types
S3LocationS3Config, S3LocationS3ConfigArgs
- Bucket
Access stringRole Arn - ARN of the IAM Role used to connect to the S3 Bucket.
- Bucket
Access stringRole Arn - ARN of the IAM Role used to connect to the S3 Bucket.
- bucket
Access StringRole Arn - ARN of the IAM Role used to connect to the S3 Bucket.
- bucket
Access stringRole Arn - ARN of the IAM Role used to connect to the S3 Bucket.
- bucket_
access_ strrole_ arn - ARN of the IAM Role used to connect to the S3 Bucket.
- bucket
Access StringRole Arn - 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.