{
  "typeName" : "AWS::DataSync::LocationSMB",
  "description" : "Resource schema for AWS::DataSync::LocationSMB.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-datasync.git",
  "definitions" : {
    "MountOptions" : {
      "additionalProperties" : false,
      "description" : "The mount options used by DataSync to access the SMB server.",
      "type" : "object",
      "properties" : {
        "Version" : {
          "description" : "The specific SMB version that you want DataSync to use to mount your SMB share.",
          "type" : "string",
          "enum" : [ "AUTOMATIC", "SMB1", "SMB2_0", "SMB2", "SMB3" ]
        }
      }
    },
    "Tag" : {
      "additionalProperties" : false,
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "description" : "The key for an AWS resource tag.",
          "pattern" : "^[a-zA-Z0-9\\s+=._:/-]+$",
          "maxLength" : 256,
          "minLength" : 1
        },
        "Value" : {
          "type" : "string",
          "description" : "The value for an AWS resource tag.",
          "pattern" : "^[a-zA-Z0-9\\s+=._:@/-]+$",
          "maxLength" : 256,
          "minLength" : 1
        }
      },
      "required" : [ "Key", "Value" ]
    }
  },
  "properties" : {
    "AgentArns" : {
      "description" : "The Amazon Resource Names (ARNs) of agents to use for a Simple Message Block (SMB) location.",
      "type" : "array",
      "items" : {
        "type" : "string",
        "pattern" : "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$",
        "maxLength" : 128
      },
      "minItems" : 1,
      "maxItems" : 4,
      "insertionOrder" : false
    },
    "Domain" : {
      "description" : "The name of the Windows domain that the SMB server belongs to.",
      "type" : "string",
      "maxLength" : 253,
      "pattern" : "^([A-Za-z0-9]+[A-Za-z0-9-.]*)*[A-Za-z0-9-]*[A-Za-z0-9]$"
    },
    "MountOptions" : {
      "$ref" : "#/definitions/MountOptions",
      "default" : {
        "Version" : "AUTOMATIC"
      }
    },
    "Password" : {
      "description" : "The password of the user who can mount the share and has the permissions to access files and folders in the SMB share.",
      "type" : "string",
      "maxLength" : 104,
      "pattern" : "^.{0,104}$"
    },
    "ServerHostname" : {
      "description" : "The name of the SMB server. This value is the IP address or Domain Name Service (DNS) name of the SMB server.",
      "type" : "string",
      "maxLength" : 255,
      "pattern" : "^(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])$"
    },
    "Subdirectory" : {
      "description" : "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",
      "type" : "string",
      "maxLength" : 4096,
      "pattern" : "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$"
    },
    "User" : {
      "description" : "The user who can mount the share, has the permissions to access files and folders in the SMB share.",
      "type" : "string",
      "maxLength" : 104,
      "pattern" : "^[^\\x5B\\x5D\\\\/:;|=,+*?]{1,104}$"
    },
    "Tags" : {
      "description" : "An array of key-value pairs to apply to this resource.",
      "type" : "array",
      "maxItems" : 50,
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "LocationArn" : {
      "description" : "The Amazon Resource Name (ARN) of the SMB location that is created.",
      "type" : "string",
      "pattern" : "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$",
      "maxLength" : 128
    },
    "LocationUri" : {
      "description" : "The URL of the SMB location that was described.",
      "type" : "string",
      "pattern" : "^(efs|nfs|s3|smb|fsxw)://[a-zA-Z0-9./\\-]+$",
      "maxLength" : 4356
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags"
  },
  "additionalProperties" : false,
  "required" : [ "User", "AgentArns" ],
  "readOnlyProperties" : [ "/properties/LocationArn", "/properties/LocationUri" ],
  "primaryIdentifier" : [ "/properties/LocationArn" ],
  "writeOnlyProperties" : [ "/properties/Password", "/properties/Subdirectory", "/properties/ServerHostname" ],
  "createOnlyProperties" : [ "/properties/ServerHostname" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "datasync:CreateLocationSmb", "datasync:DescribeLocationSmb", "datasync:ListTagsForResource" ]
    },
    "read" : {
      "permissions" : [ "datasync:DescribeLocationSmb", "datasync:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "datasync:DescribeLocationSmb", "datasync:ListTagsForResource", "datasync:TagResource", "datasync:UntagResource", "datasync:UpdateLocationSmb" ]
    },
    "delete" : {
      "permissions" : [ "datasync:DeleteLocation" ]
    },
    "list" : {
      "permissions" : [ "datasync:ListLocations" ]
    }
  }
}