AWS::DataSync::LocationObjectStorage - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

AWS::DataSync::LocationObjectStorage

The AWS::DataSync::LocationObjectStorage resource specifies an endpoint for a self-managed object storage bucket. For more information about self-managed object storage locations, see Creating a Location for Object Storage.

Syntax

To declare this entity in your Amazon CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::DataSync::LocationObjectStorage", "Properties" : { "AccessKey" : String, "AgentArns" : [ String, ... ], "BucketName" : String, "SecretKey" : String, "ServerCertificate" : String, "ServerHostname" : String, "ServerPort" : Integer, "ServerProtocol" : String, "Subdirectory" : String, "Tags" : [ Tag, ... ] } }

YAML

Type: AWS::DataSync::LocationObjectStorage Properties: AccessKey: String AgentArns: - String BucketName: String SecretKey: String ServerCertificate: String ServerHostname: String ServerPort: Integer ServerProtocol: String Subdirectory: String Tags: - Tag

Properties

AccessKey

Specifies the access key (for example, a user name) if credentials are required to authenticate with the object storage server.

Required: No

Type: String

Minimum: 1

Maximum: 200

Pattern: ^.+$

Update requires: No interruption

AgentArns

Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can securely connect with your location.

Required: Yes

Type: List of String

Maximum: 4

Update requires: No interruption

BucketName

Specifies the name of the object storage bucket involved in the transfer.

Required: No

Type: String

Minimum: 3

Maximum: 63

Pattern: ^[a-zA-Z0-9_\-\+\./\(\)\$\p{Zs}]+$

Update requires: Replacement

SecretKey

Specifies the secret key (for example, a password) if credentials are required to authenticate with the object storage server.

Required: No

Type: String

Minimum: 1

Maximum: 200

Pattern: ^.+$

Update requires: No interruption

ServerCertificate

Specifies a file with the certificates that are used to sign the object storage server's certificate (for example, file:///home/user/.ssh/storage_sys_certificate.pem). The file you specify must include the following:

  • The certificate of the signing certificate authority (CA)

  • Any intermediate certificates

  • base64 encoding

  • A .pem extension

The file can be up to 32768 bytes (before base64 encoding).

To use this parameter, configure ServerProtocol to HTTPS.

Required: No

Type: String

Update requires: No interruption

ServerHostname

Specifies the domain name or IP address of the object storage server. A DataSync agent uses this hostname to mount the object storage server in a network.

Required: No

Type: String

Maximum: 255

Pattern: ^(([a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9\-]*[A-Za-z0-9])$

Update requires: Replacement

ServerPort

Specifies the port that your object storage server accepts inbound network traffic on (for example, port 443).

Required: No

Type: Integer

Minimum: 1

Maximum: 65536

Update requires: No interruption

ServerProtocol

Specifies the protocol that your object storage server uses to communicate.

Required: No

Type: String

Allowed values: HTTP | HTTPS

Update requires: No interruption

Subdirectory

Specifies the object prefix for your object storage server. If this is a source location, DataSync only copies objects with this prefix. If this is a destination location, DataSync writes all objects with this prefix.

Required: No

Type: String

Maximum: 4096

Pattern: ^[a-zA-Z0-9_\-\+\./\(\)\p{Zs}]*$

Update requires: No interruption

Tags

Specifies the key-value pair that represents a tag that you want to add to the resource. Tags can help you manage, filter, and search for your resources. We recommend creating a name tag for your location.

Required: No

Type: List of Tag

Maximum: 50

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the location resource Amazon Resource Name (ARN). For example:

arn:aws:datasync:us-east-2:111222333444:location/loc-07db7abfc326c50s3

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

LocationArn

The Amazon Resource Name (ARN) of the specified object storage location.

LocationUri

The URI of the specified object storage location.

Examples

Create an object storage location for DataSync

The following example specifies an object storage location for DataSync. In this example, the object storage location uses the bucket named MyBucket, on the server named MyServer@example.com. This example also specifies the server protocol HTTPS and the subdirectory /Subdirectory.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "Specifies an object storage location for DataSync", "Resources": { "LocationObjectStorage": { "Type": "AWS::DataSync::LocationObjectStorage", "Properties": { "AgentArns": [ "arn:aws:datasync:us-east-2:111222333444:agent/agent-0b0addbeef44b3nfs" ], "BucketName": "MyBucket", "ServerHostname": "MyServer@example.com", "ServerProtocol": "HTTPS", "Subdirectory": "/MySubdirectory" } } }

YAML

AWSTemplateFormatVersion: 2010-09-09 Description: Specifies an object storage location for DataSync Resources: LocationObjectStorage: Type: AWS::DataSync::LocationObjectStorage Properties: AgentArns: - arn:aws:datasync:us-east-2:111222333444:agent/agent-0b0addbeef44b3nfs BucketName: MyBucket ServerHostname: MyServer@example.com ServerProtocol: HTTPS Subdirectory: /MySubdirectory