AWS Image Builder Infrastructure Configuration
This page shows how to write Terraform and CloudFormation for Image Builder Infrastructure Configuration and write them securely.
aws_imagebuilder_infrastructure_configuration (Terraform)
The Infrastructure Configuration in Image Builder can be configured in Terraform with the resource name aws_imagebuilder_infrastructure_configuration
. The following sections describe 4 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_imagebuilder_infrastructure_configuration" "example" {
description = "example description"
instance_profile_name = aws_iam_instance_profile.example.name
instance_types = ["t2.nano", "t3.micro"]
key_pair = aws_key_pair.example.key_name
name = "example"
resource "aws_imagebuilder_infrastructure_configuration" "this" {
description = "Simple infrastructure configuration"
instance_profile_name = var.ec2_iam_role_name
instance_types = ["t2.micro"]
key_pair = var.aws_key_pair_name
name = "amazon-linux-infr"
resource "aws_imagebuilder_infrastructure_configuration" "instance" {
description = "PyApp-infra"
instance_profile_name = aws_iam_instance_profile.test_profile.name
instance_types = [
"t2.micro"]
key_pair = data.terraform_remote_state.admin.outputs.key
resource "aws_imagebuilder_infrastructure_configuration" "examplea" {
description = "examplea description"
instance_profile_name = aws_iam_instance_profile.examplea.name
instance_types = ["t2.nano", "t3.micro"]
// key_pair = aws_key_pair.example.key_name
name = "examplea"
Parameters
-
arn
optional computed - string -
date_created
optional computed - string -
date_updated
optional computed - string -
description
optional - string -
id
optional computed - string -
instance_profile_name
required - string -
instance_types
optional - set of string -
key_pair
optional - string -
name
required - string -
resource_tags
optional - map from string to string -
security_group_ids
optional - set of string -
sns_topic_arn
optional - string -
subnet_id
optional - string -
tags
optional - map from string to string -
terminate_instance_on_failure
optional - bool -
logging
list block-
s3_logs
list block-
s3_bucket_name
required - string -
s3_key_prefix
optional - string
-
-
Explanation in Terraform Registry
Manages an Image Builder Infrastructure Configuration.
AWS::ImageBuilder::InfrastructureConfiguration (CloudFormation)
The InfrastructureConfiguration in ImageBuilder can be configured in CloudFormation with the resource name AWS::ImageBuilder::InfrastructureConfiguration
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
Name
required - String -
Description
optional - String -
InstanceTypes
optional - List -
SecurityGroupIds
optional - List -
Logging
optional - Logging -
SubnetId
optional - String -
KeyPair
optional - String -
TerminateInstanceOnFailure
optional - Boolean -
InstanceProfileName
required - String -
InstanceMetadataOptions
optional - InstanceMetadataOptions -
SnsTopicArn
optional - String -
ResourceTags
optional - Map -
Tags
optional - Map
Explanation in CloudFormation Registry
The infrastructure configuration allows you to specify the infrastructure within which to build and test your image. In the infrastructure configuration, you can specify instance types, subnets, and security groups to associate with your instance. You can also associate an Amazon EC2 key pair with the instance used to build your image. This allows you to log on to your instance to troubleshoot if your build fails and you set terminateInstanceOnFailure to false.
Frequently asked questions
What is AWS Image Builder Infrastructure Configuration?
AWS Image Builder Infrastructure Configuration is a resource for Image Builder of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Image Builder Infrastructure Configuration?
For Terraform, the johngraham660/terraform-aws-ec2imagebuilder, masterwali/ec2-image-builder and KonovalovAlexey/terraform-modules source code examples are useful. See the Terraform Example section for further details.