{
  "typeName" : "AWS::WorkspacesInstances::Volume",
  "description" : "Resource Type definition for AWS::WorkspacesInstances::Volume - Manages WorkSpaces Volume resources",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-schema.git",
  "definitions" : {
    "Tag" : {
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "description" : "The key name of the tag",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "description" : "The value for the tag",
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    },
    "TagSpecification" : {
      "type" : "object",
      "properties" : {
        "ResourceType" : {
          "type" : "string",
          "enum" : [ "instance", "volume", "spot-instances-request", "network-interface" ]
        },
        "Tags" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Tag"
          },
          "description" : "The tags to apply to the resource"
        }
      },
      "additionalProperties" : false
    }
  },
  "properties" : {
    "VolumeId" : {
      "type" : "string",
      "description" : "Unique identifier for the volume",
      "pattern" : "^vol-[0-9a-zA-Z]{1,63}$"
    },
    "AvailabilityZone" : {
      "type" : "string",
      "description" : "The Availability Zone in which to create the volume",
      "pattern" : "^[a-z]{2}-[a-z]+-\\d[a-z](-[a-z0-9]+)?$"
    },
    "Encrypted" : {
      "type" : "boolean",
      "description" : "Indicates whether the volume should be encrypted"
    },
    "Iops" : {
      "type" : "integer",
      "description" : "The number of I/O operations per second (IOPS)",
      "minimum" : 0
    },
    "KmsKeyId" : {
      "type" : "string",
      "description" : "The identifier of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use for Amazon EBS encryption",
      "maxLength" : 128
    },
    "SizeInGB" : {
      "type" : "integer",
      "description" : "The size of the volume, in GiBs",
      "minimum" : 0
    },
    "SnapshotId" : {
      "type" : "string",
      "description" : "The snapshot from which to create the volume",
      "pattern" : "^snap-[0-9a-zA-Z]{1,63}$"
    },
    "Throughput" : {
      "type" : "integer",
      "description" : "The throughput to provision for a volume, with a maximum of 1,000 MiB/s",
      "minimum" : 0
    },
    "VolumeType" : {
      "type" : "string",
      "description" : "The volume type",
      "enum" : [ "standard", "io1", "io2", "gp2", "sc1", "st1", "gp3" ]
    },
    "TagSpecifications" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/TagSpecification"
      },
      "description" : "The tags passed to EBS volume",
      "maxItems" : 30
    }
  },
  "required" : [ "AvailabilityZone" ],
  "readOnlyProperties" : [ "/properties/VolumeId" ],
  "createOnlyProperties" : [ "/properties/AvailabilityZone", "/properties/Encrypted", "/properties/Iops", "/properties/KmsKeyId", "/properties/SizeInGB", "/properties/SnapshotId", "/properties/Throughput", "/properties/VolumeType", "/properties/TagSpecifications" ],
  "primaryIdentifier" : [ "/properties/VolumeId" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "workspaces-instances:CreateVolume", "ec2:CreateVolume", "ec2:CreateTags" ]
    },
    "read" : {
      "permissions" : [ "ec2:DescribeVolumes" ]
    },
    "delete" : {
      "permissions" : [ "workspaces-instances:DeleteVolume", "ec2:DescribeVolumes", "ec2:DeleteVolume" ]
    },
    "list" : {
      "permissions" : [ "ec2:DescribeVolumes" ]
    }
  },
  "tagging" : {
    "taggable" : false,
    "tagOnCreate" : false,
    "tagUpdatable" : false,
    "cloudFormationSystemTags" : false
  },
  "additionalProperties" : false
}