{
  "typeName" : "AWS::ImageBuilder::ImageRecipe",
  "description" : "Resource schema for AWS::ImageBuilder::ImageRecipe",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-imagebuilder.git",
  "properties" : {
    "Arn" : {
      "description" : "The Amazon Resource Name (ARN) of the image recipe.",
      "type" : "string"
    },
    "Name" : {
      "description" : "The name of the image recipe.",
      "type" : "string"
    },
    "Description" : {
      "description" : "The description of the image recipe.",
      "type" : "string"
    },
    "Version" : {
      "description" : "The version of the image recipe.",
      "type" : "string"
    },
    "Components" : {
      "description" : "The components of the image recipe.",
      "type" : "array",
      "insertionOrder" : true,
      "items" : {
        "$ref" : "#/definitions/ComponentConfiguration"
      }
    },
    "BlockDeviceMappings" : {
      "description" : "The block device mappings to apply when creating images from this recipe.",
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/InstanceBlockDeviceMapping"
      }
    },
    "ParentImage" : {
      "description" : "The parent image of the image recipe.",
      "type" : "string"
    },
    "WorkingDirectory" : {
      "description" : "The working directory to be used during build and test workflows.",
      "type" : "string"
    },
    "AdditionalInstanceConfiguration" : {
      "description" : "Specify additional settings and launch scripts for your build instances.",
      "$ref" : "#/definitions/AdditionalInstanceConfiguration"
    },
    "AmiTags" : {
      "description" : "The tags to apply to the AMI created by this image recipe.",
      "type" : "object",
      "additionalProperties" : false,
      "patternProperties" : {
        ".{1,}" : {
          "type" : "string"
        }
      }
    },
    "Tags" : {
      "description" : "The tags of the image recipe.",
      "type" : "object",
      "additionalProperties" : false,
      "patternProperties" : {
        ".{1,}" : {
          "type" : "string"
        }
      }
    },
    "LatestVersion" : {
      "description" : "The latest version references of the image recipe.",
      "$ref" : "#/definitions/LatestVersion"
    }
  },
  "definitions" : {
    "ComponentConfiguration" : {
      "description" : "Configuration details of the component.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ComponentArn" : {
          "description" : "The Amazon Resource Name (ARN) of the component.",
          "type" : "string"
        },
        "Parameters" : {
          "description" : "A group of parameter settings that are used to configure the component for a specific recipe.",
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/ComponentParameter"
          }
        }
      }
    },
    "InstanceBlockDeviceMapping" : {
      "description" : "Defines block device mappings for the instance used to configure your image. ",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "DeviceName" : {
          "description" : "The device to which these mappings apply.",
          "type" : "string"
        },
        "VirtualName" : {
          "description" : "Use to manage instance ephemeral devices.",
          "type" : "string"
        },
        "NoDevice" : {
          "description" : "Use to remove a mapping from the parent image.",
          "type" : "string"
        },
        "Ebs" : {
          "description" : "Use to manage Amazon EBS-specific configuration for this mapping.",
          "$ref" : "#/definitions/EbsInstanceBlockDeviceSpecification"
        }
      }
    },
    "EbsInstanceBlockDeviceSpecification" : {
      "description" : "Amazon EBS-specific block device mapping specifications. ",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Encrypted" : {
          "description" : "Use to configure device encryption.",
          "type" : "boolean"
        },
        "DeleteOnTermination" : {
          "description" : "Use to configure delete on termination of the associated device.",
          "type" : "boolean"
        },
        "Iops" : {
          "description" : "Use to configure device IOPS.",
          "type" : "integer"
        },
        "KmsKeyId" : {
          "description" : "Use to configure the KMS key to use when encrypting the device.",
          "type" : "string"
        },
        "SnapshotId" : {
          "description" : "The snapshot that defines the device contents.",
          "type" : "string"
        },
        "Throughput" : {
          "description" : "For GP3 volumes only - The throughput in MiB/s that the volume supports.",
          "type" : "integer"
        },
        "VolumeSize" : {
          "description" : "Use to override the device's volume size.",
          "type" : "integer"
        },
        "VolumeType" : {
          "description" : "Use to override the device's volume type.",
          "type" : "string",
          "enum" : [ "standard", "io1", "io2", "gp2", "gp3", "sc1", "st1" ]
        }
      }
    },
    "AdditionalInstanceConfiguration" : {
      "additionalProperties" : false,
      "description" : "Specify additional settings and launch scripts for your build instances.",
      "type" : "object",
      "properties" : {
        "SystemsManagerAgent" : {
          "description" : "Contains settings for the SSM agent on your build instance.",
          "$ref" : "#/definitions/SystemsManagerAgent"
        },
        "UserDataOverride" : {
          "description" : "Use this property to provide commands or a command script to run when you launch your build instance.",
          "type" : "string"
        }
      }
    },
    "SystemsManagerAgent" : {
      "additionalProperties" : false,
      "description" : "Contains settings for the SSM agent on your build instance.",
      "type" : "object",
      "properties" : {
        "UninstallAfterBuild" : {
          "description" : "Controls whether the SSM agent is removed from your final build image, prior to creating the new AMI. If this is set to true, then the agent is removed from the final image. If it's set to false, then the agent is left in, so that it is included in the new AMI. The default value is false.",
          "type" : "boolean"
        }
      }
    },
    "ComponentParameter" : {
      "additionalProperties" : false,
      "description" : "Contains a key/value pair that sets the named component parameter.",
      "type" : "object",
      "properties" : {
        "Name" : {
          "description" : "The name of the component parameter to set.",
          "type" : "string"
        },
        "Value" : {
          "description" : "Sets the value for the named component parameter.",
          "type" : "array",
          "insertionOrder" : true,
          "items" : {
            "type" : "string"
          }
        }
      },
      "required" : [ "Name", "Value" ]
    },
    "LatestVersion" : {
      "description" : "The latest version references of the image recipe.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Arn" : {
          "description" : "The latest version ARN of the created image recipe.",
          "type" : "string"
        },
        "Major" : {
          "description" : "The latest version ARN of the created image recipe, with the same major version.",
          "type" : "string"
        },
        "Minor" : {
          "description" : "The latest version ARN of the created image recipe, with the same minor version.",
          "type" : "string"
        },
        "Patch" : {
          "description" : "The latest version ARN of the created image recipe, with the same patch version.",
          "type" : "string"
        }
      }
    }
  },
  "additionalProperties" : false,
  "required" : [ "Name", "Version", "ParentImage" ],
  "primaryIdentifier" : [ "/properties/Arn" ],
  "readOnlyProperties" : [ "/properties/Arn", "/properties/LatestVersion", "/properties/LatestVersion/Arn", "/properties/LatestVersion/Major", "/properties/LatestVersion/Minor", "/properties/LatestVersion/Patch" ],
  "createOnlyProperties" : [ "/properties/Name", "/properties/Version", "/properties/Components", "/properties/ParentImage", "/properties/Description", "/properties/BlockDeviceMappings", "/properties/WorkingDirectory" ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "imagebuilder:TagResource", "imagebuilder:UntagResource" ]
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "iam:GetRole", "iam:CreateServiceLinkedRole", "imagebuilder:GetComponent", "imagebuilder:GetImage", "imagebuilder:TagResource", "imagebuilder:GetImageRecipe", "imagebuilder:CreateImageRecipe", "ec2:DescribeImages" ]
    },
    "read" : {
      "permissions" : [ "imagebuilder:GetImageRecipe" ]
    },
    "update" : {
      "permissions" : [ "imagebuilder:TagResource", "imagebuilder:UntagResource" ]
    },
    "delete" : {
      "permissions" : [ "imagebuilder:UntagResource", "imagebuilder:GetImageRecipe", "imagebuilder:DeleteImageRecipe" ]
    },
    "list" : {
      "permissions" : [ "imagebuilder:ListImageRecipes" ]
    }
  }
}