diff --git a/changelogs/fragments/61933-ec2_transit_gateway-honor-auto_attach-setting.yaml b/changelogs/fragments/61933-ec2_transit_gateway-honor-auto_attach-setting.yaml new file mode 100644 index 00000000000..0c949e4169e --- /dev/null +++ b/changelogs/fragments/61933-ec2_transit_gateway-honor-auto_attach-setting.yaml @@ -0,0 +1,2 @@ +bugfixes: + - ec2_transit_gateway - fixed issue where auto_attach set to yes was not being honored (https://github.com/ansible/ansible/issues/61907) diff --git a/lib/ansible/modules/cloud/amazon/ec2_transit_gateway.py b/lib/ansible/modules/cloud/amazon/ec2_transit_gateway.py index 22c822d41d0..b08e7b19a41 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_transit_gateway.py +++ b/lib/ansible/modules/cloud/amazon/ec2_transit_gateway.py @@ -367,7 +367,7 @@ class AnsibleEc2Tgw(object): if self._module.params.get('asn'): options['AmazonSideAsn'] = self._module.params.get('asn') - options['AutoAcceptSharedAttachments'] = self.enable_option_flag(self._module.params.get('auto_accept')) + options['AutoAcceptSharedAttachments'] = self.enable_option_flag(self._module.params.get('auto_attach')) options['DefaultRouteTableAssociation'] = self.enable_option_flag(self._module.params.get('auto_associate')) options['DefaultRouteTablePropagation'] = self.enable_option_flag(self._module.params.get('auto_propagate')) options['VpnEcmpSupport'] = self.enable_option_flag(self._module.params.get('vpn_ecmp_support'))