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:StringAgentArns:- StringBucketName:StringSecretKey:StringServerCertificate:StringServerHostname:StringServerPort:IntegerServerProtocol:StringSubdirectory:StringTags:- 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:
1Maximum:
200Pattern:
^.+$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:
4Update requires: No interruption
BucketName-
Specifies the name of the object storage bucket involved in the transfer.
Required: No
Type: String
Minimum:
3Maximum:
63Pattern:
^[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:
1Maximum:
200Pattern:
^.+$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
.pemextension
The file can be up to 32768 bytes (before base64 encoding).
To use this parameter, configure
ServerProtocoltoHTTPS.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:
255Pattern:
^(([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:
1Maximum:
65536Update requires: No interruption
ServerProtocol-
Specifies the protocol that your object storage server uses to communicate.
Required: No
Type: String
Allowed values:
HTTP | HTTPSUpdate 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:
4096Pattern:
^[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:
50Update 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.
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