Resource: aws_imagebuilder_image_recipe

Manages an Image Builder Image Recipe.

Example Usage

resource "aws_imagebuilder_image_recipe" "example" {
  block_device_mapping {
    device_name = "/dev/xvdb"

    ebs {
      delete_on_termination = true
      volume_size           = 100
      volume_type           = "gp2"
    }
  }

  component {
    component_arn = aws_imagebuilder_component.example.arn

    parameter {
      name  = "Parameter1"
      value = "Value1"
    }

    parameter {
      name  = "Parameter2"
      value = "Value2"
    }
  }

  name         = "example"
  parent_image = "arn:${data.aws_partition.current.partition}:imagebuilder:${data.aws_region.current.name}:aws:image/amazon-linux-2-x86/x.x.x"
  version      = "1.0.0"
}

Argument Reference

The following arguments are required:

The following attributes are optional:

block_device_mapping

The following arguments are optional:

ebs

The following arguments are optional:

component

The component block supports the following arguments:

parameter

The following arguments are required:

systems_manager_agent

The following arguments are required:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import aws_imagebuilder_image_recipe resources using the Amazon Resource Name (ARN). For example:

import {
  to = aws_imagebuilder_image_recipe.example
  id = "arn:aws:imagebuilder:us-east-1:123456789012:image-recipe/example/1.0.0"
}

Using terraform import, import aws_imagebuilder_image_recipe resources using the Amazon Resource Name (ARN). For example:

% terraform import aws_imagebuilder_image_recipe.example arn:aws:imagebuilder:us-east-1:123456789012:image-recipe/example/1.0.0