community.aws icon indicating copy to clipboard operation
community.aws copied to clipboard

Implement the list_global_accelerators module

Open TylerLubeck opened this issue 4 years ago • 6 comments

SUMMARY

I took a stab at a proof of concept for part of #94 - this implements the most basic list_global_accelerators module to fetch information about active global accelerators for an account

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

list_global_accelerators

ADDITIONAL INFORMATION

The global accelerator API doesn't seem to allow for lookup by anything other than ARN, and doesn't allow for using ARNs to filter the pagination, which means that filtering has to be done client side and not server side. It's also highly possible that I'm just missing something in which case I would love to learn more!

➜ ansible localhost -m community.aws.list_global_accelerators -a 'region=us-west-2' -v
localhost | SUCCESS => {
    "accelerator": [
        {
            "accelerator_arn": "arn:aws:globalaccelerator::snip:accelerator/this-is-a-guid",
            "attributes": {
                "accelerator_attributes": {
                    "flow_logs_enabled": false
                },
                "response_metadata": {
                    "http_headers": {
                        "connection": "keep-alive",
                        "content-length": "51",
                        "content-type": "application/x-amz-json-1.1",
                        "date": "Wed, 10 Jun 2020 22:37:28 GMT",
                        "x-amzn-requestid": "snip"
                    },
                    "http_status_code": 200,
                    "request_id": "snip",
                    "retry_attempts": 0
                }
            },
            "created_time": "2020-04-24T04:54:02-07:00",
            "dns_name": "abcdefg12345.awsglobalaccelerator.com",
            "enabled": true,
            "ip_address_type": "IPV4",
            "ip_sets": [
                {
                    "ip_addresses": [
                        "snip"
                    ],
                    "ip_family": "IPv4"
                }
            ],
            "last_modified_time": "2020-04-24T04:54:05-07:00",
            "name": "myaccelerator",
            "status": "DEPLOYED",
            "tags": {}
        }
    ],
    "changed": false
}

TylerLubeck avatar Jun 10 '20 22:06 TylerLubeck

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

plugins/modules/source_control/git/git_push.py:0:0: doc-required-mismatch: Argument 'url' in argument_spec is required, but is not documented as being required

The test ansible-test sanity --test ansible-doc [explain] failed with the error:

Output on stderr from ansible-doc is considered an error.

Command "ansible-doc -t module community.general.git_commit community.general.git_push" returned exit status 0.
>>> Standard Error
[WARNING]: module community.general.git_commit not found in:
/dev/null:/root/ansible/lib/ansible/modules
[WARNING]: module community.general.git_push not found in:
/dev/null:/root/ansible/lib/ansible/modules

click here for bot help

ansibullbot avatar Aug 19 '20 23:08 ansibullbot

cc @jillr @s-hertel @tremble @wimnat click here for bot help

ansibullbot avatar Aug 19 '20 23:08 ansibullbot

Hi @TylerLubeck, thanks for this PR! This module should be named global_accelerators_info.py if it only provides information.

It will also need tests. Integration tests will likely rely on the module in #97, to create the accelerator to be gathered by this module, so I think this PR should probably depend on that one.

jillr avatar Dec 01 '20 19:12 jillr

One comment in addition to @jillr's it would be good if the module supported describing a specific accelerator. Especially during integration tests this can be helpful for validating that you made the changes you thought you did. Only supporting the listing of all instances of an object can get very time/API-call expensive. (unfortunately boto3 doesn't support server-side filtering)

tremble avatar Dec 01 '20 19:12 tremble

@TylerLubeck do you need help to address these issues? Don't hesitate to ping us on IRC (#ansible-aws).

goneri avatar Feb 03 '21 13:02 goneri

cc @markuman click here for bot help

ansibullbot avatar Jul 05 '22 13:07 ansibullbot