{
  "typeName" : "AWS::DataSync::LocationFSxWindows",
  "description" : "Resource Type definition for AWS::DataSync::LocationFSxWindows.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-datasync.git",
  "definitions" : {
    "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" ]
    },
    "CmkSecretConfig" : {
      "additionalProperties" : false,
      "description" : "Specifies configuration information for a DataSync-managed secret, such as an authentication token or set of credentials that DataSync uses to access a specific transfer location, and a customer-managed AWS KMS key.",
      "type" : "object",
      "properties" : {
        "SecretArn" : {
          "description" : "Specifies the ARN for an AWS Secrets Manager secret, managed by DataSync.",
          "type" : "string",
          "pattern" : "^(arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):secretsmanager:[a-z-0-9]+:[0-9]{12}:secret:.*|)$",
          "maxLength" : 2048
        },
        "KmsKeyArn" : {
          "description" : "Specifies the ARN for the customer-managed AWS KMS key used to encrypt the secret specified for SecretArn. DataSync provides this key to AWS Secrets Manager.",
          "type" : "string",
          "pattern" : "^(arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):kms:[a-z-0-9]+:[0-9]{12}:key/.*|)$",
          "maxLength" : 2048
        }
      }
    },
    "CustomSecretConfig" : {
      "additionalProperties" : false,
      "description" : "Specifies configuration information for a customer-managed secret, such as an authentication token or set of credentials that DataSync uses to access a specific transfer location, and an IAM role that DataSync can assume and access the customer-managed secret.",
      "type" : "object",
      "properties" : {
        "SecretArn" : {
          "description" : "Specifies the ARN for a customer created AWS Secrets Manager secret.",
          "type" : "string",
          "pattern" : "^(arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):secretsmanager:[a-z-0-9]+:[0-9]{12}:secret:.*|)$",
          "maxLength" : 2048
        },
        "SecretAccessRoleArn" : {
          "description" : "Specifies the ARN for the AWS Identity and Access Management role that DataSync uses to access the secret specified for SecretArn.",
          "type" : "string",
          "pattern" : "^(arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):iam::[0-9]{12}:role/.*|)$",
          "maxLength" : 2048
        }
      },
      "required" : [ "SecretArn", "SecretAccessRoleArn" ]
    },
    "ManagedSecretConfig" : {
      "additionalProperties" : false,
      "description" : "Specifies configuration information for a DataSync-managed secret, such as an authentication token or set of credentials that DataSync uses to access a specific transfer location. DataSync uses the default AWS-managed KMS key to encrypt this secret in AWS Secrets Manager.",
      "type" : "object",
      "properties" : {
        "SecretArn" : {
          "description" : "Specifies the ARN for an AWS Secrets Manager secret.",
          "type" : "string",
          "pattern" : "^(arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):secretsmanager:[a-z-0-9]+:[0-9]{12}:secret:.*|)$",
          "maxLength" : 2048
        }
      },
      "required" : [ "SecretArn" ]
    }
  },
  "properties" : {
    "Domain" : {
      "description" : "The name of the Windows domain that the FSx for Windows server belongs to.",
      "type" : "string",
      "maxLength" : 253,
      "pattern" : "^([A-Za-z0-9]+[A-Za-z0-9-.]*)*[A-Za-z0-9-]*[A-Za-z0-9]$"
    },
    "FsxFilesystemArn" : {
      "description" : "The Amazon Resource Name (ARN) for the FSx for Windows file system.",
      "type" : "string",
      "maxLength" : 128,
      "pattern" : "^arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):fsx:[a-z\\-0-9]*:[0-9]{12}:file-system/fs-.*$"
    },
    "Password" : {
      "description" : "The password of the user who has the permissions to access files and folders in the FSx for Windows file system.",
      "type" : "string",
      "maxLength" : 104,
      "pattern" : "^.{0,104}$"
    },
    "SecurityGroupArns" : {
      "description" : "The ARNs of the security groups that are to use to configure the FSx for Windows file system.",
      "type" : "array",
      "items" : {
        "type" : "string",
        "maxLength" : 128,
        "pattern" : "^arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:security-group/.*$"
      },
      "insertionOrder" : false
    },
    "Subdirectory" : {
      "description" : "A subdirectory in the location's path.",
      "type" : "string",
      "maxLength" : 4096,
      "pattern" : "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$"
    },
    "User" : {
      "description" : "The user who has the permissions to access files and folders in the FSx for Windows file system.",
      "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 Amazon FSx for Windows file system location that is created.",
      "type" : "string",
      "pattern" : "^arn:(aws|aws-cn|aws-us-gov|aws-eusc|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 FSx for Windows location that was described.",
      "type" : "string",
      "pattern" : "^(efs|nfs|s3|smb|fsxw)://[a-zA-Z0-9./\\-]+$",
      "maxLength" : 4356
    },
    "CmkSecretConfig" : {
      "$ref" : "#/definitions/CmkSecretConfig"
    },
    "CustomSecretConfig" : {
      "$ref" : "#/definitions/CustomSecretConfig"
    },
    "ManagedSecretConfig" : {
      "$ref" : "#/definitions/ManagedSecretConfig"
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "datasync:TagResource", "datasync:UntagResource", "datasync:ListTagsForResource" ]
  },
  "additionalProperties" : false,
  "required" : [ "User", "SecurityGroupArns" ],
  "readOnlyProperties" : [ "/properties/LocationArn", "/properties/LocationUri", "/properties/ManagedSecretConfig", "/properties/CmkSecretConfig/SecretArn" ],
  "writeOnlyProperties" : [ "/properties/Password", "/properties/Subdirectory", "/properties/FsxFilesystemArn" ],
  "primaryIdentifier" : [ "/properties/LocationArn" ],
  "createOnlyProperties" : [ "/properties/FsxFilesystemArn", "/properties/SecurityGroupArns" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "datasync:CreateLocationFsxWindows", "datasync:DescribeLocationFsxWindows", "datasync:ListTagsForResource", "datasync:TagResource", "fsx:DescribeFileSystems", "ec2:DescribeNetworkInterfaces", "ec2:DescribeSubnets", "ec2:DescribeSecurityGroups", "secretsmanager:CreateSecret", "secretsmanager:PutSecretValue", "secretsmanager:DeleteSecret", "iam:CreateServiceLinkedRole", "iam:PassRole", "kms:Encrypt", "kms:Decrypt", "kms:GenerateDataKey" ]
    },
    "read" : {
      "permissions" : [ "datasync:DescribeLocationFsxWindows", "datasync:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "datasync:DescribeLocationFsxWindows", "datasync:UpdateLocationFsxWindows", "datasync:ListTagsForResource", "datasync:TagResource", "datasync:UntagResource", "fsx:DescribeFileSystems", "ec2:DescribeNetworkInterfaces", "secretsmanager:UpdateSecret", "secretsmanager:DeleteSecret", "secretsmanager:PutSecretValue", "secretsmanager:CreateSecret", "iam:CreateServiceLinkedRole", "iam:PassRole", "kms:Encrypt", "kms:Decrypt", "kms:GenerateDataKey" ]
    },
    "delete" : {
      "permissions" : [ "datasync:DeleteLocation", "secretsmanager:DeleteSecret" ]
    },
    "list" : {
      "permissions" : [ "datasync:ListLocations" ]
    }
  }
}