Skip to content

Commit

Permalink
TST: Update s3 bucket tests for latest cdk updates
Browse files Browse the repository at this point in the history
The cdk added PutBucketPolicy to their list of actions when creating
the cloudformation.
  • Loading branch information
greglucas committed Nov 10, 2023
1 parent 9fc788a commit 24b4814
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
8 changes: 6 additions & 2 deletions tests/infrastructure/test_backup_bucket_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def test_s3_config_bucket_resource_properties(template):
"UpdateReplacePolicy": "Delete",
},
)

template.has_resource_properties(
"AWS::S3::Bucket",
{
Expand Down Expand Up @@ -58,7 +57,12 @@ def test_s3_data_bucket_policy_resource_properties(template):
"Version": "2012-10-17",
"Statement": [
{
"Action": ["s3:GetBucket*", "s3:List*", "s3:DeleteObject*"],
"Action": [
"s3:PutBucketPolicy",
"s3:GetBucket*",
"s3:List*",
"s3:DeleteObject*",
],
"Effect": "Allow",
"Principal": {
"AWS": {
Expand Down
21 changes: 18 additions & 3 deletions tests/infrastructure/test_data_manager_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ def test_s3_data_bucket_policy_resource_properties(template):
"Version": "2012-10-17",
"Statement": [
{
"Action": ["s3:GetBucket*", "s3:List*", "s3:DeleteObject*"],
"Action": [
"s3:PutBucketPolicy",
"s3:GetBucket*",
"s3:List*",
"s3:DeleteObject*",
],
"Effect": "Allow",
"Principal": {
"AWS": {
Expand Down Expand Up @@ -172,7 +177,12 @@ def test_s3_config_bucket_policy_resource_properties(template):
"PolicyDocument": {
"Statement": [
{
"Action": ["s3:GetBucket*", "s3:List*", "s3:DeleteObject*"],
"Action": [
"s3:PutBucketPolicy",
"s3:GetBucket*",
"s3:List*",
"s3:DeleteObject*",
],
"Effect": "Allow",
"Principal": {
"AWS": {
Expand Down Expand Up @@ -224,7 +234,12 @@ def test_s3_snapshot_bucket_policy_resource_properties(template):
"PolicyDocument": {
"Statement": [
{
"Action": ["s3:GetBucket*", "s3:List*", "s3:DeleteObject*"],
"Action": [
"s3:PutBucketPolicy",
"s3:GetBucket*",
"s3:List*",
"s3:DeleteObject*",
],
"Effect": "Allow",
"Principal": {
"AWS": {
Expand Down

0 comments on commit 24b4814

Please sign in to comment.