Support for Tags (tagging) for ECS Service and Task Creation - #2466
Support for Tags (tagging) for ECS Service and Task Creation#2466elliotechne wants to merge 6 commits into
Conversation
…d ecs_taskdefinition modules - ecs_cluster: tags on create/update via tag_resource/untag_resource; describe_cluster includes TAGS - ecs_service: adds purge_tags, removes fail_json blocking tag updates, reconciles tags independently of update_service - ecs_taskdefinition: tags on registration; in-place tag reconciliation for existing revisions via list_tags_for_resource Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nition tagging Covers tags on create, idempotency, tag updates, purge_tags, and in-place tag reconciliation for task definitions without registering a new revision. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…uard - ecs_tag/main.yml: update service tag test to expect success now that tag updates on existing services are supported (removes the old fail assertion) - 99_terminate_everything.yml: guard ecs_task_definition_absent_with_arn teardown with `when: ... is defined` to survive partial test failures Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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/community.aws/community.aws/docsbuild/base/collections/community/aws/ecs_cluster_module.html b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/ecs_cluster_module.html
index 3fa61fb..8f80ba1 100644
--- a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/community/aws/ecs_cluster_module.html
+++ b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/ecs_cluster_module.html
@@ -310,6 +310,20 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-c
</div></td>
</tr>
<tr class="row-even"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-purge_tags"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-cluster-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 12.0.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>If <em>purge_tags=true</em> and <em>tags</em> is set, existing tags not in <em>tags</em> will be removed from the cluster.</p>
+<p>If <em>tags</em> is not set, tags will not be modified, even if <em>purge_tags=true</em>.</p>
+<p class="ansible-option-line"><strong class="ansible-option-choices">Choices:</strong></p>
+<ul class="simple">
+<li><p><code class="ansible-option-choices-entry docutils literal notranslate"><span class="pre">false</span></code></p></li>
+<li><p><code class="ansible-option-default-bold docutils literal notranslate"><strong><span class="pre">true</span></strong></code> <span class="ansible-option-choices-default-mark">← (default)</span></p></li>
+</ul>
+</div></td>
+</tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-region"></div>
<div class="ansibleOptionAnchor" id="parameter-aws_region"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-cluster-module-parameter-region"><span id="ansible-collections-community-aws-ecs-cluster-module-parameter-aws-region"></span><strong>region</strong></p>
<a class="ansibleOptionLink" href="#parameter-region" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-aliases">aliases: aws_region</span></p>
@@ -321,7 +335,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-c
<p>See the Amazon AWS documentation for more information <a class="reference external" href="http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region">http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region</a>.</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-repeat"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-cluster-module-parameter-repeat"><strong>repeat</strong></p>
<a class="ansibleOptionLink" href="#parameter-repeat" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">integer</span></p>
</div></td>
@@ -329,7 +343,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-c
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">10</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-secret_key"></div>
<div class="ansibleOptionAnchor" id="parameter-aws_secret_access_key"></div>
<div class="ansibleOptionAnchor" id="parameter-aws_secret_key"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-cluster-module-parameter-secret-key"><span id="ansible-collections-community-aws-ecs-cluster-module-parameter-aws-secret-key"></span><span id="ansible-collections-community-aws-ecs-cluster-module-parameter-aws-secret-access-key"></span><strong>secret_key</strong></p>
@@ -343,7 +357,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-c
<p>The <em>aws_secret_access_key</em> alias was added in release 5.1.0 for consistency with the AWS botocore SDK.</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-session_token"></div>
<div class="ansibleOptionAnchor" id="parameter-aws_session_token"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-cluster-module-parameter-session-token"><span id="ansible-collections-community-aws-ecs-cluster-module-parameter-aws-session-token"></span><strong>session_token</strong></p>
<a class="ansibleOptionLink" href="#parameter-session_token" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-aliases">aliases: aws_session_token</span></p>
@@ -355,7 +369,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-c
<p>The <em>session_token</em> and <em>profile</em> options are mutually exclusive.</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-state"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-cluster-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> / <span class="ansible-option-required">required</span></p>
</div></td>
@@ -368,6 +382,15 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-c
</ul>
</div></td>
</tr>
+<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-community-aws-ecs-cluster-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">dictionary</span></p>
+<p><em class="ansible-option-versionadded">added in community.aws 12.0.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>A dictionary of tags to apply to the ECS cluster.</p>
+<p>If <em>tags</em> is not set, tags will not be modified.</p>
+</div></td>
+</tr>
<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-community-aws-ecs-cluster-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>
@@ -420,6 +443,14 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-c
<span class="w"> </span><span class="nt">weight</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">100</span>
<span class="w"> </span><span class="nt">purge_capacity_providers</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Cluster creation with tags</span>
+<span class="w"> </span><span class="nt">community.aws.ecs_cluster</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">my-cluster</span>
+<span class="w"> </span><span class="nt">state</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">present</span>
+<span class="w"> </span><span class="nt">tags</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">Environment</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">production</span>
+<span class="w"> </span><span class="nt">Team</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">backend</span>
+
<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Cluster deletion</span>
<span class="w"> </span><span class="nt">community.aws.ecs_cluster</span><span class="p">:</span>
<span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">default</span>
@@ -522,6 +553,15 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-c
<p class="ansible-option-line ansible-option-sample"><strong class="ansible-option-sample-bold">Sample:</strong> <code class="ansible-option-sample docutils literal notranslate"><span class="pre">"ACTIVE"</span></code></p>
</div></td>
</tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="return-tags"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-cluster-module-return-tags"><strong>tags</strong></p>
+<a class="ansibleOptionLink" href="#return-tags" title="Permalink to this return value"></a><p class="ansible-option-type-line"><span class="ansible-option-type">dictionary</span></p>
+<p><em class="ansible-option-versionadded">added in community.aws 12.0.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>The tags associated with the cluster.</p>
+<p class="ansible-option-line"><strong class="ansible-option-returned-bold">Returned:</strong> always</p>
+</div></td>
+</tr>
</tbody>
</table>
<section id="authors">
diff --git a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/community/aws/ecs_service_module.html b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/ecs_service_module.html
index efc9434..a223bb0 100644
--- a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/community/aws/ecs_service_module.html
+++ b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/ecs_service_module.html
@@ -588,6 +588,21 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-s
</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-community-aws-ecs-service-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 12.0.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>If <em>purge_tags=true</em> and <em>tags</em> is set, existing tags not in <em>tags</em> will be removed from the service.</p>
+<p>If <em>tags</em> is not set, tags will not be modified, even if <em>purge_tags=true</em>.</p>
+<p>This option only takes effect when updating an existing service; tags are fully controlled at creation time.</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-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-region"></div>
<div class="ansibleOptionAnchor" id="parameter-aws_region"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-service-module-parameter-region"><span id="ansible-collections-community-aws-ecs-service-module-parameter-aws-region"></span><strong>region</strong></p>
<a class="ansibleOptionLink" href="#parameter-region" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-aliases">aliases: aws_region</span></p>
@@ -599,7 +614,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-s
<p>See the Amazon AWS documentation for more information <a class="reference external" href="http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region">http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region</a>.</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-repeat"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-service-module-parameter-repeat"><strong>repeat</strong></p>
<a class="ansibleOptionLink" href="#parameter-repeat" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">integer</span></p>
</div></td>
@@ -607,7 +622,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-s
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">10</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-role"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-service-module-parameter-role"><strong>role</strong></p>
<a class="ansibleOptionLink" href="#parameter-role" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -616,7 +631,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-s
<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-scheduling_strategy"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-service-module-parameter-scheduling-strategy"><strong>scheduling_strategy</strong></p>
<a class="ansibleOptionLink" href="#parameter-scheduling_strategy" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -629,7 +644,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-s
</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-secret_key"></div>
<div class="ansibleOptionAnchor" id="parameter-aws_secret_access_key"></div>
<div class="ansibleOptionAnchor" id="parameter-aws_secret_key"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-service-module-parameter-secret-key"><span id="ansible-collections-community-aws-ecs-service-module-parameter-aws-secret-key"></span><span id="ansible-collections-community-aws-ecs-service-module-parameter-aws-secret-access-key"></span><strong>secret_key</strong></p>
@@ -643,7 +658,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-s
<p>The <em>aws_secret_access_key</em> alias was added in release 5.1.0 for consistency with the AWS botocore SDK.</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-service_registries"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-service-module-parameter-service-registries"><strong>service_registries</strong></p>
<a class="ansibleOptionLink" href="#parameter-service_registries" 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>
@@ -651,28 +666,28 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-s
<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-indent"></div><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-service_registries/arn"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-service-module-parameter-service-registries-arn"><strong>arn</strong></p>
<a class="ansibleOptionLink" href="#parameter-service_registries/arn" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
<td><div class="ansible-option-indent-desc"></div><div class="ansible-option-cell"><p>Service discovery registry ARN.</p>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-service_registries/container_name"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-service-module-parameter-service-registries-container-name"><strong>container_name</strong></p>
<a class="ansibleOptionLink" href="#parameter-service_registries/container_name" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
<td><div class="ansible-option-indent-desc"></div><div class="ansible-option-cell"><p>Container name for service discovery registration.</p>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-service_registries/container_port"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-service-module-parameter-service-registries-container-port"><strong>container_port</strong></p>
<a class="ansibleOptionLink" href="#parameter-service_registries/container_port" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">integer</span></p>
</div></td>
<td><div class="ansible-option-indent-desc"></div><div class="ansible-option-cell"><p>Container port for service discovery registration.</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><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-service-module-parameter-session-token"><span id="ansible-collections-community-aws-ecs-service-module-parameter-aws-session-token"></span><strong>session_token</strong></p>
<a class="ansibleOptionLink" href="#parameter-session_token" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-aliases">aliases: aws_session_token</span></p>
@@ -684,7 +699,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-s
<p>The <em>session_token</em> and <em>profile</em> options are mutually exclusive.</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-community-aws-ecs-service-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> / <span class="ansible-option-required">required</span></p>
</div></td>
@@ -697,7 +712,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-s
</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-tags"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-service-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">dictionary</span></p>
<p><em class="ansible-option-versionadded">added in community.aws 4.1.0</em></p>
@@ -705,7 +720,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-s
<td><div class="ansible-option-cell"><p>A dictionary of tags to add or remove from the resource.</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-task_definition"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-service-module-parameter-task-definition"><strong>task_definition</strong></p>
<a class="ansibleOptionLink" href="#parameter-task_definition" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -714,7 +729,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-s
<p>This parameter is ignored when updating a service with a <code class="docutils literal notranslate"><span class="pre">CODE_DEPLOY</span></code> deployment controller in which case the task definition is managed by Code Pipeline and cannot be updated.</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-community-aws-ecs-service-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>
@@ -727,7 +742,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-s
</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"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-service-module-parameter-wait"><strong>wait</strong></p>
<a class="ansibleOptionLink" href="#parameter-wait" 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 4.1.0</em></p>
diff --git a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/community/aws/ecs_taskdefinition_module.html b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/ecs_taskdefinition_module.html
index d1920eb..3fe84ae 100644
--- a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/community/aws/ecs_taskdefinition_module.html
+++ b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/ecs_taskdefinition_module.html
@@ -1241,6 +1241,21 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-t
</div></td>
</tr>
<tr class="row-even"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-purge_tags"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-taskdefinition-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 12.0.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>If <em>purge_tags=true</em> and <em>tags</em> is set, existing tags not in <em>tags</em> will be removed from the task definition.</p>
+<p>Has no effect when registering a new task definition revision (tags at registration fully replace any prior state).</p>
+<p>If <em>tags</em> is not set, tags will not be modified, even if <em>purge_tags=true</em>.</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-region"></div>
<div class="ansibleOptionAnchor" id="parameter-aws_region"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-taskdefinition-module-parameter-region"><span id="ansible-collections-community-aws-ecs-taskdefinition-module-parameter-aws-region"></span><strong>region</strong></p>
<a class="ansibleOptionLink" href="#parameter-region" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-aliases">aliases: aws_region</span></p>
@@ -1252,14 +1267,14 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-t
<p>See the Amazon AWS documentation for more information <a class="reference external" href="http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region">http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region</a>.</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-revision"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-taskdefinition-module-parameter-revision"><strong>revision</strong></p>
<a class="ansibleOptionLink" href="#parameter-revision" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">integer</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>A revision number for the task definition.</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-runtime_platform"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-taskdefinition-module-parameter-runtime-platform"><strong>runtime_platform</strong></p>
<a class="ansibleOptionLink" href="#parameter-runtime_platform" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">dictionary</span></p>
<p><em class="ansible-option-versionadded">added in community.aws 6.4.0</em></p>
@@ -1268,7 +1283,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-t
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">{"cpuArchitecture":</span> <span class="pre">"X86_64",</span> <span class="pre">"operatingSystemFamily":</span> <span class="pre">"LINUX"}</span></code></p>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-runtime_platform/cpuArchitecture"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-taskdefinition-module-parameter-runtime-platform-cpuarchitecture"><strong>cpuArchitecture</strong></p>
<a class="ansibleOptionLink" href="#parameter-runtime_platform/cpuArchitecture" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -1280,7 +1295,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-t
</ul>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-runtime_platform/operatingSystemFamily"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-taskdefinition-module-parameter-runtime-platform-operatingsystemfamily"><strong>operatingSystemFamily</strong></p>
<a class="ansibleOptionLink" href="#parameter-runtime_platform/operatingSystemFamily" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -1295,7 +1310,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-t
</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-secret_key"></div>
<div class="ansibleOptionAnchor" id="parameter-aws_secret_access_key"></div>
<div class="ansibleOptionAnchor" id="parameter-aws_secret_key"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-taskdefinition-module-parameter-secret-key"><span id="ansible-collections-community-aws-ecs-taskdefinition-module-parameter-aws-secret-key"></span><span id="ansible-collections-community-aws-ecs-taskdefinition-module-parameter-aws-secret-access-key"></span><strong>secret_key</strong></p>
@@ -1309,7 +1324,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-t
<p>The <em>aws_secret_access_key</em> alias was added in release 5.1.0 for consistency with the AWS botocore SDK.</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><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-taskdefinition-module-parameter-session-token"><span id="ansible-collections-community-aws-ecs-taskdefinition-module-parameter-aws-session-token"></span><strong>session_token</strong></p>
<a class="ansibleOptionLink" href="#parameter-session_token" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-aliases">aliases: aws_session_token</span></p>
@@ -1321,7 +1336,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-t
<p>The <em>session_token</em> and <em>profile</em> options are mutually exclusive.</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-community-aws-ecs-taskdefinition-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> / <span class="ansible-option-required">required</span></p>
</div></td>
@@ -1333,6 +1348,17 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-t
</ul>
</div></td>
</tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-tags"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-taskdefinition-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">dictionary</span></p>
+<p><em class="ansible-option-versionadded">added in community.aws 12.0.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>A dictionary of tags to apply to the task definition.</p>
+<p>When registering a new task definition, tags are applied at registration time.</p>
+<p>When an existing task definition is found (no new revision needed), tags are updated in place without creating a new revision.</p>
+<p>If <em>tags</em> is not set, tags will not be modified.</p>
+</div></td>
+</tr>
<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-task_role_arn"></div><p class="ansible-option-title" id="ansible-collections-community-aws-ecs-taskdefinition-module-parameter-task-role-arn"><strong>task_role_arn</strong></p>
<a class="ansibleOptionLink" href="#parameter-task_role_arn" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
@@ -1517,6 +1543,23 @@ see <a class="reference internal" href="#ansible-collections-community-aws-ecs-t
<span class="w"> </span><span class="nt">startPeriod</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">15</span>
<span class="w"> </span><span class="nt">timeout</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">15</span>
<span class="w"> </span><span class="nt">state</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">present</span>
+
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Create task definition with tags</span>
+<span class="w"> </span><span class="nt">community.aws.ecs_taskdefinition</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">family</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">nginx</span>
+<span class="w"> </span><span class="nt">containers</span><span class="p">:</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">nginx</span>
+<span class="w"> </span><span class="nt">essential</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
+<span class="w"> </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="s">"nginx"</span>
+<span class="w"> </span><span class="nt">portMappings</span><span class="p">:</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">containerPort</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">8080</span>
+<span class="w"> </span><span class="nt">hostPort</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">8080</span>
+<span class="w"> </span><span class="nt">cpu</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">512</span>
+<span class="w"> </span><span class="nt">memory</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">1024</span>
+<span class="w"> </span><span class="nt">state</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">present</span>
+<span class="w"> </span><span class="nt">tags</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">Environment</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">production</span>
+<span class="w"> </span><span class="nt">Team</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">backend</span>
</pre></div>
</div>
</section>
|
|
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 3m 20s (non-voting) |
tremble
left a comment
There was a problem hiding this comment.
Thanks for taking the time to submit this PR.
A couple of comments.
- purge_tags should default to True
- The tag management logic should probably be split into dedicated functions.
…n tags support Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
After calling tag_resource/untag_resource the results["cluster"] dict still pointed at the pre-change describe response, so tag-value assertions in the integration tests always saw the old (stale) tags. Re-describe the cluster inside the tag-change block so the returned dict reflects the applied state. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the nested tag-reconciliation if statements with a standalone ensure_tags() function. Change purge_tags default from false to true, consistent with purge_capacity_providers behaviour. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 4m 18s (non-voting) |
|
@tremble Updated. Thank you for the review! |
|
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 3m 41s (non-voting) |
SUMMARY
fixes: #2446
ISSUE TYPE
COMPONENT NAME
ecs_tags
ADDITIONAL INFORMATION
Assisted-by: Sonnet 4.6 · Claude Pro