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

Handle absence of classic link support for shared VPCs #984

Conversation

GomathiselviS
Copy link
Collaborator

@GomathiselviS GomathiselviS commented Aug 29, 2022

Signed-off-by: GomathiselviS gomathiselvi@gmail.com

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

Signed-off-by: GomathiselviS <gomathiselvi@gmail.com>
@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug community_review module module needs_triage plugins plugin (any type) labels Aug 29, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

✔️ ansible-galaxy-importer SUCCESS in 4m 16s
✔️ build-ansible-collection SUCCESS in 5m 28s
ansible-test-sanity-aws-ansible-python38 FAILURE in 8m 39s
ansible-test-sanity-aws-ansible-2.12-python38 FAILURE in 9m 00s
ansible-test-sanity-aws-ansible-2.13-python38 FAILURE in 9m 35s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 6m 37s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 6m 09s
✔️ ansible-test-splitter SUCCESS in 2m 34s
✔️ integration-amazon.aws-1 SUCCESS in 7m 35s
⚠️ integration-amazon.aws-2 SKIPPED
⚠️ integration-amazon.aws-3 SKIPPED
⚠️ integration-amazon.aws-4 SKIPPED
⚠️ integration-amazon.aws-5 SKIPPED
⚠️ integration-amazon.aws-6 SKIPPED
⚠️ integration-amazon.aws-7 SKIPPED
⚠️ integration-amazon.aws-8 SKIPPED
⚠️ integration-amazon.aws-9 SKIPPED
⚠️ integration-amazon.aws-10 SKIPPED
⚠️ integration-amazon.aws-11 SKIPPED
⚠️ integration-amazon.aws-12 SKIPPED
⚠️ integration-amazon.aws-13 SKIPPED
integration-community.aws-1 FAILURE in 5m 40s
✔️ integration-community.aws-2 SUCCESS in 8m 19s
✔️ integration-community.aws-3 SUCCESS in 25m 17s
✔️ integration-community.aws-4 SUCCESS in 47m 22s
✔️ integration-community.aws-5 SUCCESS in 22m 42s
✔️ integration-community.aws-6 SUCCESS in 45m 53s
✔️ integration-community.aws-7 SUCCESS in 45m 29s
✔️ integration-community.aws-8 SUCCESS in 9m 33s
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED
✔️ ansible-test-changelog SUCCESS in 2m 17s

Copy link
Contributor

@tremble tremble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't expect this PR to fix the issue reported, it'll just bump the exception to a later call.

The InvalidVpcID.NotFound exception is still likely to get thrown
a) By describe_vpc_classic_link_dns_support
b) (possibly) By describe_vpc_attribute

In my opinion it would be better to move the describe_vpc_classic_link and describe_vpc_classic_link_dns_support calls into the main loop (originally line 212).

We should then explicitly handle the InvalidVpcID.NotFound exceptions for all of the describe_ calls.

I'd also be tempted to pull the try/except blocks out into their own functions, to reduce the copy/paste a little. For example:

def describe_vpc_attribute(connection, module, vpc_id, attribute):
    error_message = "Unable to describe VPC attribute {0} on VPC {1}"
    try:
        return connection.describe_vpc_attribute(VpcId=vpc_id, Attribute=attribute, aws_retry=True)
    except is_boto3_error_code('InvalidVpcID.NotFound'):
        module.warn(error_message.format(attribute, vpc_id))
        return None
    except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
        module.fail_json_aws(e, msg=error_message.format(attribute, vpc_id))

You'll need to be a little more careful when processing the attributes, but it's probably worth it.

@GomathiselviS
Copy link
Collaborator Author

I don't expect this PR to fix the issue reported, it'll just bump the exception to a later call.

The InvalidVpcID.NotFound exception is still likely to get thrown a) By describe_vpc_classic_link_dns_support b) (possibly) By describe_vpc_attribute

In my opinion it would be better to move the describe_vpc_classic_link and describe_vpc_classic_link_dns_support calls into the main loop (originally line 212).

We should then explicitly handle the InvalidVpcID.NotFound exceptions for all of the describe_ calls.

I'd also be tempted to pull the try/except blocks out into their own functions, to reduce the copy/paste a little. For example:

def describe_vpc_attribute(connection, module, vpc_id, attribute):
    error_message = "Unable to describe VPC attribute {0} on VPC {1}"
    try:
        return connection.describe_vpc_attribute(VpcId=vpc_id, Attribute=attribute, aws_retry=True)
    except is_boto3_error_code('InvalidVpcID.NotFound'):
        module.warn(error_message.format(attribute, vpc_id))
        return None
    except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
        module.fail_json_aws(e, msg=error_message.format(attribute, vpc_id))

You'll need to be a little more careful when processing the attributes, but it's probably worth it.

A warning is thrown if the vpc is a shared vpc. Following is a sample return payload

