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
I am trying to delete a transit gateway using the ec2_transit_gateway module and receiving a KeyError: 'Description' when the task is executed.
I did find issue #68 that is similar to this and is closed. In this comment it was stated that the Description key should always be returned, However, if the transit gateway is old enough (I don't know what the exact date of "old enough" is) then the Description key is not returned.
As an example I have a transit gateway that was created on 2023-03-03 and there is no Description key, but a transit gateway that was created today (2023-07-21) does have a Description key. Using the AWS CLI (version 2.13.0) to get the information on the transit gateways shows this behavior:
In an AWS region create a transit gateway that does have a description (e.g. the description field is left blank in the AWS web UI) and then create a playbook with the below tasks (ensure to setup AWS authentication). If the region the transit gateway is created in is different than us-east-1 be sure to update the region in the tasks accordingly.
The full traceback is:Traceback (most recent call last): File "/home/runner/.ansible/tmp/ansible-tmp-1689979849.497067-582-232165340950257/AnsiballZ_ec2_transit_gateway.py", line 107, in <module> _ansiballz_main() File "/home/runner/.ansible/tmp/ansible-tmp-1689979849.497067-582-232165340950257/AnsiballZ_ec2_transit_gateway.py", line 99, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/home/runner/.ansible/tmp/ansible-tmp-1689979849.497067-582-232165340950257/AnsiballZ_ec2_transit_gateway.py", line 47, in invoke_module runpy.run_module(mod_name='ansible_collections.community.aws.plugins.modules.ec2_transit_gateway', init_globals=dict(_module_fqn='ansible_collections.community.aws.plugins.modules.ec2_transit_gateway', _modlib_path=modlib_path), File "/usr/lib64/python3.9/runpy.py", line 225, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "/usr/lib64/python3.9/runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/tmp/ansible_community.aws.ec2_transit_gateway_payload_gdim_pat/ansible_community.aws.ec2_transit_gateway_payload.zip/ansible_collections/community/aws/plugins/modules/ec2_transit_gateway.py", line 516, in <module> File "/tmp/ansible_community.aws.ec2_transit_gateway_payload_gdim_pat/ansible_community.aws.ec2_transit_gateway_payload.zip/ansible_collections/community/aws/plugins/modules/ec2_transit_gateway.py", line 510, in main File "/tmp/ansible_community.aws.ec2_transit_gateway_payload_gdim_pat/ansible_community.aws.ec2_transit_gateway_payload.zip/ansible_collections/community/aws/plugins/modules/ec2_transit_gateway.py", line 258, in process File "/tmp/ansible_community.aws.ec2_transit_gateway_payload_gdim_pat/ansible_community.aws.ec2_transit_gateway_payload.zip/ansible_collections/community/aws/plugins/modules/ec2_transit_gateway.py", line 454, in ensure_tgw_absent File "/tmp/ansible_community.aws.ec2_transit_gateway_payload_gdim_pat/ansible_community.aws.ec2_transit_gateway_payload.zip/ansible_collections/community/aws/plugins/modules/ec2_transit_gateway.py", line 325, in get_matching_tgwKeyError: 'Description'
Code of Conduct
I agree to follow the Ansible Code of Conduct
The text was updated successfully, but these errors were encountered:
Summary
I am trying to delete a transit gateway using the ec2_transit_gateway module and receiving a
KeyError: 'Description'
when the task is executed.I did find issue #68 that is similar to this and is closed. In this comment it was stated that the
Description
key should always be returned, However, if the transit gateway is old enough (I don't know what the exact date of "old enough" is) then theDescription
key is not returned.As an example I have a transit gateway that was created on 2023-03-03 and there is no
Description
key, but a transit gateway that was created today (2023-07-21) does have aDescription
key. Using the AWS CLI (version 2.13.0) to get the information on the transit gateways shows this behavior:Issue Type
Bug Report
Component Name
ec2_transit_gateway
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
Red Hat Enterprise Linux release 8.8 (Ootpa)
Steps to Reproduce
In an AWS region create a transit gateway that does have a description (e.g. the description field is left blank in the AWS web UI) and then create a playbook with the below tasks (ensure to setup AWS authentication). If the region the transit gateway is created in is different than
us-east-1
be sure to update the region in the tasks accordingly.Expected Results
The transit gateway is deleted
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: