Manages an Image Builder Infrastructure Configuration.
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"
security_group_ids = [aws_security_group.example.id]
sns_topic_arn = aws_sns_topic.example.arn
subnet_id = aws_subnet.main.id
terminate_instance_on_failure = true
logging {
s3_logs {
s3_bucket_name = aws_s3_bucket.example.bucket
s3_key_prefix = "logs"
}
}
tags = {
foo = "bar"
}
}
The following arguments are required:
instance_profile_name
- (Required) Name of IAM Instance Profile.name
- (Required) Name for the configuration.The following arguments are optional:
description
- (Optional) Description for the configuration.instance_metadata_options
- (Optional) Configuration block with instance metadata options for the HTTP requests that pipeline builds use to launch EC2 build and test instances. Detailed below.instance_types
- (Optional) Set of EC2 Instance Types.key_pair
- (Optional) Name of EC2 Key Pair.logging
- (Optional) Configuration block with logging settings. Detailed below.resource_tags
- (Optional) Key-value map of resource tags to assign to infrastructure created by the configuration.security_group_ids
- (Optional) Set of EC2 Security Group identifiers.sns_topic_arn
- (Optional) Amazon Resource Name (ARN) of SNS Topic.subnet_id
- (Optional) EC2 Subnet identifier. Also requires security_group_ids
argument.tags
- (Optional) Key-value map of resource tags to assign to the configuration. If configured with a provider default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.terminate_instance_on_failure
- (Optional) Enable if the instance should be terminated when the pipeline fails. Defaults to false
.The following arguments are optional:
http_put_response_hop_limit
- The number of hops that an instance can traverse to reach its destonation.http_tokens
- Whether a signed token is required for instance metadata retrieval requests. Valid values: required
, optional
.The following arguments are required:
s3_logs
- (Required) Configuration block with S3 logging settings. Detailed below.The following arguments are required:
s3_bucket_name
- (Required) Name of the S3 Bucket.The following arguments are optional:
s3_key_prefix
- (Optional) Prefix to use for S3 logs. Defaults to /
.This resource exports the following attributes in addition to the arguments above:
id
- Amazon Resource Name (ARN) of the configuration.arn
- Amazon Resource Name (ARN) of the configuration.date_created
- Date when the configuration was created.date_updated
- Date when the configuration was updated.tags_all
- A map of tags assigned to the resource, including those inherited from the provider default_tags
configuration block.In Terraform v1.5.0 and later, use an import
block to import aws_imagebuilder_infrastructure_configuration
using the Amazon Resource Name (ARN). For example:
import {
to = aws_imagebuilder_infrastructure_configuration.example
id = "arn:aws:imagebuilder:us-east-1:123456789012:infrastructure-configuration/example"
}
Using terraform import
, import aws_imagebuilder_infrastructure_configuration
using the Amazon Resource Name (ARN). For example:
% terraform import aws_imagebuilder_infrastructure_configuration.example arn:aws:imagebuilder:us-east-1:123456789012:infrastructure-configuration/example