Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joshbeard/terraform-launch-template-ami-refresh
Terraform module that deploys a Lambda function to update AWS Launch Templates AMI ID to the latest
https://github.com/joshbeard/terraform-launch-template-ami-refresh
ami autoscaling-groups aws launchtemplate python terraform terraform-modules
Last synced: 10 days ago
JSON representation
Terraform module that deploys a Lambda function to update AWS Launch Templates AMI ID to the latest
- Host: GitHub
- URL: https://github.com/joshbeard/terraform-launch-template-ami-refresh
- Owner: joshbeard
- License: 0bsd
- Created: 2021-12-03T03:43:18.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-19T01:25:27.000Z (almost 2 years ago)
- Last Synced: 2025-01-19T20:08:21.173Z (17 days ago)
- Topics: ami, autoscaling-groups, aws, launchtemplate, python, terraform, terraform-modules
- Language: HCL
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform Module for Updating an AWS EC2 Launch Template AMI
This is a Terraform module that deploys a [Lambda function](lambda.py) for updating EC2
Launch Template AMIs to the latest version.## Requirements
No requirements.
## Providers
| Name | Version |
|------|---------|
| [archive](#provider\_archive) | 2.2.0 |
| [aws](#provider\_aws) | 3.68.0 |## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [aws_cloudwatch_event_rule.this_schedule](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_rule) | resource |
| [aws_cloudwatch_event_target.this_schedule](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_target) | resource |
| [aws_cloudwatch_log_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |
| [aws_iam_policy.lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_role.lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role_policy_attachment.lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [aws_lambda_function.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function) | resource |
| [aws_lambda_permission.current_version_triggers](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) | resource |
| [aws_lambda_permission.unqualified_alias_triggers](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) | resource |
| [archive_file.this](https://registry.terraform.io/providers/hashicorp/archive/latest/docs/data-sources/file) | data source |
| [aws_iam_policy_document.assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_launch_template.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/launch_template) | data source |## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [ami\_filters](#input\_ami\_filters) | String of key/value pairs for the AMI filter. Refer to lambda.py for more info. For example: name=amzn2-ami-hvm-2.*-x86\_64-ebs;owner-alias=amazon | `string` | n/a | yes |
| [cloudwatch\_schedule\_expression](#input\_cloudwatch\_schedule\_expression) | A CloudWatch schedule expression. See https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html. | `string` | `"rate(6 hours)"` | no |
| [enable\_cloudwatch\_schedule](#input\_enable\_cloudwatch\_schedule) | Toggles managing a CloudWatch event rule and trigger based on a schedule. | `bool` | `true` | no |
| [lambda\_timeout](#input\_lambda\_timeout) | The duration allowed for the Lambda function to run in seconds. | `number` | `30` | no |
| [launch\_template\_name](#input\_launch\_template\_name) | The name of the launch template to check and update. | `string` | n/a | yes |
| [launch\_template\_version](#input\_launch\_template\_version) | The version of the launch template to check ($Default, $Latest). | `string` | `"$Default"` | no |
| [logging\_retention\_in\_days](#input\_logging\_retention\_in\_days) | The number of days to retain logs in CloudWatch. | `number` | `30` | no |
| [name](#input\_name) | The name to use for resources. | `string` | n/a | yes |
| [permissions\_boundary](#input\_permissions\_boundary) | An optional IAM permissions boundary to use when creating IAM roles. | `string` | `null` | no |
| [tags](#input\_tags) | Map of tags to apply to resources. | `map(any)` | `{}` | no |## Outputs
| Name | Description |
|------|-------------|
| [lambda\_function\_arn](#output\_lambda\_function\_arn) | n/a |
| [lambda\_function\_invoke\_arn](#output\_lambda\_function\_invoke\_arn) | n/a |
| [lambda\_function\_name](#output\_lambda\_function\_name) | n/a |
| [lambda\_function\_source\_code\_hash](#output\_lambda\_function\_source\_code\_hash) | n/a |## Contributing
This project uses [pre-commit](https://pre-commit.com/) for validation.
Open merge requests to the `master` branch.