AWS::DataSync::LocationSMB
The AWS::DataSync::LocationSMB
resource specifies a Server Message Block
(SMB) location.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::DataSync::LocationSMB", "Properties" : { "AgentArns" :
[ String, ... ]
, "Domain" :String
, "MountOptions" :MountOptions
, "Password" :String
, "ServerHostname" :String
, "Subdirectory" :String
, "Tags" :[ Tag, ... ]
, "User" :String
} }
YAML
Type: AWS::DataSync::LocationSMB Properties: AgentArns:
- String
Domain:String
MountOptions:MountOptions
Password:String
ServerHostname:String
Subdirectory:String
Tags:- Tag
User:String
Properties
AgentArns
-
The Amazon Resource Names (ARNs) of agents to use for a Server Message Block (SMB) location.
Required: Yes
Type: Array of String
Minimum:
1
Maximum:
128 | 4
Update requires: No interruption
Domain
-
Specifies the name of the Active Directory domain that your SMB file server belongs to.
If you have multiple Active Directory domains in your environment, configuring this parameter makes sure that DataSync connects to the right file server.
Required: No
Type: String
Pattern:
^([A-Za-z0-9]+[A-Za-z0-9-.]*)*[A-Za-z0-9-]*[A-Za-z0-9]$
Maximum:
253
Update requires: No interruption
MountOptions
-
Specifies the version of the SMB protocol that DataSync uses to access your SMB file server.
Required: No
Type: MountOptions
Update requires: No interruption
Password
-
The password of the user who can mount the share and has the permissions to access files and folders in the SMB share.
Required: No
Type: String
Pattern:
^.{0,104}$
Maximum:
104
Update requires: No interruption
ServerHostname
-
Specifies the Domain Name Service (DNS) name or IP address of the SMB file server that your DataSync agent will mount.
Note
You can't specify an IP version 6 (IPv6) address.
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
Subdirectory
-
The subdirectory in the SMB file system that is used to read data from the SMB source location or write data to the SMB destination. The SMB path should be a path that's exported by the SMB server, or a subdirectory of that path. The path should be such that it can be mounted by other SMB clients in your network.
Note
Subdirectory
must be specified with forward slashes. For example,/path/to/folder
.To transfer all the data in the folder you specified, DataSync must have permissions to mount the SMB share, as well as to access all the data in that share. To ensure this, either make sure that the user name and password specified belongs to the user who can mount the share, and who has the appropriate permissions for all of the files and directories that you want DataSync to access, or use credentials of a member of the Backup Operators group to mount the share. Doing either one enables the agent to access the data. For the agent to access directories, you must additionally enable all execute access.
Required: No
Type: String
Pattern:
^[a-zA-Z0-9_\-\+\./\(\)\$\p{Zs}]+$
Maximum:
4096
Update requires: No interruption
-
Specifies labels that help you categorize, filter, and search for your AWS resources. We recommend creating at least a name tag for your location.
Required: No
Type: Array of Tag
Maximum:
50
Update requires: No interruption
User
-
The user who can mount the share and has the permissions to access files and folders in the SMB share.
For information about choosing a user name that ensures sufficient permissions to files, folders, and metadata, see user.
Required: Yes
Type: String
Pattern:
^[^\x5B\x5D\\/:;|=,+*?]{1,104}$
Maximum:
104
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 SMB file system.
LocationUri
-
The URI of the specified SMB location.
Examples
Create an SMB storage location for DataSync
The following example specifies an SMB storage location for DataSync. In this
example, the SMB location uses the domain EXAMPLE
with SMB version 3.
The server hostname is MyServer@example.com
, and the SMB location is in
the /share
subdirectory. This example specifies the user ID
user-1
.
JSON
{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "Specifies an SMB storage location for DataSync", "Resources": { "LocationSMB": { "Type": "AWS::DataSync::LocationSMB", "Properties": { "AgentArns": [ "arn:aws:datasync:us-east-2:111222333444:agent/agent-0b0addbeef44b3nfs,", "arn:aws:datasync:us-east-2:111222333444:agent/agent-2345noo35nnee1123ovo3" ], "Domain": "EXAMPLE", "MountOptions": { "Version": "SMB3" }, "Password": {"Ref": "Password"}, "ServerHostname": "MyServer.example.com", "Subdirectory": "/share", "User": "user-1" } } } }
YAML
AWSTemplateFormatVersion: 2010-09-09 Description: Specifies an object storage location for DataSync Resources: LocationSMB: Type: AWS::DataSync::LocationSMB Properties: AgentArns: - arn:aws:datasync:us-east-2:111222333444:agent/agent-0b0addbeef44b3nfs, - arn:aws:datasync:us-east-2:111222333444:agent/agent-2345noo35nnee1123ovo3 Domain: EXAMPLE MountOptions: Version: SMB3 Password: !Ref Password ServerHostname: MyServer.example.com Subdirectory: /share User: user-1