AWS::DataSync::LocationSMB - AWS CloudFormation

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: List of String

Maximum: 4

Update requires: No interruption

Domain

The name of the Windows domain that the SMB server belongs to.

Required: No

Type: String

Maximum: 253

Pattern: ^([A-Za-z0-9]+[A-Za-z0-9-.]*)*[A-Za-z0-9-]*[A-Za-z0-9]$

Update requires: No interruption

MountOptions

The mount options used by DataSync to access the SMB 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: Yes

Type: String

Maximum: 104

Pattern: ^.{0,104}$

Update requires: No interruption

ServerHostname

The name of the SMB server. This value is the IP address or Domain Name Service (DNS) name of the SMB server. An agent that is installed on-premises uses this hostname to mount the SMB server in a network.

Note

This name must either be DNS-compliant or must be an IP version 4 (IPv4) address.

Required: Yes

Type: String

Maximum: 255

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

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: Yes

Type: String

Maximum: 4096

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

Update requires: No interruption

Tags

The key-value pair that represents the tag that you want to add to the location. The value can be an empty string. We recommend using tags to name your resources.

Required: No

Type: List 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

Maximum: 104

Pattern: ^[^\x5B\x5D\\/:;|=,+*?]{1,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