community.aws
community.aws copied to clipboard
Implement the list_global_accelerators module
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
}
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
cc @jillr @s-hertel @tremble @wimnat click here for bot help
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.
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)
@TylerLubeck do you need help to address these issues? Don't hesitate to ping us on IRC (#ansible-aws).
cc @markuman click here for bot help