-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add instance scale-in protection to Auto Scaling #2207
base: main
Are you sure you want to change the base?
Conversation
Docs Build 📝Thank you for contribution!✨ The docsite for this PR is available for download as an artifact from this run: You can compare to the docs for the File changes:
Click to see the diff comparison.NOTE: only file modifications are shown here. New and deleted files are excluded. diff --git a/home/runner/work/amazon.aws/amazon.aws/docsbuild/base/collections/amazon/aws/autoscaling_group_module.html b/home/runner/work/amazon.aws/amazon.aws/docsbuild/head/collections/amazon/aws/autoscaling_group_module.html
index d6fbe0a..cef7dbf 100644
--- a/home/runner/work/amazon.aws/amazon.aws/docsbuild/base/collections/amazon/aws/autoscaling_group_module.html
+++ b/home/runner/work/amazon.aws/amazon.aws/docsbuild/head/collections/amazon/aws/autoscaling_group_module.html
@@ -557,6 +557,19 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-autoscal
</div></td>
</tr>
<tr class="row-even"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-protected_from_scale_in"></div><p class="ansible-option-title" id="ansible-collections-amazon-aws-autoscaling-group-module-parameter-protected-from-scale-in"><strong>protected_from_scale_in</strong></p>
+<a class="ansibleOptionLink" href="#parameter-protected_from_scale_in" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
+<p><em class="ansible-option-versionadded">added in amazon.aws 8.2.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>If <code class="ansible-value docutils literal notranslate"><span class="pre">true</span></code>, instances will have scale-in protection enabled.</p>
+<p class="ansible-option-line"><strong class="ansible-option-choices">Choices:</strong></p>
+<ul class="simple">
+<li><p><code class="ansible-option-default-bold docutils literal notranslate"><strong><span class="pre">false</span></strong></code> <span class="ansible-option-choices-default-mark">← (default)</span></p></li>
+<li><p><code class="ansible-option-choices-entry docutils literal notranslate"><span class="pre">true</span></code></p></li>
+</ul>
+</div></td>
+</tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-purge_tags"></div><p class="ansible-option-title" id="ansible-collections-amazon-aws-autoscaling-group-module-parameter-purge-tags"><strong>purge_tags</strong></p>
<a class="ansibleOptionLink" href="#parameter-purge_tags" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
<p><em class="ansible-option-versionadded">added in community.aws 3.2.0</em></p>
@@ -570,7 +583,7 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-autoscal
</ul>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-region"></div>
<div class="ansibleOptionAnchor" id="parameter-aws_region"></div>
<div class="ansibleOptionAnchor" id="parameter-ec2_region"></div><p class="ansible-option-title" id="ansible-collections-amazon-aws-autoscaling-group-module-parameter-region"><span id="ansible-collections-amazon-aws-autoscaling-group-module-parameter-ec2-region"></span><span id="ansible-collections-amazon-aws-autoscaling-group-module-parameter-aws-region"></span><strong>region</strong></p>
@@ -585,7 +598,7 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-autoscal
<p>Support for the <code class="docutils literal notranslate"><span class="pre">EC2_REGION</span></code> environment variable has been deprecated and will be removed in a release after 2024-12-01.</p>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-replace_all_instances"></div><p class="ansible-option-title" id="ansible-collections-amazon-aws-autoscaling-group-module-parameter-replace-all-instances"><strong>replace_all_instances</strong></p>
<a class="ansibleOptionLink" href="#parameter-replace_all_instances" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
</div></td>
@@ -597,7 +610,7 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-autoscal
</ul>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-replace_batch_size"></div><p class="ansible-option-title" id="ansible-collections-amazon-aws-autoscaling-group-module-parameter-replace-batch-size"><strong>replace_batch_size</strong></p>
<a class="ansibleOptionLink" href="#parameter-replace_batch_size" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">integer</span></p>
</div></td>
@@ -605,7 +618,7 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-autoscal
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">1</span></code></p>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-replace_instances"></div><p class="ansible-option-title" id="ansible-collections-amazon-aws-autoscaling-group-module-parameter-replace-instances"><strong>replace_instances</strong></p>
<a class="ansibleOptionLink" href="#parameter-replace_instances" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">list</span> / <span class="ansible-option-elements">elements=string</span></p>
</div></td>
@@ -613,7 +626,7 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-autoscal
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">[]</span></code></p>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-secret_key"></div>
<div class="ansibleOptionAnchor" id="parameter-aws_secret_access_key"></div>
<div class="ansibleOptionAnchor" id="parameter-aws_secret_key"></div>
@@ -630,7 +643,7 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-autoscal
<p>Support for the <code class="docutils literal notranslate"><span class="pre">EC2_SECRET_KEY</span></code> environment variable has been deprecated and will be removed in a release after 2024-12-01.</p>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-session_token"></div>
<div class="ansibleOptionAnchor" id="parameter-aws_session_token"></div>
<div class="ansibleOptionAnchor" id="parameter-security_token"></div>
@@ -648,7 +661,7 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-autoscal
<p>Support for the <code class="docutils literal notranslate"><span class="pre">EC2_SECRET_KEY</span></code> and <code class="docutils literal notranslate"><span class="pre">AWS_SECURITY_TOKEN</span></code> environment variables has been deprecated and will be removed in a release after 2024-12-01.</p>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-state"></div><p class="ansible-option-title" id="ansible-collections-amazon-aws-autoscaling-group-module-parameter-state"><strong>state</strong></p>
<a class="ansibleOptionLink" href="#parameter-state" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -660,7 +673,7 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-autoscal
</ul>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-suspend_processes"></div><p class="ansible-option-title" id="ansible-collections-amazon-aws-autoscaling-group-module-parameter-suspend-processes"><strong>suspend_processes</strong></p>
<a class="ansibleOptionLink" href="#parameter-suspend_processes" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">list</span> / <span class="ansible-option-elements">elements=string</span></p>
</div></td>
@@ -672,7 +685,7 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-autoscal
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">[]</span></code></p>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-tags"></div><p class="ansible-option-title" id="ansible-collections-amazon-aws-autoscaling-group-module-parameter-tags"><strong>tags</strong></p>
<a class="ansibleOptionLink" href="#parameter-tags" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">list</span> / <span class="ansible-option-elements">elements=dictionary</span></p>
</div></td>
@@ -682,14 +695,14 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-autoscal
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">[]</span></code></p>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-target_group_arns"></div><p class="ansible-option-title" id="ansible-collections-amazon-aws-autoscaling-group-module-parameter-target-group-arns"><strong>target_group_arns</strong></p>
<a class="ansibleOptionLink" href="#parameter-target_group_arns" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">list</span> / <span class="ansible-option-elements">elements=string</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>List of target group ARNs to use for the group. Use for application load balancers.</p>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-termination_policies"></div><p class="ansible-option-title" id="ansible-collections-amazon-aws-autoscaling-group-module-parameter-termination-policies"><strong>termination_policies</strong></p>
<a class="ansibleOptionLink" href="#parameter-termination_policies" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">list</span> / <span class="ansible-option-elements">elements=string</span></p>
</div></td>
@@ -701,7 +714,7 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-autoscal
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">["Default"]</span></code></p>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-validate_certs"></div><p class="ansible-option-title" id="ansible-collections-amazon-aws-autoscaling-group-module-parameter-validate-certs"><strong>validate_certs</strong></p>
<a class="ansibleOptionLink" href="#parameter-validate_certs" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
</div></td>
@@ -714,14 +727,14 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-autoscal
</ul>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-vpc_zone_identifier"></div><p class="ansible-option-title" id="ansible-collections-amazon-aws-autoscaling-group-module-parameter-vpc-zone-identifier"><strong>vpc_zone_identifier</strong></p>
<a class="ansibleOptionLink" href="#parameter-vpc_zone_identifier" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">list</span> / <span class="ansible-option-elements">elements=string</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>List of VPC subnets to use</p>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-wait_for_instances"></div><p class="ansible-option-title" id="ansible-collections-amazon-aws-autoscaling-group-module-parameter-wait-for-instances"><strong>wait_for_instances</strong></p>
<a class="ansibleOptionLink" href="#parameter-wait_for_instances" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
</div></td>
@@ -733,7 +746,7 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-autoscal
</ul>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-wait_timeout"></div><p class="ansible-option-title" id="ansible-collections-amazon-aws-autoscaling-group-module-parameter-wait-timeout"><strong>wait_timeout</strong></p>
<a class="ansibleOptionLink" href="#parameter-wait_timeout" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">integer</span></p>
</div></td>
|
Build failed. ✔️ ansible-galaxy-importer SUCCESS in 4m 49s |
Build failed. ✔️ ansible-galaxy-importer SUCCESS in 4m 20s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@braydencw1 Thank you for taking time to work on this. Can you please add a changelog fragment https://docs.ansible.com/ansible/latest/community/development_process.html#creating-a-changelog-fragment for this change and cover it with some integration tests?
changelogs/fragments/2207_scale_in_protection_auto_scaling_group.yml
Outdated
Show resolved
Hide resolved
Co-authored-by: Mark Chappell <[email protected]>
Build failed. ✔️ ansible-galaxy-importer SUCCESS in 7m 10s |
Build failed. ✔️ ansible-galaxy-importer SUCCESS in 5m 13s |
Anything else I need to do ??? Does the testing tend to fail out in some parts? Timing out on an integration test ? |
Build failed. ✔️ ansible-galaxy-importer SUCCESS in 5m 07s |
Build failed. ✔️ ansible-galaxy-importer SUCCESS in 3m 54s |
Signed-off-by: Alina Buzachis <[email protected]>
Build failed. ✔️ ansible-galaxy-importer SUCCESS in 5m 22s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just had a bit of a poke about in the code.
The integration test is failing because the update_size()
code isn't actually being triggered, and as such nothing's actually being changed.
I think the handling of NewInstancesProtectedFromScaleIn
needs to move into the (poorly named) create_autoscaling_group()
function.
@alinabuzachis The more I look at this module, the more I fear we need to start splitting it up to be able to actually maintain it...
Build failed. ✔️ ansible-galaxy-importer SUCCESS in 4m 08s |
Build failed. ✔️ ansible-galaxy-importer SUCCESS in 4m 25s |
Build failed. ✔️ ansible-galaxy-importer SUCCESS in 4m 54s |
While this PR manages (or should manage) the default state of scale-in protection for newly created instances, with 9.0.0 we've added a new module #2296 shouldn't be considered as "replacing" this PR, it is however related to this PR and may be of interest to anyone who comes across it. |
SUMMARY
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION