{
  "typeName" : "AWS::DataSync::LocationAzureBlob",
  "description" : "Resource Type definition for AWS::DataSync::LocationAzureBlob.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-datasync.git",
  "definitions" : {
    "AzureBlobSasConfiguration" : {
      "additionalProperties" : false,
      "description" : "Specifies the shared access signature (SAS) that DataSync uses to access your Azure Blob Storage container.",
      "type" : "object",
      "properties" : {
        "AzureBlobSasToken" : {
          "description" : "Specifies the shared access signature (SAS) token, which indicates the permissions DataSync needs to access your Azure Blob Storage container.",
          "type" : "string",
          "pattern" : "(^.+$)",
          "minLength" : 1,
          "maxLength" : 255
        }
      },
      "required" : [ "AzureBlobSasToken" ]
    },
    "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" : {
    "AgentArns" : {
      "description" : "Specifies the Amazon Resource Name (ARN) of the DataSync agent that can connect with your Azure Blob Storage container. If you are setting up an agentless cross-cloud transfer, you do not need to specify a value for this parameter.",
      "type" : "array",
      "items" : {
        "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}:agent/agent-[0-9a-z]{17}$",
        "maxLength" : 128
      },
      "minItems" : 1,
      "maxItems" : 4,
      "insertionOrder" : false
    },
    "AzureBlobAuthenticationType" : {
      "description" : "The specific authentication type that you want DataSync to use to access your Azure Blob Container.",
      "type" : "string",
      "enum" : [ "SAS", "NONE" ],
      "default" : "SAS"
    },
    "AzureBlobSasConfiguration" : {
      "$ref" : "#/definitions/AzureBlobSasConfiguration"
    },
    "AzureBlobContainerUrl" : {
      "description" : "The URL of the Azure Blob container that was described.",
      "type" : "string",
      "pattern" : "^https://[A-Za-z0-9]((.|-+)?[A-Za-z0-9]){0,252}/[a-z0-9](-?[a-z0-9]){2,62}$",
      "maxLength" : 325
    },
    "AzureBlobType" : {
      "description" : "Specifies a blob type for the objects you're transferring into your Azure Blob Storage container.",
      "type" : "string",
      "enum" : [ "BLOCK" ],
      "default" : "BLOCK"
    },
    "AzureAccessTier" : {
      "description" : "Specifies an access tier for the objects you're transferring into your Azure Blob Storage container.",
      "type" : "string",
      "enum" : [ "HOT", "COOL", "ARCHIVE" ],
      "default" : "HOT"
    },
    "Subdirectory" : {
      "description" : "The subdirectory in the Azure Blob Container that is used to read data from the Azure Blob Source Location.",
      "type" : "string",
      "maxLength" : 1024,
      "pattern" : "^[\\p{L}\\p{M}\\p{Z}\\p{S}\\p{N}\\p{P}\\p{C}]*$"
    },
    "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 Azure Blob 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 Azure Blob Location that was described.",
      "type" : "string",
      "pattern" : "^(azure-blob)://[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" : false,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "datasync:TagResource", "datasync:UntagResource", "datasync:ListTagsForResource" ]
  },
  "additionalProperties" : false,
  "required" : [ "AzureBlobAuthenticationType" ],
  "readOnlyProperties" : [ "/properties/LocationArn", "/properties/LocationUri", "/properties/ManagedSecretConfig", "/properties/CmkSecretConfig/SecretArn" ],
  "primaryIdentifier" : [ "/properties/LocationArn" ],
  "writeOnlyProperties" : [ "/properties/Subdirectory", "/properties/AzureBlobSasConfiguration", "/properties/AzureBlobContainerUrl" ],
  "createOnlyProperties" : [ "/properties/AzureBlobContainerUrl" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "datasync:CreateLocationAzureBlob", "datasync:DescribeLocationAzureBlob", "datasync:TagResource", "datasync:ListTagsForResource", "secretsmanager:CreateSecret", "secretsmanager:PutSecretValue", "secretsmanager:DeleteSecret", "iam:CreateServiceLinkedRole", "iam:PassRole", "kms:Encrypt", "kms:Decrypt", "kms:GenerateDataKey" ]
    },
    "read" : {
      "permissions" : [ "datasync:DescribeLocationAzureBlob", "datasync:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "datasync:DescribeLocationAzureBlob", "datasync:ListTagsForResource", "datasync:TagResource", "datasync:UntagResource", "datasync:UpdateLocationAzureBlob", "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" ]
    }
  }
}