You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 11, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: examples/asg-lifecycle-hooks/README.md
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Example to test basic ASG integration with lifecycle hooks
2
2
3
+
This example uses [lifecycled](https://github.com/buildkite/lifecycled) to process
4
+
lifecycle events. As of version 3.0.2 `lifecycled` supports only instance termination
5
+
events and reacts to a termination event for a node it is running on.
6
+
3
7
## Environment creation and deployment
4
8
5
9
To use this example set up AWS credentials and then run the commands in the
@@ -35,10 +39,16 @@ running. You can check the status of the service using
35
39
systemctl status lifecycled.service
36
40
```
37
41
42
+
Output from a handler could be seen in the service log e.g. by using
43
+
44
+
```
45
+
journalctl -f -u lifecycled.service
46
+
```
47
+
38
48
39
49
## Test the Notification
40
50
41
-
To generate a notification for a launch event, update the Auto Scaling group by increasing the desired capacity of the Auto Scaling group by 1. You receive a notification within a few minutes after instance launch.
51
+
To generate a notification for a termination event, update the Auto Scaling group by decreasing the desired capacity of the Auto Scaling group by 1. You receive a notification within a few minutes after instance termination.
42
52
43
53
To change the desired capacity using the console
44
54
@@ -54,8 +64,7 @@ To change the desired capacity using the console
54
64
55
65
Choose Save.
56
66
57
-
After a few minutes, you'll see that the lifecycle-handler.sh script will be executed and it's side effect operation will be performed.
58
-
67
+
After a few minutes, you'll see that the lifecycle-handler.sh script will be executed and it's side effect operation will be performed: in the log of lifecycled.service you'll see a line with something like "hello from the handler, received autoscaling:EC2_INSTANCE_TERMINATING i-01234567890123456"
59
68
60
69
## Destruction
61
70
@@ -67,5 +76,5 @@ make clean
67
76
```
68
77
69
78
## Notes
70
-
- This example was last tested with `Terraform v0.11.11`
79
+
- This example was last tested with `Terraform v0.12.4`
71
80
- This example assumes AWS credentials setup with access to the **us-east-2** region.
0 commit comments