{
  "typeName" : "AWS::DataSync::LocationFSxONTAP",
  "description" : "Resource schema for AWS::DataSync::LocationFSxONTAP.",
  "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" ]
    },
    "Protocol" : {
      "additionalProperties" : false,
      "description" : "Configuration settings for NFS or SMB protocol.",
      "type" : "object",
      "properties" : {
        "NFS" : {
          "$ref" : "#/definitions/NFS"
        },
        "SMB" : {
          "$ref" : "#/definitions/SMB"
        }
      }
    },
    "NFS" : {
      "additionalProperties" : false,
      "description" : "NFS protocol configuration for FSx ONTAP file system.",
      "type" : "object",
      "properties" : {
        "MountOptions" : {
          "$ref" : "#/definitions/NfsMountOptions"
        }
      },
      "required" : [ "MountOptions" ]
    },
    "SMB" : {
      "additionalProperties" : false,
      "description" : "SMB protocol configuration for FSx ONTAP file system.",
      "type" : "object",
      "properties" : {
        "MountOptions" : {
          "$ref" : "#/definitions/SmbMountOptions"
        },
        "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]$"
        },
        "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}$"
        },
        "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}$"
        }
      },
      "required" : [ "User", "Password", "MountOptions" ]
    },
    "NfsMountOptions" : {
      "additionalProperties" : false,
      "description" : "The NFS mount options that DataSync can use to mount your NFS share.",
      "type" : "object",
      "properties" : {
        "Version" : {
          "description" : "The specific NFS version that you want DataSync to use to mount your NFS share.",
          "type" : "string",
          "enum" : [ "AUTOMATIC", "NFS3", "NFS4_0", "NFS4_1" ]
        }
      }
    },
    "SmbMountOptions" : {
      "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", "SMB2", "SMB3" ]
        }
      }
    }
  },
  "properties" : {
    "StorageVirtualMachineArn" : {
      "description" : "The Amazon Resource Name (ARN) for the FSx ONTAP SVM.",
      "type" : "string",
      "maxLength" : 162,
      "pattern" : "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):fsx:[a-z\\-0-9]+:[0-9]{12}:storage-virtual-machine/fs-[0-9a-f]+/svm-[0-9a-f]{17,}$"
    },
    "FsxFilesystemArn" : {
      "description" : "The Amazon Resource Name (ARN) for the FSx ONAP file system.",
      "type" : "string",
      "maxLength" : 128,
      "pattern" : "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):fsx:[a-z\\-0-9]+:[0-9]{12}:file-system/fs-[0-9a-f]+$"
    },
    "SecurityGroupArns" : {
      "description" : "The ARNs of the security groups that are to use to configure the FSx ONTAP file system.",
      "type" : "array",
      "items" : {
        "type" : "string",
        "maxLength" : 128,
        "pattern" : "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:security-group/sg-[a-f0-9]+$"
      },
      "maxItems" : 5,
      "minItems" : 1,
      "insertionOrder" : false
    },
    "Protocol" : {
      "$ref" : "#/definitions/Protocol"
    },
    "Subdirectory" : {
      "description" : "A subdirectory in the location's path.",
      "type" : "string",
      "maxLength" : 4096,
      "pattern" : "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$"
    },
    "Tags" : {
      "description" : "An array of key-value pairs to apply to this resource.",
      "type" : "array",
      "maxItems" : 50,
      "minItems" : 0,
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "LocationArn" : {
      "description" : "The Amazon Resource Name (ARN) of the Amazon FSx ONTAP file system 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 FSx ONTAP file system that was described.",
      "type" : "string",
      "pattern" : "^(efs|nfs|s3|smb|hdfs|fsx[a-z0-9-]+)://[a-zA-Z0-9.:/\\-]+$",
      "maxLength" : 4360
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags"
  },
  "additionalProperties" : false,
  "required" : [ "SecurityGroupArns", "StorageVirtualMachineArn" ],
  "readOnlyProperties" : [ "/properties/LocationArn", "/properties/LocationUri", "/properties/FsxFilesystemArn" ],
  "writeOnlyProperties" : [ "/properties/Protocol", "/properties/Subdirectory" ],
  "primaryIdentifier" : [ "/properties/LocationArn" ],
  "createOnlyProperties" : [ "/properties/StorageVirtualMachineArn", "/properties/SecurityGroupArns", "/properties/Protocol", "/properties/Subdirectory" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "datasync:CreateLocationFsxOntap", "datasync:DescribeLocationFsxOntap", "datasync:ListTagsForResource", "fsx:DescribeStorageVirtualMachines", "fsx:DescribeFileSystems", "ec2:DescribeNetworkInterfaces", "ec2:DescribeSubnets", "ec2:DescribeSecurityGroups" ]
    },
    "read" : {
      "permissions" : [ "datasync:DescribeLocationFsxOntap", "datasync:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "datasync:DescribeLocationFsxOntap", "datasync:ListTagsForResource", "datasync:TagResource", "datasync:UntagResource" ]
    },
    "delete" : {
      "permissions" : [ "datasync:DeleteLocation" ]
    },
    "list" : {
      "permissions" : [ "datasync:ListLocations" ]
    }
  }
}