{"id":22196697,"url":"https://github.com/druids/terraform-aws-asg-instance-refresh","last_synced_at":"2025-07-27T01:30:33.889Z","repository":{"id":42519070,"uuid":"295762559","full_name":"druids/terraform-aws-asg-instance-refresh","owner":"druids","description":"Terraform module providing a simple AWS Lambda function to update Launch Template for Auto Scaling Group to use the latest AMI stored in SSM Parameter.","archived":false,"fork":false,"pushed_at":"2024-08-06T14:12:39.000Z","size":62,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-07T16:05:18.745Z","etag":null,"topics":["aws","aws-autoscaling","aws-autoscaling-group","aws-autoscaling-instance-refresh","aws-lambda","devops-tools","hacktoberfest","python","terraform","terraform-aws","terraform-module"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/druids.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-15T14:58:28.000Z","updated_at":"2024-08-06T14:12:15.000Z","dependencies_parsed_at":"2024-08-06T16:10:07.043Z","dependency_job_id":null,"html_url":"https://github.com/druids/terraform-aws-asg-instance-refresh","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druids%2Fterraform-aws-asg-instance-refresh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druids%2Fterraform-aws-asg-instance-refresh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druids%2Fterraform-aws-asg-instance-refresh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druids%2Fterraform-aws-asg-instance-refresh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/druids","download_url":"https://codeload.github.com/druids/terraform-aws-asg-instance-refresh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227740673,"owners_count":17812687,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-autoscaling","aws-autoscaling-group","aws-autoscaling-instance-refresh","aws-lambda","devops-tools","hacktoberfest","python","terraform","terraform-aws","terraform-module"],"created_at":"2024-12-02T14:16:10.021Z","updated_at":"2024-12-02T14:16:10.585Z","avatar_url":"https://github.com/druids.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 0.13 |\n| \u003ca name=\"requirement_aws\"\u003e\u003c/a\u003e [aws](#requirement\\_aws) | \u003e= 3.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider\\_aws) | \u003e= 3.0 |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [aws_cloudwatch_event_rule.rule](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_rule) | resource |\n| [aws_cloudwatch_event_target.refresh_lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_target) | resource |\n| [aws_iam_role.lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |\n| [aws_iam_role_policy.lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |\n| [aws_lambda_function.refresh](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function) | resource |\n| [aws_lambda_permission.allow_cloudwatch_events](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) | resource |\n| [aws_autoscaling_group.group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/autoscaling_group) | data source |\n| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |\n| [aws_iam_policy_document.assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |\n| [aws_iam_policy_document.lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |\n| [aws_lambda_layer_version.sentry](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/lambda_layer_version) | data source |\n| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_ami_ssm_parameter\"\u003e\u003c/a\u003e [ami\\_ssm\\_parameter](#input\\_ami\\_ssm\\_parameter) | Name of SSM parameter containing the current AMI | `string` | `\"/aws/service/ecs/optimized-ami/amazon-linux-2/recommended\"` | no |\n| \u003ca name=\"input_ami_ssm_parameter_arm\"\u003e\u003c/a\u003e [ami\\_ssm\\_parameter\\_arm](#input\\_ami\\_ssm\\_parameter\\_arm) | Name of SSM parameter containing the current AMI (ARM) | `string` | `\"/aws/service/ecs/optimized-ami/amazon-linux-2/arm64/recommended\"` | no |\n| \u003ca name=\"input_auto_scaling_group_is_arm_default\"\u003e\u003c/a\u003e [auto\\_scaling\\_group\\_is\\_arm\\_default](#input\\_auto\\_scaling\\_group\\_is\\_arm\\_default) | Set to true if your ASG uses ARM instances in the default launch template | `string` | `false` | no |\n| \u003ca name=\"input_autoscaling_group_name\"\u003e\u003c/a\u003e [autoscaling\\_group\\_name](#input\\_autoscaling\\_group\\_name) | Name of the auto scaling group to refresh | `string` | n/a | yes |\n| \u003ca name=\"input_cloudwatch_event_rule_name\"\u003e\u003c/a\u003e [cloudwatch\\_event\\_rule\\_name](#input\\_cloudwatch\\_event\\_rule\\_name) | Name of the CloudWatch Event Rule | `string` | `\"ASGRefreshInstancesEventRule\"` | no |\n| \u003ca name=\"input_cloudwatch_event_rule_schedule_expression\"\u003e\u003c/a\u003e [cloudwatch\\_event\\_rule\\_schedule\\_expression](#input\\_cloudwatch\\_event\\_rule\\_schedule\\_expression) | Schedule expression for CloudWatch Event Rule | `string` | `\"cron(0 0 * * ? *)\"` | no |\n| \u003ca name=\"input_describe_instance_refreshes_max_records\"\u003e\u003c/a\u003e [describe\\_instance\\_refreshes\\_max\\_records](#input\\_describe\\_instance\\_refreshes\\_max\\_records) | Page size for boto3 when calling autoscaling:DescribeInstanceRefreshes (max is 100) | `number` | `100` | no |\n| \u003ca name=\"input_instance_refresh_instance_warmup\"\u003e\u003c/a\u003e [instance\\_refresh\\_instance\\_warmup](#input\\_instance\\_refresh\\_instance\\_warmup) | Instance warmup time for instance refresh | `number` | `300` | no |\n| \u003ca name=\"input_instance_refresh_min_healthy_percentage\"\u003e\u003c/a\u003e [instance\\_refresh\\_min\\_healthy\\_percentage](#input\\_instance\\_refresh\\_min\\_healthy\\_percentage) | Minimum healthy percentage for instance refresh | `number` | `90` | no |\n| \u003ca name=\"input_instance_refresh_skip_matching\"\u003e\u003c/a\u003e [instance\\_refresh\\_skip\\_matching](#input\\_instance\\_refresh\\_skip\\_matching) | Skip matching instances for instance refresh | `bool` | `false` | no |\n| \u003ca name=\"input_lambda_architecture\"\u003e\u003c/a\u003e [lambda\\_architecture](#input\\_lambda\\_architecture) | Set CPU architecture for the Lambda function. Valid values are \"x86\\_64\" and \"arm64\". | `string` | `\"x86_64\"` | no |\n| \u003ca name=\"input_lambda_description\"\u003e\u003c/a\u003e [lambda\\_description](#input\\_lambda\\_description) | Description of the Lambda function | `string` | `\"Keeps ASG Launch Template updated with most recent AMI read from SSM Parameter\"` | no |\n| \u003ca name=\"input_lambda_name\"\u003e\u003c/a\u003e [lambda\\_name](#input\\_lambda\\_name) | Name of the Lambda function | `string` | `\"ASGRefreshInstances\"` | no |\n| \u003ca name=\"input_lambda_role_description\"\u003e\u003c/a\u003e [lambda\\_role\\_description](#input\\_lambda\\_role\\_description) | Role description for the Lambda function | `string` | `\"\"` | no |\n| \u003ca name=\"input_lambda_role_name\"\u003e\u003c/a\u003e [lambda\\_role\\_name](#input\\_lambda\\_role\\_name) | Role name for the Lambda function | `string` | `\"ASGRefreshInstancesLambdaRole\"` | no |\n| \u003ca name=\"input_lambda_timeout\"\u003e\u003c/a\u003e [lambda\\_timeout](#input\\_lambda\\_timeout) | Timeout for Lambda function in seconds | `number` | `60` | no |\n| \u003ca name=\"input_lambda_runtime\"\u003e\u003c/a\u003e [lambda\\_runtime](#input\\_lambda\\_runtime) | Lambda Function runtime | `string` | `python3.11` | no |\n| \u003ca name=\"input_launch_template_source_version\"\u003e\u003c/a\u003e [launch\\_template\\_source\\_version](#input\\_launch\\_template\\_source\\_version) | Source version for the new launch template | `string` | `\"$Default\"` | no |\n| \u003ca name=\"input_launch_template_version_description\"\u003e\u003c/a\u003e [launch\\_template\\_version\\_description](#input\\_launch\\_template\\_version\\_description) | Description of the new launch template version in Python's f-string format | `string` | `\"Automated AMI refresh to \\\"{image_id}\\\"\"` | no |\n| \u003ca name=\"input_launch_templates_arns\"\u003e\u003c/a\u003e [launch\\_templates\\_arns](#input\\_launch\\_templates\\_arns) | List of Launch Template ARNs to allow access to | `list(string)` | \u003cpre\u003e[\u003cbr\u003e  \"*\"\u003cbr\u003e]\u003c/pre\u003e | no |\n| \u003ca name=\"input_sentry_dsn\"\u003e\u003c/a\u003e [sentry\\_dsn](#input\\_sentry\\_dsn) | n/a | `string` | `null` | no |\n| \u003ca name=\"input_sentry_environment\"\u003e\u003c/a\u003e [sentry\\_environment](#input\\_sentry\\_environment) | n/a | `string` | `null` | no |\n| \u003ca name=\"input_sentry_lambda_layer_version\"\u003e\u003c/a\u003e [sentry\\_lambda\\_layer\\_version](#input\\_sentry\\_lambda\\_layer\\_version) | n/a | `number` | `11` | no |\n| \u003ca name=\"input_update_mixed_instances_policy_overriden_launch_templates\"\u003e\u003c/a\u003e [update\\_mixed\\_instances\\_policy\\_overriden\\_launch\\_templates](#input\\_update\\_mixed\\_instances\\_policy\\_overriden\\_launch\\_templates) | If you do not want to also update launch templates that override the default launch template, set this to false | `bool` | `true` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_asg_arn\"\u003e\u003c/a\u003e [asg\\_arn](#output\\_asg\\_arn) | n/a |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdruids%2Fterraform-aws-asg-instance-refresh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdruids%2Fterraform-aws-asg-instance-refresh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdruids%2Fterraform-aws-asg-instance-refresh/lists"}