Skip to content

Commit

Permalink
Rename cloudfront_info (#1352)
Browse files Browse the repository at this point in the history
Rename cloudfront_info

SUMMARY
renames cloudfront_info to cloudfront_distribution_info to match it's pair cloudfront_distribution
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/modules/cloudfront_info.py
plugins/modules/cloudfront_distribution_info.py
ADDITIONAL INFORMATION
Also cleans up the legacy_missing_tests/aliases file

Reviewed-by: Alina Buzachis <None>
  • Loading branch information
tremble authored Jul 13, 2022
1 parent 1c3ad28 commit 354a287
Show file tree
Hide file tree
Showing 10 changed files with 820 additions and 40 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Name | Description
[community.aws.cloudformation_exports_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.cloudformation_exports_info_module.rst)|Read a value from CloudFormation Exports
[community.aws.cloudformation_stack_set](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.cloudformation_stack_set_module.rst)|Manage groups of CloudFormation stacks
[community.aws.cloudfront_distribution](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.cloudfront_distribution_module.rst)|Create, update and delete AWS CloudFront distributions
[community.aws.cloudfront_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.cloudfront_info_module.rst)|Obtain facts about an AWS CloudFront distribution
[community.aws.cloudfront_distribution_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.cloudfront_distribution_info_module.rst)|Obtain facts about an AWS CloudFront distribution
[community.aws.cloudfront_invalidation](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.cloudfront_invalidation_module.rst)|create invalidations for AWS CloudFront distributions
[community.aws.cloudfront_origin_access_identity](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.cloudfront_origin_access_identity_module.rst)|Create, update and delete origin access identities for a CloudFront distribution
[community.aws.cloudfront_response_headers_policy](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.cloudfront_response_headers_policy_module.rst)|Create, update and delete response headers policies to be used in a Cloudfront distribution
Expand Down
2 changes: 2 additions & 0 deletions changelogs/fragments/1352-rename-cloudfront.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- cloudfront_info - the ``cloudfront_info`` module has been renamed to ``cloudfront_distribution_info``, ``cloudfront_info`` remains as an alias (https://github.com/ansible-collections/community.aws/pull/1352).
774 changes: 774 additions & 0 deletions docs/community.aws.cloudfront_distribution_info_module.rst

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ action_groups:
- cloudformation_exports_info
- cloudformation_stack_set
- cloudfront_distribution
- cloudfront_distribution_info
- cloudfront_info
- cloudfront_invalidation
- cloudfront_origin_access_identity
Expand Down Expand Up @@ -393,6 +394,9 @@ plugin_routing:
aws_waf_web_acl:
# Deprecation for this alias should not *start* prior to 2024-09-01
redirect: community.aws.waf_web_acl
cloudfront_info:
# Deprecation for this alias should not *start* prior to 2024-09-01
redirect: community.aws.cloudfront_distribution_info
ec2_asg:
# Deprecation for this alias should not *start* prior to 2024-09-01
redirect: community.aws.autoscaling_group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@

DOCUMENTATION = '''
---
module: cloudfront_info
module: cloudfront_distribution_info
version_added: 1.0.0
short_description: Obtain facts about an AWS CloudFront distribution
description:
- Gets information about an AWS CloudFront distribution.
author: Willem van Ketwich (@wilvk)
- Prior to release 5.0.0 this module was called C(community.aws.cloudfront_info).
The usage did not change.
author:
- Willem van Ketwich (@wilvk)
options:
distribution_id:
description:
Expand Down Expand Up @@ -79,114 +82,113 @@
type: bool
invalidation:
description:
- Get information about an invalidation.
- Requires I(invalidation_id) to be specified.
- Get information about an invalidation.
- Requires I(invalidation_id) to be specified.
required: false
default: false
type: bool
streaming_distribution:
description:
- Get information about a specified RTMP distribution.
- Requires I(distribution_id) or I(domain_name_alias) to be specified.
- Get information about a specified RTMP distribution.
- Requires I(distribution_id) or I(domain_name_alias) to be specified.
required: false
default: false
type: bool
streaming_distribution_config:
description:
- Get the configuration information about a specified RTMP distribution.
- Requires I(distribution_id) or I(domain_name_alias) to be specified.
- Get the configuration information about a specified RTMP distribution.
- Requires I(distribution_id) or I(domain_name_alias) to be specified.
required: false
default: false
type: bool
list_origin_access_identities:
description:
- Get a list of CloudFront origin access identities.
- Requires I(origin_access_identity_id) to be set.
- Get a list of CloudFront origin access identities.
- Requires I(origin_access_identity_id) to be set.
required: false
default: false
type: bool
list_distributions:
description:
- Get a list of CloudFront distributions.
- Get a list of CloudFront distributions.
required: false
default: false
type: bool
list_distributions_by_web_acl_id:
description:
- Get a list of distributions using web acl id as a filter.
- Requires I(web_acl_id) to be set.
- Get a list of distributions using web acl id as a filter.
- Requires I(web_acl_id) to be set.
required: false
default: false
type: bool
list_invalidations:
description:
- Get a list of invalidations.
- Requires I(distribution_id) or I(domain_name_alias) to be specified.
- Get a list of invalidations.
- Requires I(distribution_id) or I(domain_name_alias) to be specified.
required: false
default: false
type: bool
list_streaming_distributions:
description:
- Get a list of streaming distributions.
- Get a list of streaming distributions.
required: false
default: false
type: bool
summary:
description:
- Returns a summary of all distributions, streaming distributions and origin_access_identities.
- This is the default behaviour if no option is selected.
- Returns a summary of all distributions, streaming distributions and origin_access_identities.
- This is the default behaviour if no option is selected.
required: false
default: false
type: bool
extends_documentation_fragment:
- amazon.aws.aws
- amazon.aws.ec2
- amazon.aws.aws
- amazon.aws.ec2
'''

EXAMPLES = '''
# Note: These examples do not set authentication details, see the AWS Guide for details.
- name: Get a summary of distributions
community.aws.cloudfront_info:
community.aws.cloudfront_distribution_info:
summary: true
register: result
- name: Get information about a distribution
community.aws.cloudfront_info:
community.aws.cloudfront_distribution_info:
distribution: true
distribution_id: my-cloudfront-distribution-id
register: result_did
- ansible.builtin.debug:
msg: "{{ result_did['cloudfront']['my-cloudfront-distribution-id'] }}"
- name: Get information about a distribution using the CNAME of the cloudfront distribution.
community.aws.cloudfront_info:
community.aws.cloudfront_distribution_info:
distribution: true
domain_name_alias: www.my-website.com
register: result_website
- ansible.builtin.debug:
msg: "{{ result_website['cloudfront']['www.my-website.com'] }}"
- name: Get all information about an invalidation for a distribution.
community.aws.cloudfront_info:
community.aws.cloudfront_distribution_info:
invalidation: true
distribution_id: my-cloudfront-distribution-id
invalidation_id: my-cloudfront-invalidation-id
- name: Get all information about a CloudFront origin access identity.
community.aws.cloudfront_info:
community.aws.cloudfront_distribution_info:
origin_access_identity: true
origin_access_identity_id: my-cloudfront-origin-access-identity-id
- name: Get all information about lists not requiring parameters (ie. list_origin_access_identities, list_distributions, list_streaming_distributions)
community.aws.cloudfront_info:
community.aws.cloudfront_distribution_info:
origin_access_identity: true
origin_access_identity_id: my-cloudfront-origin-access-identity-id
- name: Get all information about lists not requiring parameters (ie. list_origin_access_identities, list_distributions, list_streaming_distributions)
community.aws.cloudfront_info:
community.aws.cloudfront_distribution_info:
all_lists: true
'''

Expand Down
12 changes: 5 additions & 7 deletions tests/integration/targets/legacy_missing_tests/aliases
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
disabled

# Modules that do not have test suites
aws_application_scaling_policy
aws_batch_compute_environment
aws_batch_job_definition
aws_batch_job_queue
cloudfront_info
application_scaling_policy
batch_compute_environment
batch_job_definition
batch_job_queue
cloudfront_distribution_info
cloudfront_invalidation
cloudfront_origin_access_identity
cloudwatchevent_rule
data_pipeline
directconnect_confirm_connection
directconnect_connection
Expand All @@ -17,7 +16,6 @@ directconnect_link_aggregation_group
directconnect_virtual_interface
dynamodb_ttl
ec2_ami_copy
ec2_asg_lifecycle_hook
ec2_customer_gateway
ec2_customer_gateway_info
ec2_snapshot_copy
Expand Down
2 changes: 1 addition & 1 deletion tests/sanity/ignore-2.11.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
plugins/modules/cloudfront_info.py pylint:unnecessary-comprehension # (new test) Should be an easy fix, but testing is a challenge - test are broken and aliases require a wildcard cert in ACM
plugins/modules/cloudfront_distribution_info.py pylint:unnecessary-comprehension # (new test) Should be an easy fix, but testing is a challenge - test are broken and aliases require a wildcard cert in ACM
plugins/modules/route53.py validate-modules:parameter-state-invalid-choice # route53_info needs improvements before we can deprecate this
2 changes: 1 addition & 1 deletion tests/sanity/ignore-2.12.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
plugins/modules/cloudfront_info.py pylint:unnecessary-comprehension # (new test) Should be an easy fix, but testing is a challenge - test are broken and aliases require a wildcard cert in ACM
plugins/modules/cloudfront_distribution_info.py pylint:unnecessary-comprehension # (new test) Should be an easy fix, but testing is a challenge - test are broken and aliases require a wildcard cert in ACM
plugins/modules/route53.py validate-modules:parameter-state-invalid-choice # route53_info needs improvements before we can deprecate this
2 changes: 1 addition & 1 deletion tests/sanity/ignore-2.13.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
plugins/modules/cloudfront_info.py pylint:unnecessary-comprehension # (new test) Should be an easy fix, but testing is a challenge - test are broken and aliases require a wildcard cert in ACM
plugins/modules/cloudfront_distribution_info.py pylint:unnecessary-comprehension # (new test) Should be an easy fix, but testing is a challenge - test are broken and aliases require a wildcard cert in ACM
plugins/modules/route53.py validate-modules:parameter-state-invalid-choice # route53_info needs improvements before we can deprecate this
2 changes: 1 addition & 1 deletion tests/sanity/ignore-2.14.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
plugins/modules/cloudfront_info.py pylint:unnecessary-comprehension # (new test) Should be an easy fix, but testing is a challenge - test are broken and aliases require a wildcard cert in ACM
plugins/modules/cloudfront_distribution_info.py pylint:unnecessary-comprehension # (new test) Should be an easy fix, but testing is a challenge - test are broken and aliases require a wildcard cert in ACM
plugins/modules/route53.py validate-modules:parameter-state-invalid-choice # route53_info needs improvements before we can deprecate this

0 comments on commit 354a287

Please sign in to comment.