|
| 1 | +# terraform-aws-imagebuilder-pipeline [](https://github.com/rhythmictech/terraform-aws-imagebuilder-pipeline/actions) <a href="https://twitter.com/intent/follow?screen_name=RhythmicTech"><img src="https://img.shields.io/twitter/follow/RhythmicTech?style=social&logo=RhythmicTech" alt="follow on Twitter"></a> |
| 2 | +Terraform module for creating EC2 Image Builder Pipelines from Cloudformation |
| 3 | + |
| 4 | +## Example |
| 5 | +Here's what using the module will look like |
| 6 | +```hcl |
| 7 | +module "test_pipeline" { |
| 8 | + source = "rhythmictech/imagebuilder-recipe/aws" |
| 9 | + version = "~> 0.2.0" |
| 10 | +
|
| 11 | + description = "Testing pipeline" |
| 12 | + name = "test-pipeline" |
| 13 | + tags = local.tags |
| 14 | + recipe_arn = module.test_recipe.recipe_arn |
| 15 | + public = false |
| 16 | +} |
| 17 | +``` |
| 18 | + |
| 19 | +## About |
| 20 | +Allows the creation of EC2 Image Builder Pipelines with Cloudformation until native support is added to TF |
| 21 | + |
| 22 | +<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
| 23 | +## Requirements |
| 24 | + |
| 25 | +| Name | Version | |
| 26 | +|------|---------| |
| 27 | +| terraform | >= 0.12.2 | |
| 28 | +| aws | ~> 2.44 | |
| 29 | + |
| 30 | +## Providers |
| 31 | + |
| 32 | +| Name | Version | |
| 33 | +|------|---------| |
| 34 | +| aws | ~> 2.44 | |
| 35 | + |
| 36 | +## Inputs |
| 37 | + |
| 38 | +| Name | Description | Type | Default | Required | |
| 39 | +|------|-------------|------|---------|:--------:| |
| 40 | +| name | name to use for component | `string` | n/a | yes | |
| 41 | +| recipe\_arn | ARN of the recipe to use. Must change with Recipe version | `string` | n/a | yes | |
| 42 | +| additional\_iam\_policy\_arns | List of ARN policies for addional builder permissions | `list(string)` | `[]` | no | |
| 43 | +| cloudformation\_timeout | How long to wait (in minutes) for CFN to apply before giving up | `number` | `10` | no | |
| 44 | +| description | description of component | `string` | `null` | no | |
| 45 | +| enabled | Whether pipeline is ENABLED or DISABLED | `bool` | `true` | no | |
| 46 | +| 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 | |
| 47 | +| key\_pair | EC2 key pair to add to the default user on the builder | `string` | `null` | no | |
| 48 | +| license\_config\_arns | If you're using License Manager, your ARNs go here | `list(string)` | `null` | no | |
| 49 | +| log\_bucket | Bucket to store logs in. If this is ommited logs will not be stored | `string` | `null` | no | |
| 50 | +| log\_prefix | S3 prefix to store logs at. Recommended if sharing bucket with other pipelines | `string` | `null` | no | |
| 51 | +| public | Whether resulting AMI should be public | `bool` | `false` | no | |
| 52 | +| regions | Regions that AMIs will be available in | `list(string)` | <pre>[<br> "us-east-1",<br> "us-east-2",<br> "us-west-1",<br> "us-west-2",<br> "ca-central-1"<br>]</pre> | no | |
| 53 | +| schedule | Schedule expression for when pipeline should run automatically https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-imagepipeline-schedule.html | <pre>object({<br> PipelineExecutionStartCondition = string<br> ScheduleExpression = string<br> })</pre> | <pre>{<br> "PipelineExecutionStartCondition": "EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE",<br> "ScheduleExpression": "cron(0 0 * * mon)"<br>}</pre> | no | |
| 54 | +| security\_group\_ids | Security group IDs for the Image Builder | `list(string)` | `null` | no | |
| 55 | +| shared\_account\_ids | AWS accounts to share AMIs with. If this is left null AMIs will be public | `list(string)` | `[]` | no | |
| 56 | +| sns\_topic\_arn | SNS topic to notify when new images are created | `string` | `null` | no | |
| 57 | +| subnet | Subnet ID to use for builder | `string` | `null` | no | |
| 58 | +| tags | map of tags to use for CFN stack and component | `map(string)` | `{}` | no | |
| 59 | +| terminate\_on\_failure | Change to false if you want to ssh into a builder for debugging after failure | `bool` | `true` | no | |
| 60 | +| test\_config | Whether to run tests during image creation and maximum time to allow tests to run | <pre>object({<br> ImageTestsEnabled = bool<br> TimeoutMinutes = number<br> })</pre> | <pre>{<br> "ImageTestsEnabled": true,<br> "TimeoutMinutes": 60<br>}</pre> | no | |
| 61 | + |
| 62 | +## Outputs |
| 63 | + |
| 64 | +| Name | Description | |
| 65 | +|------|-------------| |
| 66 | +| pipeline\_arn | ARN of EC2 Image Builder Pipeline | |
| 67 | + |
| 68 | +<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
| 69 | + |
| 70 | +## The Giants underneath this module |
| 71 | +- pre-commit.com/ |
| 72 | +- terraform.io/ |
| 73 | +- github.com/tfutils/tfenv |
| 74 | +- github.com/segmentio/terraform-docs |
0 commit comments