Skip to content

Latest commit

 

History

History
69 lines (53 loc) · 5.11 KB

File metadata and controls

69 lines (53 loc) · 5.11 KB

Terraform Module for Updating an AWS EC2 Launch Template AMI

This is a Terraform module that deploys a Lambda function for updating EC2 Launch Template AMIs to the latest version.

Requirements

No requirements.

Providers

Name Version
archive 2.2.0
aws 3.68.0

Modules

No modules.

Resources

Name Type
aws_cloudwatch_event_rule.this_schedule resource
aws_cloudwatch_event_target.this_schedule resource
aws_cloudwatch_log_group.this resource
aws_iam_policy.lambda resource
aws_iam_role.lambda resource
aws_iam_role_policy_attachment.lambda resource
aws_lambda_function.this resource
aws_lambda_permission.current_version_triggers resource
aws_lambda_permission.unqualified_alias_triggers resource
archive_file.this data source
aws_iam_policy_document.assume_role data source
aws_iam_policy_document.lambda data source
aws_launch_template.this data source

Inputs

Name Description Type Default Required
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 A CloudWatch schedule expression. See https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html. string "rate(6 hours)" no
enable_cloudwatch_schedule Toggles managing a CloudWatch event rule and trigger based on a schedule. bool true no
lambda_timeout The duration allowed for the Lambda function to run in seconds. number 30 no
launch_template_name The name of the launch template to check and update. string n/a yes
launch_template_version The version of the launch template to check ($Default, $Latest). string "$Default" no
logging_retention_in_days The number of days to retain logs in CloudWatch. number 30 no
name The name to use for resources. string n/a yes
permissions_boundary An optional IAM permissions boundary to use when creating IAM roles. string null no
tags Map of tags to apply to resources. map(any) {} no

Outputs

Name Description
lambda_function_arn n/a
lambda_function_invoke_arn n/a
lambda_function_name n/a
lambda_function_source_code_hash n/a

Contributing

This project uses pre-commit for validation.

Open merge requests to the master branch.