[WARNING]: Unable to describe VPC attribute ClassicLinkEnabled on VPC vpc-03ad6a81c023b59fb
ok: [localhost] => {
    "changed": false,
    "invocation": {
        "module_args": {
            "aws_access_key": null,
            "aws_ca_bundle": null,
            "aws_config": null,
            "aws_secret_key": null,
            "debug_botocore_endpoint_logs": false,
            "ec2_url": null,
            "filters": {},
            "profile": null,
            "region": null,
            "security_token": null,
            "validate_certs": true,
            "vpc_ids": []
        }
    },
    "vpcs": [
        {
            "cidr_block": "172.31.0.0/16",
            "cidr_block_association_set": [
                {
                    "association_id": "vpc-cidr-assoc-03731e0529a8865fe",
                    "cidr_block": "172.31.0.0/16",
                    "cidr_block_state": {
                        "state": "associated"
                    }
                }
            ],
            "classic_link_dns_supported": false,
            "classic_link_enabled": false,
            "dhcp_options_id": "dopt-0e3763d36c420b1fe",
            "enable_dns_hostnames": true,
            "enable_dns_support": true,
            "id": "vpc-0c50cff2f20e950ab",
            "instance_tenancy": "default",
            "is_default": true,
            "owner_id": "212924601910",
            "state": "available",
            "tags": {},
            "vpc_id": "vpc-0c50cff2f20e950ab"
        },
        {
            "cidr_block": "10.0.0.0/16",
            "cidr_block_association_set": [
                {
                    "association_id": "vpc-cidr-assoc-067de6c6064e612dc",
                    "cidr_block": "10.0.0.0/16",
                    "cidr_block_state": {
                        "state": "associated"
                    }
                }
            ],
            "dhcp_options_id": "dopt-04083a54c58622e48",
            "enable_dns_hostnames": false,
            "enable_dns_support": true,
            "id": "vpc-03ad6a81c023b59fb",
            "instance_tenancy": "default",
            "is_default": false,
            "owner_id": "350064881214",
            "state": "available",
            "tags": {
                "Name": "sharedfromacc5"
            },
            "vpc_id": "vpc-03ad6a81c023b59fb"
        }
    ]
}

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

✔️ ansible-galaxy-importer SUCCESS in 3m 42s
✔️ build-ansible-collection SUCCESS in 5m 32s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 10m 37s
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 8m 26s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 9m 14s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 6m 01s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 6m 41s
✔️ ansible-test-splitter SUCCESS in 2m 44s
integration-amazon.aws-1 FAILURE in 8m 42s
⚠️ integration-amazon.aws-2 SKIPPED
⚠️ integration-amazon.aws-3 SKIPPED
⚠️ integration-amazon.aws-4 SKIPPED
⚠️ integration-amazon.aws-5 SKIPPED
⚠️ integration-amazon.aws-6 SKIPPED
⚠️ integration-amazon.aws-7 SKIPPED
⚠️ integration-amazon.aws-8 SKIPPED
⚠️ integration-amazon.aws-9 SKIPPED
⚠️ integration-amazon.aws-10 SKIPPED
⚠️ integration-amazon.aws-11 SKIPPED
⚠️ integration-amazon.aws-12 SKIPPED
⚠️ integration-amazon.aws-13 SKIPPED
integration-community.aws-1 FAILURE in 5m 34s
✔️ integration-community.aws-2 SUCCESS in 8m 52s
✔️ integration-community.aws-3 SUCCESS in 23m 54s
✔️ integration-community.aws-4 SUCCESS in 49m 59s
✔️ integration-community.aws-5 SUCCESS in 21m 13s
✔️ integration-community.aws-6 SUCCESS in 42m 01s
✔️ integration-community.aws-7 SUCCESS in 47m 07s
✔️ integration-community.aws-8 SUCCESS in 7m 41s
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED
✔️ ansible-test-changelog SUCCESS in 2m 36s

@GomathiselviS
Copy link
Collaborator Author

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

✔️ ansible-galaxy-importer SUCCESS in 4m 53s
✔️ build-ansible-collection SUCCESS in 5m 54s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 8m 48s
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 11m 05s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 9m 53s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 5m 33s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 6m 05s
✔️ ansible-test-splitter SUCCESS in 2m 38s
✔️ integration-amazon.aws-1 SUCCESS in 9m 46s
⚠️ integration-amazon.aws-2 SKIPPED
⚠️ integration-amazon.aws-3 SKIPPED
⚠️ integration-amazon.aws-4 SKIPPED
⚠️ integration-amazon.aws-5 SKIPPED
⚠️ integration-amazon.aws-6 SKIPPED
⚠️ integration-amazon.aws-7 SKIPPED
⚠️ integration-amazon.aws-8 SKIPPED
⚠️ integration-amazon.aws-9 SKIPPED
⚠️ integration-amazon.aws-10 SKIPPED
⚠️ integration-amazon.aws-11 SKIPPED
⚠️ integration-amazon.aws-12 SKIPPED
⚠️ integration-amazon.aws-13 SKIPPED
⚠️ integration-community.aws-1 SKIPPED
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED
✔️ ansible-test-changelog SUCCESS in 2m 17s

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

✔️ ansible-galaxy-importer SUCCESS in 4m 08s
✔️ build-ansible-collection SUCCESS in 4m 50s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 10m 01s
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 11m 13s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 8m 59s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 4m 59s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 5m 52s
✔️ ansible-test-splitter SUCCESS in 2m 30s
✔️ integration-amazon.aws-1 SUCCESS in 7m 38s
⚠️ integration-amazon.aws-2 SKIPPED
⚠️ integration-amazon.aws-3 SKIPPED
⚠️ integration-amazon.aws-4 SKIPPED
⚠️ integration-amazon.aws-5 SKIPPED
⚠️ integration-amazon.aws-6 SKIPPED
⚠️ integration-amazon.aws-7 SKIPPED
⚠️ integration-amazon.aws-8 SKIPPED
⚠️ integration-amazon.aws-9 SKIPPED
⚠️ integration-amazon.aws-10 SKIPPED
⚠️ integration-amazon.aws-11 SKIPPED
⚠️ integration-amazon.aws-12 SKIPPED
⚠️ integration-amazon.aws-13 SKIPPED
⚠️ integration-community.aws-1 SKIPPED
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED
✔️ ansible-test-changelog SUCCESS in 2m 15s

Copy link
Contributor

@tremble tremble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor tweak to changelog but otherwise lgtm

changelogs/fragments/984-ec2_vpc_net_info_shared_vpc.yml Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Sep 7, 2022

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

