Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.