You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-1
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,31 @@ When scheduling linked jobs, it is important to be mindful of the cron schedules
40
40
41
41
See Amazon's [EC2 Image Builder API Reference](https://docs.aws.amazon.com/imagebuilder/latest/APIReference/API_Schedule.html) for further details.
42
42
43
+
## Providing Launch Template configurations
44
+
If you want to update launch configurations as part of the Image Build process, you can provide them with the launch_template_configurations variable. It accepts a map of regions, where each region is a list of launch template configuration maps (one per account) for that region. It will look like this:
45
+
```hcl
46
+
launch_template_configurations = {
47
+
"us-east-1" = [
48
+
{
49
+
launch_template_id = "lt-0f1aedef76c015126"
50
+
account_id = "123456789012"
51
+
},
52
+
{
53
+
launch_template_id = "lt-0f1aedef86c049140"
54
+
account_id = "234567890123"
55
+
default = "false"
56
+
}
57
+
]
58
+
"us-west-1" = [
59
+
{
60
+
launch_template_id = "lt-0f1aedef76c015113"
61
+
account_id = "123456789012"
62
+
}
63
+
]
64
+
}
65
+
```
66
+
Note that you do not have to provide a launch template configuration for every account and region you build AMIs in. You will also need to set up IAM permissions in the destination accounts per https://docs.aws.amazon.com/imagebuilder/latest/userguide/cross-account-dist.html. (You will need to set similar permissions via `additional_iam_policy_arns` for your own image builder pipeline if it is writing to your own account)
67
+
43
68
## Providing your own Distribution Configuration
44
69
By default this module will try to handle the aws_imagebuilder_distribution_configuration configuration by itself. This works for more simple builds that only need to create EC2 images, but it may not be suitable for all users. The `custom_distribution_configs` aims to handle this by allowing users to provide a list of distribution configuration blocks, based off of the terraform described at https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/imagebuilder_distribution_configuration#distribution. Where additional configuration blocks are present, they must be replaced with a map of the same name. An example of this is:
45
70
```hcl
@@ -78,7 +103,7 @@ By default this module will try to handle the aws_imagebuilder_distribution_conf
| <aname="input_instance_metadata_http_tokens"></a> [instance\_metadata\_http\_tokens](#input\_instance\_metadata\_http\_tokens)| Whether a signed token is required for instance metadata retrieval requests. Valid values: required, optional. |`string`|`"optional"`| no |
124
149
| <aname="input_instance_types"></a> [instance\_types](#input\_instance\_types)| Instance types to create images from. It's unclear why this is a list. Possibly because different types can result in different images (like ARM instances) |`list(string)`| <pre>[<br> "t3.medium"<br>]</pre> | no |
125
150
| <aname="input_kms_key_id"></a> [kms\_key\_id](#input\_kms\_key\_id)| KMS Key ID to use when encrypting the distributed AMI, if applicable |`string`|`null`| no |
151
+
| <aname="input_launch_template_configurations"></a> [launch\_template\_configurations](#input\_launch\_template\_configurations)| A map of regions, where each region is a list of launch template configuration maps (one per account) for that region. Not used when custom\_distribution\_configs is in use. |`any`|`{}`| no |
126
152
| <aname="input_license_config_arns"></a> [license\_config\_arns](#input\_license\_config\_arns)| If you're using License Manager, your ARNs go here |`set(string)`|`null`| no |
127
153
| <aname="input_log_bucket"></a> [log\_bucket](#input\_log\_bucket)| Bucket to store logs in. If this is ommited logs will not be stored |`string`|`null`| no |
128
154
| <aname="input_log_prefix"></a> [log\_prefix](#input\_log\_prefix)| S3 prefix to store logs at. Recommended if sharing bucket with other pipelines |`string`|`null`| no |
Copy file name to clipboardExpand all lines: variables.tf
+7-1
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,6 @@ variable "container_recipe_arn" {
8
8
default=null
9
9
description="ARN of the container recipe to use. Must change with Recipe version"
10
10
type=string
11
-
12
11
}
13
12
14
13
variable"custom_distribution_configs" {
@@ -89,6 +88,12 @@ variable "kms_key_id" {
89
88
type=string
90
89
}
91
90
91
+
variable"launch_template_configurations" {
92
+
default={}
93
+
description="A map of regions, where each region is a list of launch template configuration maps (one per account) for that region. Not used when custom_distribution_configs is in use."
94
+
type=any
95
+
}
96
+
92
97
variable"license_config_arns" {
93
98
default=null
94
99
description="If you're using License Manager, your ARNs go here"
0 commit comments