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

aws_kms: Support setting PendingWindowInDays (Deletion Delay) and fix tests #200

Merged
merged 19 commits into from
Feb 10, 2021

Conversation

tremble
Copy link
Contributor

@tremble tremble commented Aug 24, 2020

SUMMARY

Adds support for setting pending_window (the number of days a CMK will sit waiting to be deleted.
Fixes failures when we don't have the GetKeyRotationStatus permission
Fixes integration tests and marks them supported

ISSUE TYPE
  • Bugfix Pull Request
  • Feature Pull Request
COMPONENT NAME

aws_kms

ADDITIONAL INFORMATION

Writing tests for #199 highlighted that aws_kms also handled missing 'Get' permissions poorly, follow up and handle them better.

Pending mattclay/aws-terminator#106 for CI permissions

@ansibullbot
Copy link

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

plugins/modules/packaging/os/apt_rpm.py:0:0: doc-elements-mismatch: Argument 'package' in argument_spec specifies elements as str,but elements is not documented

click here for bot help

@ansibullbot
Copy link

@ansibullbot ansibullbot added affects_2.10 bug This issue/PR relates to a bug has_issue integration tests/integration module module needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR needs_triage plugins plugin (any type) stale_ci CI is older than 7 days, rerun before merging tests tests labels Aug 27, 2020
@ansibullbot ansibullbot removed the stale_ci CI is older than 7 days, rerun before merging label Sep 22, 2020
@tremble tremble changed the title aws_kms: Support setting PendingWindowInDays (Deletion Delay) and fix tests [Pending CI Policy] [Pending CI Policy] aws_kms: Support setting PendingWindowInDays (Deletion Delay) and fix tests Oct 23, 2020
@ansibullbot ansibullbot added the stale_ci CI is older than 7 days, rerun before merging label Nov 16, 2020
@tremble tremble changed the title [Pending CI Policy] aws_kms: Support setting PendingWindowInDays (Deletion Delay) and fix tests aws_kms: Support setting PendingWindowInDays (Deletion Delay) and fix tests Nov 25, 2020
@tremble tremble force-pushed the aws_kms/deletion_delay branch 3 times, most recently from f249322 to e1ed61b Compare November 27, 2020 12:35
@tremble tremble requested a review from jillr November 27, 2020 16:40
@tremble
Copy link
Contributor Author

tremble commented Nov 27, 2020

@jillr I've got this one running under CI now. Some minor bugs needed fixing.

There's some instability in the tests, which seem to be related to doing things like re-updating policies quickly after an update. I think the value of getting these tests in place outweighs waiting until we've ironed all of the flakes out, so I've marked the tests 'unstable' so they're at least run when someone submits a KMS change.

@ansibullbot ansibullbot added community_review and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Jan 13, 2021
@tremble tremble removed the stale_ci CI is older than 7 days, rerun before merging label Feb 10, 2021
Copy link
Collaborator

@jillr jillr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All uses of version_added should now be 1.4.0, otherwise lgtm

plugins/modules/aws_kms.py Outdated Show resolved Hide resolved
plugins/modules/aws_kms_info.py Outdated Show resolved Hide resolved
plugins/modules/aws_kms_info.py Outdated Show resolved Hide resolved
@jillr jillr merged commit 71cfad2 into ansible-collections:main Feb 10, 2021
@tremble tremble deleted the aws_kms/deletion_delay branch February 11, 2021 09:05
ethemcemozkan pushed a commit to ethemcemozkan/community.aws that referenced this pull request Feb 18, 2021
… tests (ansible-collections#200)

* Ensure we can still update / delete KMS keys when we can't access the key rotation status

* Fix and enable KMS tests

* Add support for setting the deletion schedule window

* Ignore failures during cleanup

* changelog

* Change role name to match those permitted by CI policies

* Split imports - easier to rebase

* Make sure key rotation enable/disable errors don't drop through to main()

* Allow STS principals as well as IAM principals

* Add support for direct lookup by alias/id
Use it in test suite (filters are done client side and are SLOW)

* Ensure we don't throw an exception when a tag doesn't exist

* Add docs

* changelog

* Flag aws_kms tests as unstable

* lint fixups

* Consistently handle 'UnsupportedOperationException' on key rotation

* Update version added

* Allow a little flexibility for deletion times

* Update version_added
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 19, 2021
… tests (ansible-collections#200)

* Ensure we can still update / delete KMS keys when we can't access the key rotation status

* Fix and enable KMS tests

* Add support for setting the deletion schedule window

* Ignore failures during cleanup

* changelog

* Change role name to match those permitted by CI policies

* Split imports - easier to rebase

* Make sure key rotation enable/disable errors don't drop through to main()

* Allow STS principals as well as IAM principals

* Add support for direct lookup by alias/id
Use it in test suite (filters are done client side and are SLOW)

* Ensure we don't throw an exception when a tag doesn't exist

* Add docs

* changelog

* Flag aws_kms tests as unstable

* lint fixups

* Consistently handle 'UnsupportedOperationException' on key rotation

* Update version added

* Allow a little flexibility for deletion times

* Update version_added
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 19, 2021
… tests (ansible-collections#200)

* Ensure we can still update / delete KMS keys when we can't access the key rotation status

* Fix and enable KMS tests

* Add support for setting the deletion schedule window

* Ignore failures during cleanup

* changelog

* Change role name to match those permitted by CI policies

* Split imports - easier to rebase

* Make sure key rotation enable/disable errors don't drop through to main()

* Allow STS principals as well as IAM principals

* Add support for direct lookup by alias/id
Use it in test suite (filters are done client side and are SLOW)

* Ensure we don't throw an exception when a tag doesn't exist

* Add docs

* changelog

* Flag aws_kms tests as unstable

* lint fixups

* Consistently handle 'UnsupportedOperationException' on key rotation

* Update version added

* Allow a little flexibility for deletion times

* Update version_added
danielcotton pushed a commit to danielcotton/community.aws that referenced this pull request Nov 23, 2021
… tests (ansible-collections#200)

* Ensure we can still update / delete KMS keys when we can't access the key rotation status

* Fix and enable KMS tests

* Add support for setting the deletion schedule window

* Ignore failures during cleanup

* changelog

* Change role name to match those permitted by CI policies

* Split imports - easier to rebase

* Make sure key rotation enable/disable errors don't drop through to main()

* Allow STS principals as well as IAM principals

* Add support for direct lookup by alias/id
Use it in test suite (filters are done client side and are SLOW)

* Ensure we don't throw an exception when a tag doesn't exist

* Add docs

* changelog

* Flag aws_kms tests as unstable

* lint fixups

* Consistently handle 'UnsupportedOperationException' on key rotation

* Update version added

* Allow a little flexibility for deletion times

* Update version_added
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.10 bug This issue/PR relates to a bug community_review has_issue integration tests/integration module module needs_triage plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants