Resource: aws_imagebuilder_container_recipe

Manages an Image Builder Container Recipe.

Example Usage

resource "aws_imagebuilder_container_recipe" "example" {
  name    = "example"
  version = "1.0.0"

  container_type = "DOCKER"
  parent_image   = "arn:aws:imagebuilder:eu-central-1:aws:image/amazon-linux-x86-latest/x.x.x"

  target_repository {
    repository_name = aws_ecr_repository.example.name
    service         = "ECR"
  }

  component {
    component_arn = aws_imagebuilder_component.example.arn

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

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

  dockerfile_template_data = <<EOF
FROM {{{ imagebuilder:parentImage }}}
{{{ imagebuilder:environments }}}
{{{ imagebuilder:components }}}
EOF
}

Argument Reference

The following arguments are required:

The following attributes are optional:

component

The component block supports the following arguments:

parameter

The following arguments are required:

target_repository

The following arguments are required:

instance_configuration

The following arguments are optional:

block_device_mapping

The following arguments are optional:

ebs

The following arguments are optional:

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_container_recipe resources using the Amazon Resource Name (ARN). For example:

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

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

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