✔️ ansible-galaxy-importer SUCCESS in 4m 57s
✔️ build-ansible-collection SUCCESS in 5m 36s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 12m 23s
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 12m 26s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 11m 44s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 9m 24s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 10m 15s
✔️ ansible-test-splitter SUCCESS in 2m 38s
✔️ integration-amazon.aws-1 SUCCESS in 9m 37s
⚠️ integration-amazon.aws-2 SKIPPED
⚠️ integration-amazon.aws-3 SKIPPED
⚠️ integration-amazon.aws-4 SKIPPED
⚠️ integration-amazon.aws-5 SKIPPED
⚠️ integration-amazon.aws-6 SKIPPED
⚠️ integration-amazon.aws-7 SKIPPED
⚠️ integration-amazon.aws-8 SKIPPED
⚠️ integration-amazon.aws-9 SKIPPED
⚠️ integration-amazon.aws-10 SKIPPED
⚠️ integration-amazon.aws-11 SKIPPED
⚠️ integration-amazon.aws-12 SKIPPED
⚠️ integration-amazon.aws-13 SKIPPED
✔️ integration-community.aws-1 SUCCESS in 12m 21s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED
✔️ ansible-test-changelog SUCCESS in 2m 20s

@GomathiselviS GomathiselviS added the mergeit Merge the PR (SoftwareFactory) label Sep 7, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

✔️ ansible-galaxy-importer SUCCESS in 5m 02s
✔️ build-ansible-collection SUCCESS in 5m 55s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 11m 24s
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 11m 06s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 10m 29s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 7m 14s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 7m 40s
✔️ ansible-test-splitter SUCCESS in 3m 18s
✔️ integration-amazon.aws-1 SUCCESS in 10m 34s
⚠️ integration-amazon.aws-2 SKIPPED
⚠️ integration-amazon.aws-3 SKIPPED
⚠️ integration-amazon.aws-4 SKIPPED
⚠️ integration-amazon.aws-5 SKIPPED
⚠️ integration-amazon.aws-6 SKIPPED
⚠️ integration-amazon.aws-7 SKIPPED
⚠️ integration-amazon.aws-8 SKIPPED
⚠️ integration-amazon.aws-9 SKIPPED
⚠️ integration-amazon.aws-10 SKIPPED
⚠️ integration-amazon.aws-11 SKIPPED
⚠️ integration-amazon.aws-12 SKIPPED
⚠️ integration-amazon.aws-13 SKIPPED
⚠️ integration-community.aws-1 SKIPPED
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED
✔️ ansible-test-changelog SUCCESS in 2m 36s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 14a4507 into ansible-collections:main Sep 7, 2022
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Sep 9, 2022
Various integration test fixes

SUMMARY

