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

Feat/s3 public access block #12

Merged
merged 13 commits into from
Sep 3, 2020
Merged

Conversation

OlafConijn
Copy link
Member

what do you think about:

  • ./src/common.ts?
  • behavior on delete. regardless of what what was configured before it will be set to all false.... does that make sense?

Copy link
Member

@eduardomourar eduardomourar left a comment

Choose a reason for hiding this comment

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

If you run the contract test from CFN CLI, the delete will fail if you can still retrieve the resource afterwards: https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract.html

s3/public-access-block/src/handlers.ts Outdated Show resolved Hide resolved
s3/public-access-block/src/handlers.ts Outdated Show resolved Hide resolved
s3/public-access-block/src/handlers.ts Outdated Show resolved Hide resolved
s3/public-access-block/community-s3-publicaccessblock.json Outdated Show resolved Hide resolved
s3/public-access-block/src/handlers.ts Outdated Show resolved Hide resolved
s3/public-access-block/src/handlers.ts Outdated Show resolved Hide resolved
Copy link
Member

@eduardomourar eduardomourar left a comment

Choose a reason for hiding this comment

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

with the changes suggested, I am happy with the contract test results:

handler_create.py::contract_create_delete PASSED                                                                                                         [  7%]
handler_create.py::contract_invalid_create FAILED                                                                                                        [ 15%]
handler_create.py::contract_create_duplicate SKIPPED                                                                                                     [ 23%]
handler_create.py::contract_create_read_success PASSED                                                                                                   [ 30%]
handler_delete.py::contract_delete_read PASSED                                                                                                           [ 38%]
handler_delete.py::contract_delete_update FAILED                                                                                                         [ 46%]
handler_delete.py::contract_delete_delete FAILED                                                                                                         [ 53%]
handler_delete.py::contract_delete_create SKIPPED                                                                                                        [ 61%]
handler_misc.py::contract_check_asserts_work PASSED                                                                                                      [ 69%]
handler_read.py::contract_read_without_create PASSED                                                                                                     [ 76%]
handler_update.py::contract_update_read_success PASSED                                                                                                   [ 84%]
handler_update_invalid.py::contract_update_create_only_property SKIPPED                                                                                  [ 92%]
handler_update_invalid.py::contract_update_non_existent_resource FAILED                                                                                  [100%]
=================================================================== short test summary info ====================================================================
FAILED handler_create.py::contract_invalid_create - AssertionError: status should be FAILED
FAILED handler_delete.py::contract_delete_update - AssertionError: status should be FAILED
FAILED handler_delete.py::contract_delete_delete - AssertionError: status should be FAILED
FAILED handler_update_invalid.py::contract_update_non_existent_resource - AssertionError: status should be FAILED
========================================= 4 failed, 6 passed, 3 skipped, 3 deselected, 9 warnings in 79.60s (0:01:19) ==========================================

s3/public-access-block/community-s3-publicaccessblock.json Outdated Show resolved Hide resolved
s3/public-access-block/src/common.ts Outdated Show resolved Hide resolved
s3/public-access-block/src/handlers.ts Outdated Show resolved Hide resolved
s3/public-access-block/src/common.ts Outdated Show resolved Hide resolved
s3/public-access-block/src/handlers.ts Show resolved Hide resolved
s3/public-access-block/src/handlers.ts Outdated Show resolved Hide resolved
@eduardomourar
Copy link
Member

i have tested multiple scenarios (with and without pre-existing resource) using the resource itself based on the example and everything is working as expected:

  1. create
  2. update (single or multiple properties)
  3. delete

we are able to start managing the resource even if they are already there (just like we discussed)

@OlafConijn OlafConijn merged commit 35891d0 into master Sep 3, 2020
@OlafConijn OlafConijn deleted the feat/s3-public-access-block branch September 3, 2020 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants