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_net_info module : Cannot retrieve info from a VPC shared from another AWS account #663

Closed
1 task done
Mogooo opened this issue Feb 9, 2022 · 2 comments · Fixed by #984
Closed
1 task done
Assignees
Labels
bug This issue/PR relates to a bug has_pr jira module module needs_verified Some one might want to take a look at this and reproduce it to confirm plugins plugin (any type) python3 traceback

Comments

@Mogooo
Copy link

Mogooo commented Feb 9, 2022

Summary

When I try to describe all of my VPCs in one AWS account where one of my VPC is a VPC shared from another account, I get the following error :

"msg": "Unable to describe if ClassicLink is enabled: An error occurred (InvalidVpcID.NotFound) when calling the DescribeVpcClassicLink operation: The vpc ID 'vpc-XXXXXXXX' does not exist"

Issue Type

Bug Report

Component Name

ec2_vpc_net_info

Ansible Version

$ ansible --version
ansible 2.9.0
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.6.9 (default, Dec  8 2021, 21:08:43) [GCC 8.4.0]

Collection Versions

$ ansible-galaxy collection list

AWS SDK versions

$ pip show boto boto3 botocore
Name: boto
Version: 2.49.0
Summary: Amazon Web Services Library
Home-page: https://github.com/boto/boto/
Author: Mitch Garnaat
Author-email: [email protected]
License: MIT
Location: /usr/local/lib/python3.6/dist-packages
Requires:
Required-by:
---
Name: boto3
Version: 1.20.51
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.6/dist-packages
Requires: botocore, jmespath, s3transfer
Required-by:
---
Name: botocore
Version: 1.23.51
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.6/dist-packages
Requires: jmespath, python-dateutil, urllib3
Required-by: awscli, boto3, s3transfer

Configuration

$ ansible-config dump --only-changed

OS / Environment

Ubuntu 18.04

Steps to Reproduce

---
- name: Describe VPCs
  hosts: localhost
  tasks:
    - ec2_vpc_net_info:

Expected Results

I expected the module to get info from the VPC because i can still describe it with describe_vpcs

Actual Results

[WARNING]: No inventory was parsed, only implicit localhost is available

[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'


PLAY [Describe VPCs] *******************************************************************************************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] *****************************************************************************************************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [ec2_vpc_net_info] ****************************************************************************************************************************************************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: botocore.exceptions.ClientError: An error occurred (InvalidVpcID.NotFound) when calling the DescribeVpcClassicLink operation: The vpc ID 'vpc-XXXXXXXX' does not exist
fatal: [localhost]: FAILED! => {"changed": false, "error": {"code": "InvalidVpcID.NotFound", "message": "The vpc ID 'vpc-XXXXXXXX' does not exist"}, "msg": "Unable to describe if ClassicLink is enabled: An error occurred (InvalidVpcID.NotFound) when calling the DescribeVpcClassicLink operation: The vpc ID 'vpc-XXXXXXXX' does not exist", "response_metadata": {"http_headers": {"cache-control": "no-cache, no-store", "connection": "close", "content-type": "text/xml;charset=UTF-8", "date": "Wed, 09 Feb 2022 16:49:19 GMT", "server": "AmazonEC2", "strict-transport-security": "max-age=31536000; includeSubDomains", "transfer-encoding": "chunked", "vary": "accept-encoding", "x-amzn-requestid": "XXXXXXXX"}, "http_status_code": 400, "request_id": "XXXXXXXX", "retry_attempts": 0}}

PLAY RECAP *****************************************************************************************************************************************************************************************************************************************************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link

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

@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module needs_triage plugins plugin (any type) python3 traceback labels Feb 9, 2022
@jillr jillr added needs_verified Some one might want to take a look at this and reproduce it to confirm and removed needs_triage labels Feb 22, 2022
@GomathiselviS GomathiselviS self-assigned this Aug 29, 2022
softwarefactory-project-zuul bot pushed a commit that referenced this issue Sep 7, 2022
Handle absence of classic link support for shared VPCs

Signed-off-by: GomathiselviS [email protected]
SUMMARY


Fixes #663
One of the Classic Link Limitations is that
You cannot link an EC2-Classic instance to a VPC that's in a different Region or a different AWS account..
When calling the DescribeVpcClassicLink operation on a shared VPC, it errors out saying "The vpc ID 'vpc-xxxx' does not exist".
This PR handles this error.
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Mark Chappell <None>
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Oct 24, 2023
Formally start the rds deprecation process

SUMMARY
The rds module is based upon the deprecated boto (not boto3/botocore) SDK and its functionality has been replaced by the rds_instance, rds_snapshot and rds_instance_info modules.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
rds
ADDITIONAL INFORMATION
See also ansible-collections#632

Reviewed-by: Felix Fontein <None>
Reviewed-by: Markus Bergholz <[email protected]>
Reviewed-by: Jill R <None>
Reviewed-by: None <None>
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 has_pr jira module module needs_verified Some one might want to take a look at this and reproduce it to confirm plugins plugin (any type) python3 traceback
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants