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

ec2_vpc_igw creates a detached igw and fails if the vpc_id supplied does not exist #1787

Closed
1 task done
branic opened this issue Oct 3, 2023 · 2 comments
Closed
1 task done
Labels
bug This issue/PR relates to a bug jira

Comments

@branic
Copy link
Contributor

branic commented Oct 3, 2023

Summary

When trying to create an internet gateway and supplying an incorrect vpc_id an internet gateway is created, but the module fails when trying to attach to the VPC.

Issue Type

Bug Report

Component Name

ec2_vpc_igw

Ansible Version

$ ansible --version
ansible [core 2.15.4]
  config file = None
  configured module search path = ['/home/bevans/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/bevans/.local/lib/python3.11/site-packages/ansible
  ansible collection location = /home/bevans/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/bevans/.local/bin/ansible
  python version = 3.11.5 (main, Aug 28 2023, 00:00:00) [GCC 13.2.1 20230728 (Red Hat 13.2.1-1)] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True

Collection Versions

$ ansible-galaxy collection list

# /usr/share/ansible/collections/ansible_collections
Collection    Version
------------- -------
amazon.aws    6.4.0  
community.aws 6.3.0  

AWS SDK versions

$ pip show boto boto3 botocore
WARNING: Package(s) not found: boto
Name: boto3
Version: 1.28.59
Summary: The AWS SDK for Python
Home-page: https://github.com/boto/boto3
Author: Amazon Web Services
Author-email: 
License: Apache License 2.0
Location: /usr/local/lib/python3.9/site-packages
Requires: botocore, jmespath, s3transfer
Required-by: 
---
Name: botocore
Version: 1.31.59
Summary: Low-level, data-driven core of boto 3.
Home-page: https://github.com/boto/botocore
Author: Amazon Web Services
Author-email: 
License: Apache License 2.0
Location: /usr/local/lib/python3.9/site-packages
Requires: jmespath, python-dateutil, urllib3
Required-by: boto3, s3transfer

Configuration

$ ansible-config dump --only-changed
CONFIG_FILE() = /etc/ansible/ansible.cfg

OS / Environment

Red Hat Enterprise Linux release 8.8 (Ootpa)

Steps to Reproduce

    - name: Create IGW
      amazon.aws.ec2_vpc_igw:
        vpc_id: vpc-abcdefgh
        state: present
      register: igw_result

Expected Results

Expected module to fail with an error that the VPC could not be found to attach the internet gateway to and not leave a detached gateway created.

Actual Results

The module failed, but a detached internet gateway was left in the AWS account.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@branic
Copy link
Contributor Author

branic commented Oct 3, 2023

I plan on working on a PR to fix this behavior.

@gravesm gravesm added bug This issue/PR relates to a bug jira and removed needs_triage labels Oct 10, 2023
branic added a commit to branic/amazon.aws that referenced this issue Oct 16, 2023
Also adds the ability to attach/detach/change VPC of internet gateway

Fixes: ansible-collections#1787
branic added a commit to branic/amazon.aws that referenced this issue Oct 16, 2023
Also adds the ability to attach/detach/change VPC of internet gateway

Fixes: ansible-collections#1787
branic added a commit to branic/amazon.aws that referenced this issue Oct 26, 2023
Also adds the ability to attach/detach/change VPC of internet gateway

Fixes: ansible-collections#1787
branic added a commit to branic/amazon.aws that referenced this issue Oct 30, 2023
Also adds the ability to attach/detach/change VPC of internet gateway

Fixes: ansible-collections#1787
tremble pushed a commit to branic/amazon.aws that referenced this issue Oct 31, 2023
Also adds the ability to attach/detach/change VPC of internet gateway

Fixes: ansible-collections#1787
@branic
Copy link
Contributor Author

branic commented Oct 31, 2023

Closing issue as this was fixed with #1786

@branic branic closed this as completed Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug jira
Projects
None yet
Development

No branches or pull requests

2 participants