Skip to content
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

AWS ec2_transit_gateway "auto_attach: yes" does not work #61907

Closed
dvntstph opened this issue Sep 5, 2019 · 6 comments
Closed

AWS ec2_transit_gateway "auto_attach: yes" does not work #61907

dvntstph opened this issue Sep 5, 2019 · 6 comments
Labels
affects_2.8 This issue/PR affects Ansible v2.8 aws bug This issue/PR relates to a bug. cloud module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community.

Comments

@dvntstph
Copy link

dvntstph commented Sep 5, 2019

SUMMARY

Currently when using Ansible to create a transit gateway in AWS the auto_attach parameter is ignored.
When the gateway comes into existence the "AutoAcceptSharedAttachments" is set to disabled.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ec2_transit_gateway

ANSIBLE VERSION
ansible 2.8.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/dvnt/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/dvnt/.local/lib/python2.7/site-packages/ansible
  executable location = /home/dvnt/.local/bin/ansible
  python version = 2.7.16 (default, Apr  6 2019, 01:42:57) [GCC 8.3.0]

CONFIGURATION
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
OS / ENVIRONMENT
STEPS TO REPRODUCE
---
- name: Workflow to ultimately manage Transit Gateway in the XXX AWS Account
  hosts: localhost
  
  tasks:

  - name: Create variable for desired region
    set_fact: 
      defined_region: us-east-1

  - name: Assume role and obtain STS token
    sts_assume_role:
     region: "{{ defined_region }}"
     role_arn: arn:aws:iam::123456789123:role/My-AWS-Automation-Role-Name
     role_session_name: "AWS-Automation-session"
    register: assumed_role

  - name: Manage Transit Gateway for XXX AWS Account
    ec2_transit_gateway:
     aws_access_key: "{{ assumed_role.sts_creds.access_key }}"
     aws_secret_key: "{{ assumed_role.sts_creds.secret_key }}"
     security_token: "{{ assumed_role.sts_creds.session_token }}"
     description: "My Awesome TGW"
     state: present
     #asn: 
     auto_associate: no
     auto_attach: yes 
     auto_propagate: no
     dns_support: yes
     vpn_ecmp_support: yes
     region: "{{ defined_region }}"
     tags:
      Name: my-awesome-tgw
      module: ec2_transit_gateway
      my-tag: heck-yeah
EXPECTED RESULTS

When querying the created gateway settings using 'aws ec2 describe-transit-gateways' the created gateway should have "AutoAcceptSharedAttachments": "enable"

ACTUAL RESULTS

Gateway gets created with "AutoAcceptSharedAttachments": "disabled"

dvnt@icecream:~$ aws ec2 describe-transit-gateways
{
    "TransitGateways": [
        {
            "TransitGatewayId": "##REDACTED##",
            "TransitGatewayArn": "arn:aws:iam::123456789123:role/My-AWS-Automation-Role-Name",
            "State": "available",
            "OwnerId": "##REDACTED##",
            "Description": "My Awesome TGW",
            "CreationTime": "2019-09-05T21:19:12.000Z",
            "Options": {
                "AmazonSideAsn": 64512,
                "AutoAcceptSharedAttachments": "disable",
                "DefaultRouteTableAssociation": "disable",
                "DefaultRouteTablePropagation": "disable",
                "VpnEcmpSupport": "enable",
                "DnsSupport": "enable"
            },
            "Tags": [
                {
                    "Key": "Name",
                    "Value": "my-awesome-tgw"
                }
            ]
        }
    ]
}

@ansibot
Copy link
Contributor

ansibot commented Sep 5, 2019

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Sep 5, 2019

@ansibot
Copy link
Contributor

ansibot commented Sep 5, 2019

@dvntstph, just so you are aware we have a dedicated Working Group for aws.
You can find other people interested in this in #ansible-aws on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 aws bug This issue/PR relates to a bug. cloud module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. labels Sep 5, 2019
@BobBoldin
Copy link
Contributor

I can see the issue and will work on a pr to address it.

@BobBoldin
Copy link
Contributor

PR submitted
#61993

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Sep 9, 2019
@gundalow
Copy link
Contributor

resolved_by_pr: 61993

@ansibot ansibot closed this as completed Oct 21, 2019
@ansible ansible locked and limited conversation to collaborators Nov 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 aws bug This issue/PR relates to a bug. cloud module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

No branches or pull requests

4 participants