{
  "typeName" : "AWS::DataSync::LocationHDFS",
  "description" : "Resource Type definition for AWS::DataSync::LocationHDFS.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-datasync.git",
  "definitions" : {
    "NameNode" : {
      "additionalProperties" : false,
      "description" : "HDFS Name Node IP and port information.",
      "type" : "object",
      "properties" : {
        "Hostname" : {
          "description" : "The DNS name or IP address of the Name Node in the customer's on premises HDFS cluster.",
          "type" : "string",
          "pattern" : "^(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])$",
          "maxLength" : 255
        },
        "Port" : {
          "description" : "The port on which the Name Node is listening on for client requests.",
          "type" : "integer",
          "minimum" : 1,
          "maximum" : 65536
        }
      },
      "required" : [ "Hostname", "Port" ]
    },
    "Tag" : {
      "additionalProperties" : false,
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "description" : "The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "description" : "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ]
    },
    "QopConfiguration" : {
      "additionalProperties" : false,
      "description" : "Configuration information for RPC Protection and Data Transfer Protection. These parameters can be set to AUTHENTICATION, INTEGRITY, or PRIVACY. The default value is PRIVACY.",
      "type" : "object",
      "properties" : {
        "RpcProtection" : {
          "type" : "string",
          "description" : "Configuration for RPC Protection.",
          "enum" : [ "AUTHENTICATION", "INTEGRITY", "PRIVACY", "DISABLED" ],
          "default" : "PRIVACY"
        },
        "DataTransferProtection" : {
          "type" : "string",
          "description" : "Configuration for Data Transfer Protection.",
          "enum" : [ "AUTHENTICATION", "INTEGRITY", "PRIVACY", "DISABLED" ],
          "default" : "PRIVACY"
        }
      }
    },
    "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" : {
    "NameNodes" : {
      "description" : "An array of Name Node(s) of the HDFS location.",
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/NameNode"
      },
      "minItems" : 1,
      "insertionOrder" : false
    },
    "BlockSize" : {
      "description" : "Size of chunks (blocks) in bytes that the data is divided into when stored in the HDFS cluster.",
      "type" : "integer",
      "format" : "int64",
      "minimum" : 1048576,
      "maximum" : 1073741824
    },
    "ReplicationFactor" : {
      "description" : "Number of copies of each block that exists inside the HDFS cluster.",
      "type" : "integer",
      "format" : "int64",
      "default" : 3,
      "minimum" : 1,
      "maximum" : 512
    },
    "KmsKeyProviderUri" : {
      "description" : "The identifier for the Key Management Server where the encryption keys that encrypt data inside HDFS clusters are stored.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 255,
      "pattern" : "^kms:\\/\\/http[s]?@(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])(;(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9]))*:[0-9]{1,5}\\/kms$"
    },
    "QopConfiguration" : {
      "$ref" : "#/definitions/QopConfiguration"
    },
    "AuthenticationType" : {
      "description" : "The authentication mode used to determine identity of user.",
      "type" : "string",
      "enum" : [ "SIMPLE", "KERBEROS" ]
    },
    "SimpleUser" : {
      "description" : "The user name that has read and write permissions on the specified HDFS cluster.",
      "type" : "string",
      "pattern" : "^[_.A-Za-z0-9][-_.A-Za-z0-9]*$",
      "minLength" : 1,
      "maxLength" : 256
    },
    "KerberosPrincipal" : {
      "description" : "The unique identity, or principal, to which Kerberos can assign tickets.",
      "type" : "string",
      "pattern" : "^.+$",
      "minLength" : 1,
      "maxLength" : 256
    },
    "KerberosKeytab" : {
      "description" : "The Base64 string representation of the Keytab file.",
      "type" : "string",
      "maxLength" : 87384
    },
    "KerberosKrb5Conf" : {
      "description" : "The string representation of the Krb5Conf file, or the presigned URL to access the Krb5.conf file within an S3 bucket.",
      "type" : "string",
      "maxLength" : 174764
    },
    "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"
      }
    },
    "AgentArns" : {
      "description" : "ARN(s) of the agent(s) to use for an HDFS location.",
      "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
    },
    "Subdirectory" : {
      "description" : "The subdirectory in HDFS that is used to read data from the HDFS source location or write data to the HDFS destination.",
      "type" : "string",
      "maxLength" : 4096,
      "pattern" : "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$"
    },
    "LocationArn" : {
      "description" : "The Amazon Resource Name (ARN) of the HDFS location.",
      "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 HDFS location that was described.",
      "type" : "string",
      "pattern" : "^(efs|nfs|s3|smb|fsxw|hdfs)://[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" : [ "NameNodes", "AuthenticationType", "AgentArns" ],
  "readOnlyProperties" : [ "/properties/LocationArn", "/properties/LocationUri", "/properties/ManagedSecretConfig", "/properties/CmkSecretConfig/SecretArn" ],
  "primaryIdentifier" : [ "/properties/LocationArn" ],
  "writeOnlyProperties" : [ "/properties/Subdirectory", "/properties/KerberosKeytab", "/properties/KerberosKrb5Conf" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "datasync:CreateLocationHdfs", "datasync:DescribeLocationHdfs", "datasync:TagResource", "datasync:ListTagsForResource", "secretsmanager:CreateSecret", "secretsmanager:PutSecretValue", "secretsmanager:DeleteSecret", "iam:CreateServiceLinkedRole", "iam:PassRole", "kms:Encrypt", "kms:Decrypt", "kms:GenerateDataKey" ]
    },
    "read" : {
      "permissions" : [ "datasync:DescribeLocationHdfs", "datasync:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "datasync:UpdateLocationHdfs", "datasync:DescribeLocationHdfs", "datasync:ListTagsForResource", "datasync:TagResource", "datasync:UntagResource", "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" ]
    }
  }
}