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
-
arnoptional computed - string -
date_createdoptional computed - string -
date_updatedoptional computed - string -
descriptionoptional - string -
idoptional computed - string -
instance_profile_namerequired - string -
instance_typesoptional - set of string -
key_pairoptional - string -
namerequired - string -
resource_tagsoptional - map from string to string -
security_group_idsoptional - set of string -
sns_topic_arnoptional - string -
subnet_idoptional - string -
tagsoptional - map from string to string -
terminate_instance_on_failureoptional - bool -
logginglist block-
s3_logslist block-
s3_bucket_namerequired - string -
s3_key_prefixoptional - 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
-
Namerequired - String -
Descriptionoptional - String -
InstanceTypesoptional - List -
SecurityGroupIdsoptional - List -
Loggingoptional - Logging -
SubnetIdoptional - String -
KeyPairoptional - String -
TerminateInstanceOnFailureoptional - Boolean -
InstanceProfileNamerequired - String -
InstanceMetadataOptionsoptional - InstanceMetadataOptions -
SnsTopicArnoptional - String -
ResourceTagsoptional - Map -
Tagsoptional - 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.