Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Create an EC2 Image Builder Recipe with Cloudformation

License

NotificationsYou must be signed in to change notification settings

rhythmictech/terraform-aws-imagebuilder-recipe

Repository files navigation

Creates EC2 Image Builder recipes

Example

Here's what using the module will look like

module"test_recipe" {source="rhythmictech/imagebuilder-recipe/aws"version="~> 0.2.0"description="Testing recipe"name="test-recipe"parent_image="arn:aws:imagebuilder:us-east-1:aws:image/amazon-linux-2-x86/x.x.x"recipe_version="1.0.0"tags=local.tagsupdate=truecomponent_arns=[module.test_component.component_arn,"arn:aws:imagebuilder:us-east-1:aws:component/simple-boot-test-linux/1.0.0/1","arn:aws:imagebuilder:us-east-1:aws:component/reboot-test-linux/1.0.0/1"  ]}

About

Creates EC2 Image Builder recipes

Component Parameters (experimental)

In our experience we haven't needed to provide parameters to the components we include in an Image Builder recipe, so the easiest use case has been to simply include a list of ARNs (component_arns variable). If you need to provide parameters, you can use the separate component_parameters map, e.g.

component_arns=[module.test_component.component_arn,"arn:aws:imagebuilder:us-east-1:aws:component/simple-boot-test-linux/1.0.0/1","arn:aws:imagebuilder:us-east-1:aws:component/reboot-test-linux/1.0.0/1"  ]component_parameters=[    {       module.test_component.component_arn= [        {"param1" ="value1"},        {"param2" ="value2"}      ],    },    {"arn:aws:imagebuilder:us-east-1:aws:component/simple-boot-test-linux/1.0.0/1"= [        {"param1" ="value1"}      ],    }  ]

Requirements

NameVersion
terraform>= 0.12.2
aws>= 2.44

Providers

NameVersion
aws4.49.0

Modules

No modules.

Resources

NameType
aws_imagebuilder_image_recipe.thisresource
aws_region.currentdata source

Inputs

NameDescriptionTypeDefaultRequired
block_device_mappingsList of Maps of EBS volumes to mount See examples for further usage tips.list(any)nullno
cloudformation_timeoutHow long to wait (in minutes) for CFN to apply before giving upnumber10no
component_arnsList of component ARNs to use in recipe. Order matterslist(string)n/ayes
component_parametersA map of component arns (as specified in component_arns) that contains a list of maps of parameters (each parameter contains a name and a value) to apply to the componentmap(list(map(string))){}no
descriptiondescription of componentstringnullno
namename to use for componentstringn/ayes
parent_imageImage that the recipe should start with. SemVers is ok (and encouraged)stringn/ayes
platformPlatform of Recipe (Linux orWindows)string"Linux"no
recipe_versionVersion of the recipestringn/ayes
systems_manager_agent_uninstall_after_buildBoolean value for whether or not the systems manager agent should be uninstall from the image after it is builtboolfalseno
tagsMap of tags to use for CFN stack and componentmap(string){}no
updateWhether recipe should include theupdate-$platform recipe before running other componentsbooltrueno
user_data_base64Base64 Encoded user-data to provide when spinning up the build instance.stringnullno
working_directoryWorking directory to use in the build instance. ImageBuilder uses /tmp by default on Linux, which can be an issue when working with CIS-hardened images.stringnullno

Outputs

NameDescription
latest_image_arnARN of the wildcard representing the latest EC2 Image Builder Image
recipe_arnARN of the EC2 Image Builder Recipe

The Giants underneath this module

  • pre-commit.com/
  • terraform.io/
  • github.com/tfutils/tfenv
  • github.com/segmentio/terraform-docs

[8]ページ先頭

©2009-2025 Movatter.jp