Skip to content

Commit

Permalink
ec2_vpc_endpoint - deprecate policy_file (ansible-collections#366)
Browse files Browse the repository at this point in the history
* deprecate policy_file

* ignore file

* changelog
  • Loading branch information
tremble authored and danielcotton committed Nov 23, 2021
1 parent 0665b1b commit d255146
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/366-ec2_vpc_endpoint-policy_file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
deprecated_features:
- ec2_vpc_endpoint - deprecate the policy_file option and recommend using policy with a lookup (https://github.com/ansible-collections/community.aws/pull/366).
8 changes: 8 additions & 0 deletions plugins/modules/ec2_vpc_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
on how to use it properly. Cannot be used with I(policy).
- Option when creating an endpoint. If not provided AWS will
utilise a default policy which provides full access to the service.
- This option has been deprecated and will be removed after 2022-12-01
to maintain the existing functionality please use the I(policy) option
and a file lookup.
required: false
aliases: [ "policy_path" ]
type: path
Expand Down Expand Up @@ -346,6 +349,11 @@ def main():
# Validate Requirements
state = module.params.get('state')

if module.params.get('policy_file'):
module.deprecate('The policy_file option has been deprecated and'
' will be removed after 2022-12-01',
date='2022-12-01', collection_name='community.aws')

try:
ec2 = module.client('ec2')
except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
Expand Down
1 change: 1 addition & 0 deletions tests/sanity/ignore-2.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ plugins/modules/ec2_instance_info.py pylint:ansible-deprecated-no-version
plugins/modules/ec2_lc_info.py pylint:ansible-deprecated-no-version
plugins/modules/ec2_metric_alarm.py pylint:ansible-deprecated-no-version
plugins/modules/ec2_placement_group_info.py pylint:ansible-deprecated-no-version
plugins/modules/ec2_vpc_endpoint.py pylint:ansible-deprecated-no-version
plugins/modules/ec2_vpc_endpoint_info.py pylint:ansible-deprecated-no-version
plugins/modules/ec2_vpc_igw_info.py pylint:ansible-deprecated-no-version
plugins/modules/ec2_vpc_nacl_info.py pylint:ansible-deprecated-no-version
Expand Down

0 comments on commit d255146

Please sign in to comment.