Skip to content

Commit 0a45bb7

Browse files
authored
Merge pull request #53 from meltwater/hikerspath-patch-1
Documentation Updates v1
2 parents 5377773 + 2a3c8ca commit 0a45bb7

File tree

2 files changed

+108
-34
lines changed

2 files changed

+108
-34
lines changed

CHANGELOG.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## DEPRECATED
8+
9+
## [v1.1.2](https://github.com/meltwater/terraform-aws-asg-dns-handler/compare/v1.0.5...v1.1.1) - 2022-03-11
10+
11+
### Added
12+
13+
- Changelog for v1 spec
14+
15+
### Changed
16+
17+
- Readme
18+
19+
## [v1.1.1](https://github.com/meltwater/terraform-aws-asg-dns-handler/compare/v1.0.5...v1.1.1) - 2022-03-11
20+
21+
### Changed
22+
23+
- Readme
24+
25+
## [v1.0.5](https://github.com/meltwater/terraform-aws-asg-dns-handler/compare/v1.0.4...v1.0.5) - 2021-07-01
26+
27+
### Changed
28+
29+
- Upgrade Lambda function to use Python 3.8 runtime
30+
31+
## [v1.0.5](https://github.com/meltwater/terraform-aws-asg-dns-handler/compare/v1.0.4...v1.0.5) - 2021-07-01
32+
33+
### Changed
34+
35+
- Upgrade Lambda function to use Python 3.8 runtime
36+
37+
## [v1.0.4](https://github.com/meltwater/terraform-aws-asg-dns-handler/compare/v1.0.3...v1.0.4) - 2019-11-14
38+
39+
### Added
40+
41+
- Added unique id's to allow multiple uses within the same account ([#17](https://github.com/meltwater/terraform-aws-asg-dns-handler/pull/17) [@seanturner83](https://github.com/seanturner83))
42+
43+
### Changed
44+
45+
- Updated testing scenarios for latest aws provider ([#20](https://github.com/meltwater/terraform-aws-asg-dns-handler/pull/20) [@hikerspath](https://github.com/hikerspath))
46+
47+
## [v1.0.3](https://github.com/meltwater/terraform-aws-asg-dns-handler/compare/v1.0.2...v1.0.3) - 2019-02-11
48+
49+
### Fixed
50+
51+
- Fix for Lifecycle_hooks
52+
53+
## [v1.0.2](https://github.com/meltwater/terraform-aws-asg-dns-handler/compare/v1.0.1...v1.0.2) - 2019-01-21
54+
55+
### Changed
56+
57+
- Outputs.tf and variables.tf updated.
58+
59+
## [v1.0.1](https://github.com/meltwater/terraform-aws-asg-dns-handler/compare/v1.0.2...v1.0.1) - 2019-01-21
60+
61+
### Added
62+
63+
- Initial public release.

README.md

Lines changed: 45 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1-
[![Build Status](https://cloud.drone.io/api/badges/meltwater/terraform-aws-asg-dns-handler/status.svg)](https://cloud.drone.io/meltwater/terraform-aws-asg-dns-handler)
1+
# ASG DNS Handler | [![Build Status](https://cloud.drone.io/api/badges/meltwater/terraform-aws-asg-dns-handler/status.svg?ref=refs/heads/terraform-0.11)](https://cloud.drone.io/meltwater/terraform-aws-asg-dns-handler)
22

3-
# ASG DNS handler
3+
> **DEPRECATED**:
4+
> While minimally supported for hotfixes, this branch supporting Terraform v0.11 has been deprecated. Please update to v2.0.0 of this module or greater to be able to make use of all the modules latest features.
45
5-
## Deprecated
6-
This branch supporting Terraform v0.11 has been deprecated. Please update to v2.0.0 of this module or greater.
6+
This Terraform module sets up everything necessary for dynamically setting hostnames following a certain pattern on instances spawned by AWS Auto Scaling Groups (ASGs).
77

8-
## Purpose
9-
This module sets up everything necessary for dynamically setting hostnames following a certain pattern on instances spawned by Auto Scaling Groups
8+
Learn more about our motivation to build this module in our blog post [Dynamic Route53 records for AWS Auto Scaling Groups with Terraform](https://underthehood.meltwater.com/blog/2020/02/07/dynamic-route53-records-for-aws-auto-scaling-groups-with-terraform/).
9+
10+
## Maintainers
11+
12+
This repository and the module it houses are maintained Foundation Missions A-Team. Should you encounter issues or require changes to code maintained in this repository, please reachout through an issue that is part of this project.
13+
14+
## Requirements
15+
16+
- [Terraform](https://www.terraform.io/downloads.html) 0.12+ and [Terraform AWS provider](https://github.com/terraform-providers/terraform-provider-aws) 2.0+ use v2+ releases
17+
- [Terraform](https://www.terraform.io/downloads.html) 0.11 and below, [Terraform AWS provider](https://github.com/terraform-providers/terraform-provider-aws) 2.0.14 and below use v1.x releases
18+
19+
## How do I use it?
1020

11-
## Usage
1221
Create an ASG and set the `asg:hostname_pattern` tag for example like this:
1322

1423
```
@@ -28,7 +37,8 @@ tag {
2837
Once you have your ASG set up, you can just invoke this module and point it to it:
2938
```hcl
3039
module "clever_name_autoscale_dns" {
31-
source = "../../"
40+
source = meltwater/asg-dns-handler/aws"
41+
version = "1.1.2"
3242
3343
autoscale_update_name = "clever_name"
3444
autoscale_group_names = "${aws_autoscaling_group.my_asg.name}"
@@ -66,12 +76,12 @@ resource "aws_autoscaling_group" "my_asg" {
6676
"${var.aws_subnets}"
6777
]
6878
69-
min_size = "${var.asg_min_count}"
70-
max_size = "${var.asg_max_count}"
71-
desired_capacity = "${var.asg_desired_count}"
72-
health_check_type = "EC2"
79+
min_size = "${var.asg_min_count}"
80+
max_size = "${var.asg_max_count}"
81+
desired_capacity = "${var.asg_desired_count}"
82+
health_check_type = "EC2"
7383
health_check_grace_period = 300
74-
force_delete = false
84+
force_delete = false
7585
7686
launch_configuration = "${aws_launch_configuration.my_launch_config.name}"
7787
@@ -80,44 +90,45 @@ resource "aws_autoscaling_group" "my_asg" {
8090
}
8191
8292
initial_lifecycle_hook {
83-
name = "lifecycle-launching"
84-
default_result = "ABANDON"
85-
heartbeat_timeout = 60
86-
lifecycle_transition = "autoscaling:EC2_INSTANCE_LAUNCHING"
93+
name = "lifecycle-launching"
94+
default_result = "ABANDON"
95+
heartbeat_timeout = 60
96+
lifecycle_transition = "autoscaling:EC2_INSTANCE_LAUNCHING"
8797
notification_target_arn = "${module.autoscale_dns.autoscale_handling_sns_topic_arn}"
88-
role_arn = "${module.autoscale_dns.agent_lifecycle_iam_role_arn}"
98+
role_arn = "${module.autoscale_dns.agent_lifecycle_iam_role_arn}"
8999
}
90100
91101
initial_lifecycle_hook {
92-
name = "lifecycle-terminating"
93-
default_result = "ABANDON"
94-
heartbeat_timeout = 60
95-
lifecycle_transition = "autoscaling:EC2_INSTANCE_TERMINATING"
102+
name = "lifecycle-terminating"
103+
default_result = "ABANDON"
104+
heartbeat_timeout = 60
105+
lifecycle_transition = "autoscaling:EC2_INSTANCE_TERMINATING"
96106
notification_target_arn = "${module.autoscale_dns.autoscale_handling_sns_topic_arn}"
97-
role_arn = "${module.autoscale_dns.agent_lifecycle_iam_role_arn}"
107+
role_arn = "${module.autoscale_dns.agent_lifecycle_iam_role_arn}"
98108
}
99109
100110
tag {
101-
key = "asg:hostname_pattern"
102-
value = "${var.hostname_prefix}-#instanceid.${var.vpc_name}.testing@${var.internal_zone_id}"
111+
key = "asg:hostname_pattern"
112+
value = "${var.hostname_prefix}-#instanceid.${var.vpc_name}.testing@${var.internal_zone_id}"
103113
propagate_at_launch = true
104114
}
105115
}
106116
107117
module "autoscale_dns" {
108-
source = "meltwater/asg-dns-handler/aws"
109-
110-
version = "1.1.1"
111-
112-
autoscale_update_name = "my_asg_handler"
118+
source = meltwater/asg-dns-handler/aws"
119+
version = "1.1.2"
113120
121+
autoscale_update_name = "my_asg_handler"
114122
autoscale_route53zone_arn = "${var.internal_zone_id}"
115-
116-
vpc_name = "${var.vpc_name}"
123+
vpc_name = "${var.vpc_name}"
117124
}
118125
119126
```
120127

128+
## Developers Guide / Contributing
129+
130+
Please read through the [CONTRIBUTING.md](https://github.com/meltwater/terraform-aws-asg-dns-handler/blob/master/CHANGELOG.md) to understand how to submit pull requests to us and be sure to visit our [Code of Conduct](https://github.com/meltwater/terraform-aws-asg-dns-handler/blob/master/CODE_OF_CONDUCT.md).
131+
121132
## Difference between Lifecycle action
122133
Lifecycle_hook can have `CONTINUE` or `ABANDON` as default_result. By setting default_result to `ABANDON` will terminate the instance if the lambda function fails to update the DNS record as required. `Complete_lifecycle_action` in lambda function returns `LifecycleActionResult` as `CONTINUE` on success to Lifecycle_hook. But if lambda function fails, Lifecycle_hook doesn't get any response from `Complete_lifecycle_action` which results in timeout and terminates the instance.
123134

@@ -126,6 +137,6 @@ If the instance is launching, CONTINUE indicates that your actions were successf
126137

127138
If the instance is terminating, both ABANDON and CONTINUE allow the instance to terminate. However, ABANDON stops any remaining actions, such as other lifecycle hooks, while CONTINUE allows any other lifecycle hooks to complete.
128139

129-
## TODO
140+
## License and Copyright
130141

131-
- Reverse lookup records?
142+
This project was built at Meltwater. It is licensed under the [Apache License 2.0](LICENSE).

0 commit comments

Comments
 (0)