Updates the version of Python used by lambda in the lambda_alias, lambda_policy and aws_secret integration tests
Updates the version of NodeJS used by the lambda in the lamba integration tests
Adds a retry to the s3_bucket_notification tests, permissions are sometimes a little slow to update
Cleans up Snapshots from rds_instance integration tests
Disables broken WAFv2 integration test (ansible-collections#985)

Fixes: ansible-collections#976
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
aws_secret
lambda
lambda_alias
lambda_policy
rds_policy
s3_bucket_notification
wafv2
ADDITIONAL INFORMATION
Amazon appear to have dropped support for creating Python2.7 lambdas:
botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions.

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@c5e4640
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Sep 9, 2022
Various integration test fixes

SUMMARY

Updates the version of Python used by lambda in the lambda_alias, lambda_policy and aws_secret integration tests
Updates the version of NodeJS used by the lambda in the lamba integration tests
Adds a retry to the s3_bucket_notification tests, permissions are sometimes a little slow to update
Cleans up Snapshots from rds_instance integration tests
Disables broken WAFv2 integration test (ansible-collections#985)

Fixes: ansible-collections#976
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
aws_secret
lambda
lambda_alias
lambda_policy
rds_policy
s3_bucket_notification
wafv2
ADDITIONAL INFORMATION
Amazon appear to have dropped support for creating Python2.7 lambdas:
botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions.

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@c5e4640
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Sep 9, 2022
Various integration test fixes

SUMMARY

Updates the version of Python used by lambda in the lambda_alias, lambda_policy and aws_secret integration tests
Updates the version of NodeJS used by the lambda in the lamba integration tests
Adds a retry to the s3_bucket_notification tests, permissions are sometimes a little slow to update
Cleans up Snapshots from rds_instance integration tests
Disables broken WAFv2 integration test (ansible-collections#985)

Fixes: ansible-collections#976
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
aws_secret
lambda
lambda_alias
lambda_policy
rds_policy
s3_bucket_notification
wafv2
ADDITIONAL INFORMATION
Amazon appear to have dropped support for creating Python2.7 lambdas:
botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions.

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@c5e4640
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Sep 16, 2022
Various integration test fixes

SUMMARY

Updates the version of Python used by lambda in the lambda_alias, lambda_policy and aws_secret integration tests
Updates the version of NodeJS used by the lambda in the lamba integration tests
Adds a retry to the s3_bucket_notification tests, permissions are sometimes a little slow to update
Cleans up Snapshots from rds_instance integration tests
Disables broken WAFv2 integration test (ansible-collections#985)

Fixes: ansible-collections#976
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
aws_secret
lambda
lambda_alias
lambda_policy
rds_policy
s3_bucket_notification
wafv2
ADDITIONAL INFORMATION
Amazon appear to have dropped support for creating Python2.7 lambdas:
botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions.

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@c5e4640
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Sep 16, 2022
Various integration test fixes

SUMMARY

Updates the version of Python used by lambda in the lambda_alias, lambda_policy and aws_secret integration tests
Updates the version of NodeJS used by the lambda in the lamba integration tests
Adds a retry to the s3_bucket_notification tests, permissions are sometimes a little slow to update
Cleans up Snapshots from rds_instance integration tests
Disables broken WAFv2 integration test (ansible-collections#985)

Fixes: ansible-collections#976
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
aws_secret
lambda
lambda_alias
lambda_policy
rds_policy
s3_bucket_notification
wafv2
ADDITIONAL INFORMATION
Amazon appear to have dropped support for creating Python2.7 lambdas:
botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions.

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@c5e4640
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Sep 16, 2022
Various integration test fixes

SUMMARY

Updates the version of Python used by lambda in the lambda_alias, lambda_policy and aws_secret integration tests
Updates the version of NodeJS used by the lambda in the lamba integration tests
Adds a retry to the s3_bucket_notification tests, permissions are sometimes a little slow to update
Cleans up Snapshots from rds_instance integration tests
Disables broken WAFv2 integration test (ansible-collections#985)

Fixes: ansible-collections#976
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
aws_secret
lambda
lambda_alias
lambda_policy
rds_policy
s3_bucket_notification
wafv2
ADDITIONAL INFORMATION
Amazon appear to have dropped support for creating Python2.7 lambdas:
botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions.

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@c5e4640
goneri pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Sep 21, 2022
Various integration test fixes

SUMMARY

Updates the version of Python used by lambda in the lambda_alias, lambda_policy and aws_secret integration tests
Updates the version of NodeJS used by the lambda in the lamba integration tests
Adds a retry to the s3_bucket_notification tests, permissions are sometimes a little slow to update
Cleans up Snapshots from rds_instance integration tests
Disables broken WAFv2 integration test (ansible-collections#985)

Fixes: ansible-collections#976
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
aws_secret
lambda
lambda_alias
lambda_policy
rds_policy
s3_bucket_notification
wafv2
ADDITIONAL INFORMATION
Amazon appear to have dropped support for creating Python2.7 lambdas:
botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions.

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@c5e4640
goneri pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Sep 21, 2022
Various integration test fixes

SUMMARY

Updates the version of Python used by lambda in the lambda_alias, lambda_policy and aws_secret integration tests
Updates the version of NodeJS used by the lambda in the lamba integration tests
Adds a retry to the s3_bucket_notification tests, permissions are sometimes a little slow to update
Cleans up Snapshots from rds_instance integration tests
Disables broken WAFv2 integration test (ansible-collections#985)

Fixes: ansible-collections#976
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
aws_secret
lambda
lambda_alias
lambda_policy
rds_policy
s3_bucket_notification
wafv2
ADDITIONAL INFORMATION
Amazon appear to have dropped support for creating Python2.7 lambdas:
botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions.

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@c5e4640
goneri pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Sep 21, 2022
Various integration test fixes

SUMMARY

Updates the version of Python used by lambda in the lambda_alias, lambda_policy and aws_secret integration tests
Updates the version of NodeJS used by the lambda in the lamba integration tests
Adds a retry to the s3_bucket_notification tests, permissions are sometimes a little slow to update
Cleans up Snapshots from rds_instance integration tests
Disables broken WAFv2 integration test (ansible-collections#985)

Fixes: ansible-collections#976
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
aws_secret
lambda
lambda_alias
lambda_policy
rds_policy
s3_bucket_notification
wafv2
ADDITIONAL INFORMATION
Amazon appear to have dropped support for creating Python2.7 lambdas:
botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions.

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@c5e4640
goneri pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Sep 21, 2022
Various integration test fixes

SUMMARY

Updates the version of Python used by lambda in the lambda_alias, lambda_policy and aws_secret integration tests
Updates the version of NodeJS used by the lambda in the lamba integration tests
Adds a retry to the s3_bucket_notification tests, permissions are sometimes a little slow to update
Cleans up Snapshots from rds_instance integration tests
Disables broken WAFv2 integration test (ansible-collections#985)

Fixes: ansible-collections#976
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
aws_secret
lambda
lambda_alias
lambda_policy
rds_policy
s3_bucket_notification
wafv2
ADDITIONAL INFORMATION
Amazon appear to have dropped support for creating Python2.7 lambdas:
botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions.

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@c5e4640
goneri pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Sep 21, 2022
Various integration test fixes

SUMMARY

Updates the version of Python used by lambda in the lambda_alias, lambda_policy and aws_secret integration tests
Updates the version of NodeJS used by the lambda in the lamba integration tests
Adds a retry to the s3_bucket_notification tests, permissions are sometimes a little slow to update
Cleans up Snapshots from rds_instance integration tests
Disables broken WAFv2 integration test (ansible-collections#985)

Fixes: ansible-collections#976
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
aws_secret
lambda
lambda_alias
lambda_policy
rds_policy
s3_bucket_notification
wafv2
ADDITIONAL INFORMATION
Amazon appear to have dropped support for creating Python2.7 lambdas:
botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions.

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@c5e4640
goneri pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Sep 21, 2022
Various integration test fixes

SUMMARY

Updates the version of Python used by lambda in the lambda_alias, lambda_policy and aws_secret integration tests
Updates the version of NodeJS used by the lambda in the lamba integration tests
Adds a retry to the s3_bucket_notification tests, permissions are sometimes a little slow to update
Cleans up Snapshots from rds_instance integration tests
Disables broken WAFv2 integration test (ansible-collections#985)

Fixes: ansible-collections#976
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
aws_secret
lambda
lambda_alias
lambda_policy
rds_policy
s3_bucket_notification
wafv2
ADDITIONAL INFORMATION
Amazon appear to have dropped support for creating Python2.7 lambdas:
botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions.

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@c5e4640
goneri pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Sep 21, 2022
Various integration test fixes

SUMMARY

Updates the version of Python used by lambda in the lambda_alias, lambda_policy and aws_secret integration tests
Updates the version of NodeJS used by the lambda in the lamba integration tests
Adds a retry to the s3_bucket_notification tests, permissions are sometimes a little slow to update
Cleans up Snapshots from rds_instance integration tests
Disables broken WAFv2 integration test (ansible-collections#985)

Fixes: ansible-collections#976
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
aws_secret
lambda
lambda_alias
lambda_policy
rds_policy
s3_bucket_notification
wafv2
ADDITIONAL INFORMATION
Amazon appear to have dropped support for creating Python2.7 lambdas:
botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions.

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@c5e4640
goneri pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Sep 21, 2022
Various integration test fixes

SUMMARY

Updates the version of Python used by lambda in the lambda_alias, lambda_policy and aws_secret integration tests
Updates the version of NodeJS used by the lambda in the lamba integration tests
Adds a retry to the s3_bucket_notification tests, permissions are sometimes a little slow to update
Cleans up Snapshots from rds_instance integration tests
Disables broken WAFv2 integration test (ansible-collections#985)

Fixes: ansible-collections#976
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
aws_secret
lambda
lambda_alias
lambda_policy
rds_policy
s3_bucket_notification
wafv2
ADDITIONAL INFORMATION
Amazon appear to have dropped support for creating Python2.7 lambdas:
botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions.

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@c5e4640
goneri pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Sep 21, 2022
Various integration test fixes

SUMMARY

Updates the version of Python used by lambda in the lambda_alias, lambda_policy and aws_secret integration tests
Updates the version of NodeJS used by the lambda in the lamba integration tests
Adds a retry to the s3_bucket_notification tests, permissions are sometimes a little slow to update
Cleans up Snapshots from rds_instance integration tests
Disables broken WAFv2 integration test (ansible-collections#985)

Fixes: ansible-collections#976
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
aws_secret
lambda
lambda_alias
lambda_policy
rds_policy
s3_bucket_notification
wafv2
ADDITIONAL INFORMATION
Amazon appear to have dropped support for creating Python2.7 lambdas:
botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions.

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@c5e4640
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Oct 5, 2022
ec2_vpc_net_info: fix keyerror

SUMMARY
Introduced in #984 since amazon.aws 5.0.0

KeyError: 'ClassicLinkDnsSupported'

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
ec2_vpc_net_info
ADDITIONAL INFORMATION



---
- hosts: localhost

  tasks:
    - name: Get VPC Information
      ec2_vpc_net_info:
        region: eu-central-1
      register: vpc
    
    - debug:
        var: vpc
results in
ansible-playbook [core 2.12.5]
  config file = /home/m/git/lekker/iac/ansible.cfg
  configured module search path = ['/home/m/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/m/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/m/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/m/.local/bin/ansible-playbook
  python version = 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0]
  jinja version = 3.1.2
  libyaml = True
Using /home/m/git/lekker/iac/ansible.cfg as config file
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
yaml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
ini declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
toml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
[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'
redirecting (type: modules) ansible.builtin.ec2_vpc_net_info to amazon.aws.ec2_vpc_net_info
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: dev003.yml ***********************************************************
1 plays in dev003.yml

PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
task path: /home/m/git/lekker/iac/dev003.yml:2
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: m
<127.0.0.1> EXEC /bin/sh -c 'echo ~m && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/m/.ansible/tmp `"&& mkdir "` echo /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264 `" && echo ansible-tmp-1664956131.9332027-127698-125869016159264="` echo /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264 `" ) && sleep 0'
Using module file /home/m/.local/lib/python3.10/site-packages/ansible/modules/setup.py
<127.0.0.1> PUT /home/m/.ansible/tmp/ansible-local-127691_siearhm/tmpyv6re_ml TO /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/ /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/ > /dev/null 2>&1 && sleep 0'
ok: [localhost]
META: ran handlers

TASK [Get VPC Information] *****************************************************
task path: /home/m/git/lekker/iac/dev003.yml:5
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: m
<127.0.0.1> EXEC /bin/sh -c 'echo ~m && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/m/.ansible/tmp `"&& mkdir "` echo /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109 `" && echo ansible-tmp-1664956133.024292-127805-105124013383109="` echo /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.ec2_vpc_net_info to amazon.aws.ec2_vpc_net_info
Using module file /home/m/.ansible/collections/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py
<127.0.0.1> PUT /home/m/.ansible/tmp/ansible-local-127691_siearhm/tmphfs01m94 TO /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/ /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 107, in <module>
    _ansiballz_main()
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', init_globals=dict(_module_fqn='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', _modlib_path=modlib_path),
  File "/usr/lib/python3.10/runpy.py", line 224, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 272, in <module>
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 268, in main
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 215, in describe_vpcs
KeyError: 'ClassicLinkDnsSupported'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', init_globals=dict(_module_fqn='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', _modlib_path=modlib_path),\n  File \"/usr/lib/python3.10/runpy.py\", line 224, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.10/runpy.py\", line 96, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 272, in <module>\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 268, in main\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 215, in describe_vpcs\nKeyError: 'ClassicLinkDnsSupported'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

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

Reviewed-by: Mark Chappell <None>
Reviewed-by: Alina Buzachis <None>
patchback bot pushed a commit that referenced this pull request Oct 5, 2022
ec2_vpc_net_info: fix keyerror

SUMMARY
Introduced in #984 since amazon.aws 5.0.0

KeyError: 'ClassicLinkDnsSupported'

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ec2_vpc_net_info
ADDITIONAL INFORMATION

---
- hosts: localhost

  tasks:
    - name: Get VPC Information
      ec2_vpc_net_info:
        region: eu-central-1
      register: vpc

    - debug:
        var: vpc
results in
ansible-playbook [core 2.12.5]
  config file = /home/m/git/lekker/iac/ansible.cfg
  configured module search path = ['/home/m/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/m/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/m/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/m/.local/bin/ansible-playbook
  python version = 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0]
  jinja version = 3.1.2
  libyaml = True
Using /home/m/git/lekker/iac/ansible.cfg as config file
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
yaml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
ini declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
toml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
[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'
redirecting (type: modules) ansible.builtin.ec2_vpc_net_info to amazon.aws.ec2_vpc_net_info
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: dev003.yml ***********************************************************
1 plays in dev003.yml

PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
task path: /home/m/git/lekker/iac/dev003.yml:2
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: m
<127.0.0.1> EXEC /bin/sh -c 'echo ~m && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/m/.ansible/tmp `"&& mkdir "` echo /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264 `" && echo ansible-tmp-1664956131.9332027-127698-125869016159264="` echo /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264 `" ) && sleep 0'
Using module file /home/m/.local/lib/python3.10/site-packages/ansible/modules/setup.py
<127.0.0.1> PUT /home/m/.ansible/tmp/ansible-local-127691_siearhm/tmpyv6re_ml TO /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/ /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/ > /dev/null 2>&1 && sleep 0'
ok: [localhost]
META: ran handlers

TASK [Get VPC Information] *****************************************************
task path: /home/m/git/lekker/iac/dev003.yml:5
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: m
<127.0.0.1> EXEC /bin/sh -c 'echo ~m && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/m/.ansible/tmp `"&& mkdir "` echo /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109 `" && echo ansible-tmp-1664956133.024292-127805-105124013383109="` echo /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.ec2_vpc_net_info to amazon.aws.ec2_vpc_net_info
Using module file /home/m/.ansible/collections/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py
<127.0.0.1> PUT /home/m/.ansible/tmp/ansible-local-127691_siearhm/tmphfs01m94 TO /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/ /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 107, in <module>
    _ansiballz_main()
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', init_globals=dict(_module_fqn='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', _modlib_path=modlib_path),
  File "/usr/lib/python3.10/runpy.py", line 224, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 272, in <module>
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 268, in main
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 215, in describe_vpcs
KeyError: 'ClassicLinkDnsSupported'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', init_globals=dict(_module_fqn='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', _modlib_path=modlib_path),\n  File \"/usr/lib/python3.10/runpy.py\", line 224, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.10/runpy.py\", line 96, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 272, in <module>\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 268, in main\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 215, in describe_vpcs\nKeyError: 'ClassicLinkDnsSupported'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

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

Reviewed-by: Mark Chappell <None>
Reviewed-by: Alina Buzachis <None>
(cherry picked from commit 1573f17)
tremble pushed a commit that referenced this pull request Oct 6, 2022
ec2_vpc_net_info: fix keyerror

SUMMARY
Introduced in #984 since amazon.aws 5.0.0

KeyError: 'ClassicLinkDnsSupported'

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ec2_vpc_net_info
ADDITIONAL INFORMATION

---
- hosts: localhost

  tasks:
    - name: Get VPC Information
      ec2_vpc_net_info:
        region: eu-central-1
      register: vpc

    - debug:
        var: vpc
results in
ansible-playbook [core 2.12.5]
  config file = /home/m/git/lekker/iac/ansible.cfg
  configured module search path = ['/home/m/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/m/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/m/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/m/.local/bin/ansible-playbook
  python version = 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0]
  jinja version = 3.1.2
  libyaml = True
Using /home/m/git/lekker/iac/ansible.cfg as config file
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
yaml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
ini declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
toml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
[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'
redirecting (type: modules) ansible.builtin.ec2_vpc_net_info to amazon.aws.ec2_vpc_net_info
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: dev003.yml ***********************************************************
1 plays in dev003.yml

PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
task path: /home/m/git/lekker/iac/dev003.yml:2
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: m
<127.0.0.1> EXEC /bin/sh -c 'echo ~m && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/m/.ansible/tmp `"&& mkdir "` echo /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264 `" && echo ansible-tmp-1664956131.9332027-127698-125869016159264="` echo /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264 `" ) && sleep 0'
Using module file /home/m/.local/lib/python3.10/site-packages/ansible/modules/setup.py
<127.0.0.1> PUT /home/m/.ansible/tmp/ansible-local-127691_siearhm/tmpyv6re_ml TO /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/ /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/ > /dev/null 2>&1 && sleep 0'
ok: [localhost]
META: ran handlers

TASK [Get VPC Information] *****************************************************
task path: /home/m/git/lekker/iac/dev003.yml:5
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: m
<127.0.0.1> EXEC /bin/sh -c 'echo ~m && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/m/.ansible/tmp `"&& mkdir "` echo /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109 `" && echo ansible-tmp-1664956133.024292-127805-105124013383109="` echo /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.ec2_vpc_net_info to amazon.aws.ec2_vpc_net_info
Using module file /home/m/.ansible/collections/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py
<127.0.0.1> PUT /home/m/.ansible/tmp/ansible-local-127691_siearhm/tmphfs01m94 TO /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/ /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 107, in <module>
    _ansiballz_main()
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', init_globals=dict(_module_fqn='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', _modlib_path=modlib_path),
  File "/usr/lib/python3.10/runpy.py", line 224, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 272, in <module>
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 268, in main
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 215, in describe_vpcs
KeyError: 'ClassicLinkDnsSupported'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', init_globals=dict(_module_fqn='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', _modlib_path=modlib_path),\n  File \"/usr/lib/python3.10/runpy.py\", line 224, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.10/runpy.py\", line 96, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 272, in <module>\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 268, in main\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 215, in describe_vpcs\nKeyError: 'ClassicLinkDnsSupported'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

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

Reviewed-by: Mark Chappell <None>
Reviewed-by: Alina Buzachis <None>
(cherry picked from commit 1573f17)
tremble pushed a commit that referenced this pull request Oct 6, 2022
ec2_vpc_net_info: fix keyerror

SUMMARY
Introduced in #984 since amazon.aws 5.0.0

KeyError: 'ClassicLinkDnsSupported'

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ec2_vpc_net_info
ADDITIONAL INFORMATION

---
- hosts: localhost

  tasks:
    - name: Get VPC Information
      ec2_vpc_net_info:
        region: eu-central-1
      register: vpc

    - debug:
        var: vpc
results in
ansible-playbook [core 2.12.5]
  config file = /home/m/git/lekker/iac/ansible.cfg
  configured module search path = ['/home/m/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/m/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/m/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/m/.local/bin/ansible-playbook
  python version = 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0]
  jinja version = 3.1.2
  libyaml = True
Using /home/m/git/lekker/iac/ansible.cfg as config file
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
yaml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
ini declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
toml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
[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'
redirecting (type: modules) ansible.builtin.ec2_vpc_net_info to amazon.aws.ec2_vpc_net_info
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: dev003.yml ***********************************************************
1 plays in dev003.yml

PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
task path: /home/m/git/lekker/iac/dev003.yml:2
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: m
<127.0.0.1> EXEC /bin/sh -c 'echo ~m && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/m/.ansible/tmp `"&& mkdir "` echo /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264 `" && echo ansible-tmp-1664956131.9332027-127698-125869016159264="` echo /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264 `" ) && sleep 0'
Using module file /home/m/.local/lib/python3.10/site-packages/ansible/modules/setup.py
<127.0.0.1> PUT /home/m/.ansible/tmp/ansible-local-127691_siearhm/tmpyv6re_ml TO /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/ /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/ > /dev/null 2>&1 && sleep 0'
ok: [localhost]
META: ran handlers

TASK [Get VPC Information] *****************************************************
task path: /home/m/git/lekker/iac/dev003.yml:5
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: m
<127.0.0.1> EXEC /bin/sh -c 'echo ~m && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/m/.ansible/tmp `"&& mkdir "` echo /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109 `" && echo ansible-tmp-1664956133.024292-127805-105124013383109="` echo /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.ec2_vpc_net_info to amazon.aws.ec2_vpc_net_info
Using module file /home/m/.ansible/collections/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py
<127.0.0.1> PUT /home/m/.ansible/tmp/ansible-local-127691_siearhm/tmphfs01m94 TO /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/ /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 107, in <module>
    _ansiballz_main()
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', init_globals=dict(_module_fqn='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', _modlib_path=modlib_path),
  File "/usr/lib/python3.10/runpy.py", line 224, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 272, in <module>
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 268, in main
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 215, in describe_vpcs
KeyError: 'ClassicLinkDnsSupported'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', init_globals=dict(_module_fqn='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', _modlib_path=modlib_path),\n  File \"/usr/lib/python3.10/runpy.py\", line 224, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.10/runpy.py\", line 96, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 272, in <module>\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 268, in main\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 215, in describe_vpcs\nKeyError: 'ClassicLinkDnsSupported'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

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

Reviewed-by: Mark Chappell <None>
Reviewed-by: Alina Buzachis <None>
(cherry picked from commit 1573f17)
tremble pushed a commit that referenced this pull request Oct 6, 2022
ec2_vpc_net_info: fix keyerror

SUMMARY
Introduced in #984 since amazon.aws 5.0.0

KeyError: 'ClassicLinkDnsSupported'

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ec2_vpc_net_info

ADDITIONAL INFORMATION

---
- hosts: localhost

  tasks:
    - name: Get VPC Information
      ec2_vpc_net_info:
        region: eu-central-1
      register: vpc

    - debug:
        var: vpc
results in
ansible-playbook [core 2.12.5]
  config file = /home/m/git/lekker/iac/ansible.cfg
  configured module search path = ['/home/m/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/m/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/m/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/m/.local/bin/ansible-playbook
  python version = 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0]
  jinja version = 3.1.2
  libyaml = True
Using /home/m/git/lekker/iac/ansible.cfg as config file
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
yaml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
ini declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
toml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
[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'
redirecting (type: modules) ansible.builtin.ec2_vpc_net_info to amazon.aws.ec2_vpc_net_info
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: dev003.yml ***********************************************************
1 plays in dev003.yml

PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
task path: /home/m/git/lekker/iac/dev003.yml:2
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: m
<127.0.0.1> EXEC /bin/sh -c 'echo ~m && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/m/.ansible/tmp `"&& mkdir "` echo /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264 `" && echo ansible-tmp-1664956131.9332027-127698-125869016159264="` echo /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264 `" ) && sleep 0'
Using module file /home/m/.local/lib/python3.10/site-packages/ansible/modules/setup.py
<127.0.0.1> PUT /home/m/.ansible/tmp/ansible-local-127691_siearhm/tmpyv6re_ml TO /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/ /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/ > /dev/null 2>&1 && sleep 0'
ok: [localhost]
META: ran handlers

TASK [Get VPC Information] *****************************************************
task path: /home/m/git/lekker/iac/dev003.yml:5
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: m
<127.0.0.1> EXEC /bin/sh -c 'echo ~m && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/m/.ansible/tmp `"&& mkdir "` echo /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109 `" && echo ansible-tmp-1664956133.024292-127805-105124013383109="` echo /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.ec2_vpc_net_info to amazon.aws.ec2_vpc_net_info
Using module file /home/m/.ansible/collections/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py
<127.0.0.1> PUT /home/m/.ansible/tmp/ansible-local-127691_siearhm/tmphfs01m94 TO /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/ /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 107, in <module>
    _ansiballz_main()
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', init_globals=dict(_module_fqn='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', _modlib_path=modlib_path),
  File "/usr/lib/python3.10/runpy.py", line 224, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 272, in <module>
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 268, in main
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 215, in describe_vpcs
KeyError: 'ClassicLinkDnsSupported'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', init_globals=dict(_module_fqn='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', _modlib_path=modlib_path),\n  File \"/usr/lib/python3.10/runpy.py\", line 224, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.10/runpy.py\", line 96, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 272, in <module>\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 268, in main\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 215, in describe_vpcs\nKeyError: 'ClassicLinkDnsSupported'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

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

Reviewed-by: Mark Chappell <None>
Reviewed-by: Alina Buzachis <None>
(cherry picked from commit 1573f17)
tremble pushed a commit that referenced this pull request Oct 6, 2022
SUMMARY

Introduced in #984 since amazon.aws 5.0.0

KeyError: 'ClassicLinkDnsSupported'

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ec2_vpc_net_info

ADDITIONAL INFORMATION

---
- hosts: localhost

  tasks:
    - name: Get VPC Information
      ec2_vpc_net_info:
        region: eu-central-1
      register: vpc

    - debug:
        var: vpc
results in
ansible-playbook [core 2.12.5]
  config file = /home/m/git/lekker/iac/ansible.cfg
  configured module search path = ['/home/m/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/m/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/m/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/m/.local/bin/ansible-playbook
  python version = 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0]
  jinja version = 3.1.2
  libyaml = True
Using /home/m/git/lekker/iac/ansible.cfg as config file
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
yaml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
ini declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
toml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
[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'
redirecting (type: modules) ansible.builtin.ec2_vpc_net_info to amazon.aws.ec2_vpc_net_info
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: dev003.yml ***********************************************************
1 plays in dev003.yml

PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
task path: /home/m/git/lekker/iac/dev003.yml:2
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: m
<127.0.0.1> EXEC /bin/sh -c 'echo ~m && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/m/.ansible/tmp `"&& mkdir "` echo /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264 `" && echo ansible-tmp-1664956131.9332027-127698-125869016159264="` echo /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264 `" ) && sleep 0'
Using module file /home/m/.local/lib/python3.10/site-packages/ansible/modules/setup.py
<127.0.0.1> PUT /home/m/.ansible/tmp/ansible-local-127691_siearhm/tmpyv6re_ml TO /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/ /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/m/.ansible/tmp/ansible-tmp-1664956131.9332027-127698-125869016159264/ > /dev/null 2>&1 && sleep 0'
ok: [localhost]
META: ran handlers

TASK [Get VPC Information] *****************************************************
task path: /home/m/git/lekker/iac/dev003.yml:5
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: m
<127.0.0.1> EXEC /bin/sh -c 'echo ~m && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/m/.ansible/tmp `"&& mkdir "` echo /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109 `" && echo ansible-tmp-1664956133.024292-127805-105124013383109="` echo /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.ec2_vpc_net_info to amazon.aws.ec2_vpc_net_info
Using module file /home/m/.ansible/collections/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py
<127.0.0.1> PUT /home/m/.ansible/tmp/ansible-local-127691_siearhm/tmphfs01m94 TO /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/ /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 107, in <module>
    _ansiballz_main()
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', init_globals=dict(_module_fqn='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', _modlib_path=modlib_path),
  File "/usr/lib/python3.10/runpy.py", line 224, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 272, in <module>
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 268, in main
  File "/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py", line 215, in describe_vpcs
KeyError: 'ClassicLinkDnsSupported'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/m/.ansible/tmp/ansible-tmp-1664956133.024292-127805-105124013383109/AnsiballZ_ec2_vpc_net_info.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', init_globals=dict(_module_fqn='ansible_collections.amazon.aws.plugins.modules.ec2_vpc_net_info', _modlib_path=modlib_path),\n  File \"/usr/lib/python3.10/runpy.py\", line 224, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.10/runpy.py\", line 96, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 272, in <module>\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 268, in main\n  File \"/tmp/ansible_ec2_vpc_net_info_payload_oi896utp/ansible_ec2_vpc_net_info_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_net_info.py\", line 215, in describe_vpcs\nKeyError: 'ClassicLinkDnsSupported'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

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

Reviewed-by: Mark Chappell <None>
Reviewed-by: Alina Buzachis <None>
(cherry picked from commit 1573f17)

Co-authored-by: Markus Bergholz <git@osuv.de>
abikouo pushed a commit to abikouo/amazon.aws that referenced this pull request Oct 24, 2023
Various integration test fixes

SUMMARY

Updates the version of Python used by lambda in the lambda_alias, lambda_policy and aws_secret integration tests
Updates the version of NodeJS used by the lambda in the lamba integration tests
Adds a retry to the s3_bucket_notification tests, permissions are sometimes a little slow to update
Cleans up Snapshots from rds_instance integration tests
Disables broken WAFv2 integration test (ansible-collections#985)

Fixes: ansible-collections#976
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
aws_secret
lambda
lambda_alias
lambda_policy
rds_policy
s3_bucket_notification
wafv2
ADDITIONAL INFORMATION
Amazon appear to have dropped support for creating Python2.7 lambdas:
botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions.

Reviewed-by: Alina Buzachis <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 community_review mergeit Merge the PR (SoftwareFactory) module module plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ec2_vpc_net_info module : Cannot retrieve info from a VPC shared from another AWS account
4 participants