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 AWS 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
Pattern:
^.+$
Minimum:
1
Maximum:
200
Update requires: No interruption
AgentArns
-
Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can connect with your object storage system.
Required: Yes
Type: Array of String
Minimum:
1
Maximum:
128 | 4
Update requires: No interruption
BucketName
-
Specifies the name of the object storage bucket involved in the transfer.
Required: No
Type: String
Pattern:
^[a-zA-Z0-9_\-\+\./\(\)\$\p{Zs}]+$
Minimum:
3
Maximum:
63
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
Pattern:
^.+$
Minimum:
8
Maximum:
200
Update requires: No interruption
ServerCertificate
-
Specifies a certificate chain for DataSync to authenticate with your object storage system if the system uses a private or self-signed certificate authority (CA). You must specify a single
.pem
file with a full certificate chain (for example,file:///home/user/.ssh/object_storage_certificates.pem
).The certificate chain might include:
-
The object storage system's certificate
-
All intermediate certificates (if there are any)
-
The root certificate of the signing CA
You can concatenate your certificates into a
.pem
file (which can be up to 32768 bytes before base64 encoding). The following examplecat
command creates anobject_storage_certificates.pem
file that includes three certificates:cat object_server_certificate.pem intermediate_certificate.pem ca_root_certificate.pem > object_storage_certificates.pem
To use this parameter, configure
ServerProtocol
toHTTPS
.Required: No
Type: String
Maximum:
32768
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
Pattern:
^(([a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9\-]*[A-Za-z0-9])$
Maximum:
255
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:
HTTPS | HTTP
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
Pattern:
^[a-zA-Z0-9_\-\+\./\(\)\p{Zs}]*$
Maximum:
4096
Update requires: No interruption
-
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: Array 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