{
  "typeName" : "AWS::NimbleStudio::StreamingImage",
  "description" : "Represents a streaming session machine image that can be used to launch a streaming session",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-nimblestudio",
  "definitions" : {
    "StreamingImageEncryptionConfiguration" : {
      "type" : "object",
      "description" : "<p>TODO</p>",
      "properties" : {
        "KeyType" : {
          "$ref" : "#/definitions/StreamingImageEncryptionConfigurationKeyType"
        },
        "KeyArn" : {
          "type" : "string",
          "minLength" : 4,
          "pattern" : "^arn:.*",
          "description" : "<p>The ARN for a KMS key that is used to encrypt studio data.</p>"
        }
      },
      "required" : [ "KeyType" ],
      "additionalProperties" : false
    },
    "StreamingImageEncryptionConfigurationKeyType" : {
      "type" : "string",
      "description" : "<p/>",
      "enum" : [ "CUSTOMER_MANAGED_KEY" ]
    },
    "Tags" : {
      "type" : "object",
      "description" : "",
      "patternProperties" : {
        ".+" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    }
  },
  "properties" : {
    "Description" : {
      "type" : "string",
      "maxLength" : 256,
      "minLength" : 0,
      "description" : "<p>A human-readable description of the streaming image.</p>"
    },
    "Ec2ImageId" : {
      "type" : "string",
      "pattern" : "^ami-[0-9A-z]+$",
      "description" : "<p>The ID of an EC2 machine image with which to create this streaming image.</p>"
    },
    "EncryptionConfiguration" : {
      "$ref" : "#/definitions/StreamingImageEncryptionConfiguration"
    },
    "EulaIds" : {
      "type" : "array",
      "items" : {
        "type" : "string"
      },
      "description" : "<p>The list of EULAs that must be accepted before a Streaming Session can be started using this streaming image.</p>"
    },
    "Name" : {
      "type" : "string",
      "maxLength" : 64,
      "minLength" : 0,
      "description" : "<p>A friendly name for a streaming image resource.</p>"
    },
    "Owner" : {
      "type" : "string",
      "description" : "<p>The owner of the streaming image, either the studioId that contains the streaming image, or 'amazon' for images that are provided by Amazon Nimble Studio.</p>"
    },
    "Platform" : {
      "type" : "string",
      "pattern" : "^[a-zA-Z]*$",
      "description" : "<p>The platform of the streaming image, either WINDOWS or LINUX.</p>"
    },
    "StreamingImageId" : {
      "type" : "string"
    },
    "StudioId" : {
      "type" : "string",
      "description" : "<p>The studioId. </p>"
    },
    "Tags" : {
      "$ref" : "#/definitions/Tags"
    }
  },
  "readOnlyProperties" : [ "/properties/EncryptionConfiguration", "/properties/EulaIds", "/properties/Owner", "/properties/Platform", "/properties/StreamingImageId" ],
  "createOnlyProperties" : [ "/properties/Ec2ImageId", "/properties/StudioId", "/properties/Tags" ],
  "primaryIdentifier" : [ "/properties/StudioId", "/properties/StreamingImageId" ],
  "required" : [ "StudioId", "Ec2ImageId", "Name" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "nimble:CreateStreamingImage", "nimble:TagResource", "ec2:DescribeImages", "ec2:DescribeSnapshots", "ec2:ModifyInstanceAttribute", "ec2:ModifySnapshotAttribute", "ec2:ModifyImageAttribute", "ec2:RegisterImage", "kms:Encrypt", "kms:Decrypt", "kms:CreateGrant", "kms:ListGrants", "kms:GenerateDataKey" ]
    },
    "read" : {
      "permissions" : [ "nimble:GetStreamingImage" ]
    },
    "update" : {
      "permissions" : [ "nimble:UpdateStreamingImage" ]
    },
    "delete" : {
      "permissions" : [ "nimble:DeleteStreamingImage", "nimble:UntagResource", "ec2:ModifyInstanceAttribute", "ec2:ModifySnapshotAttribute", "ec2:DeregisterImage", "ec2:DeleteSnapshot", "kms:ListGrants", "kms:RetireGrant" ]
    },
    "list" : {
      "permissions" : [ "nimble:ListStreamingImages" ]
    }
  },
  "additionalProperties" : false
}