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

Formally start the ec2 deprecation process #424

Merged
merged 1 commit into from
Aug 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelogs/fragments/424-deprecate-ec2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
deprecated_features:
- ec2 - the boto based ``ec2`` module has been deprecated in favour of the boto3 based ``ec2_instance`` module.
The ``ec2`` module will be removed in release 4.0.0 (https://github.com/ansible-collections/amazon.aws/pull/424).
7 changes: 7 additions & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ plugin_routing:
The cloudformation_info module returns the same information, but
not as ansible_facts. See the module documentation for more
information.
ec2:
deprecation:
removal_version: 4.0.0
warning_text: >-
The ec2 module is based upon a deprecated version of the AWS SDKs
and is deprecated in favor of the ec2_instance module.
Please update your tasks.
ec2_ami_facts:
deprecation:
removal_date: 2021-12-01
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
module: ec2
version_added: 1.0.0
short_description: create, terminate, start or stop an instance in ec2
deprecated:
removed_in: 4.0.0
why: The ec2 module is based upon a deprecated version of the AWS SDK.
alternative: Use M(ec2_instance).
description:
- Creates or terminates ec2 instances.
- >
Expand Down Expand Up @@ -1959,6 +1963,9 @@ def main():
],
)

module.deprecate("The 'ec2' module has been deprecated and replaced by the 'ec2_instance' module'",
version='4.0.0', collection_name='amazon.aws')

if module.params.get('group') and module.params.get('group_id'):
module.deprecate(
msg='Support for passing both group and group_id has been deprecated. '
Expand Down
4 changes: 3 additions & 1 deletion tests/sanity/ignore-2.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ plugins/modules/ec2.py import-3.6!skip
plugins/modules/ec2.py import-3.7!skip
plugins/modules/ec2.py metaclass-boilerplate!skip
plugins/modules/ec2.py pylint:ansible-deprecated-no-version # We use dates for deprecations, Ansible 2.9 only supports this for compatability
plugins/modules/ec2.py validate-modules:deprecation-mismatch # Ansible 2.9 docs don't support deprecation properly
plugins/modules/ec2.py validate-modules:invalid-documentation # Ansible 2.9 docs don't support deprecation properly
plugins/modules/ec2_ami.py compile-2.6!skip
plugins/modules/ec2_ami.py compile-2.7!skip
plugins/modules/ec2_ami.py compile-3.5!skip
Expand Down Expand Up @@ -389,4 +391,4 @@ plugins/modules/s3_bucket.py import-3.5!skip
plugins/modules/s3_bucket.py import-3.6!skip
plugins/modules/s3_bucket.py import-3.7!skip
plugins/modules/s3_bucket.py metaclass-boilerplate!skip
tests/sanity/refresh_ignore_files shebang!skip
tests/sanity/refresh_ignore_files shebang!skip