forked from cloud-custodian/cloud-custodian
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aws - dynamodb cross-account and has-statement (cloud-custodian#9731)
- Loading branch information
1 parent
192b067
commit 6ba8855
Showing
12 changed files
with
298 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
tests/data/placebo/test_dynamodb_cross_account_filter/dynamodb.DescribeTable_1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"status_code": 200, | ||
"data": { | ||
"Table": { | ||
"AttributeDefinitions": [ | ||
{ | ||
"AttributeName": "test", | ||
"AttributeType": "S" | ||
} | ||
], | ||
"TableName": "c7n-cross-account", | ||
"KeySchema": [ | ||
{ | ||
"AttributeName": "test", | ||
"KeyType": "HASH" | ||
} | ||
], | ||
"TableStatus": "ACTIVE", | ||
"CreationDateTime": { | ||
"__class__": "datetime", | ||
"year": 2024, | ||
"month": 9, | ||
"day": 18, | ||
"hour": 10, | ||
"minute": 25, | ||
"second": 35, | ||
"microsecond": 60000 | ||
}, | ||
"ProvisionedThroughput": { | ||
"NumberOfDecreasesToday": 0, | ||
"ReadCapacityUnits": 1, | ||
"WriteCapacityUnits": 1 | ||
}, | ||
"TableSizeBytes": 0, | ||
"ItemCount": 0, | ||
"TableArn": "arn:aws:dynamodb:us-east-1:123456789012:table/c7n-cross-account", | ||
"TableId": "491eb9f0-b783-491a-a832-9733abc3417e", | ||
"TableClassSummary": { | ||
"TableClass": "STANDARD" | ||
}, | ||
"DeletionProtectionEnabled": false | ||
}, | ||
"ResponseMetadata": {} | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
tests/data/placebo/test_dynamodb_cross_account_filter/dynamodb.DescribeTable_2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"status_code": 200, | ||
"data": { | ||
"Table": { | ||
"AttributeDefinitions": [ | ||
{ | ||
"AttributeName": "name", | ||
"AttributeType": "S" | ||
} | ||
], | ||
"TableName": "test-1", | ||
"KeySchema": [ | ||
{ | ||
"AttributeName": "name", | ||
"KeyType": "HASH" | ||
} | ||
], | ||
"TableStatus": "ACTIVE", | ||
"CreationDateTime": { | ||
"__class__": "datetime", | ||
"year": 2024, | ||
"month": 2, | ||
"day": 8, | ||
"hour": 16, | ||
"minute": 20, | ||
"second": 50, | ||
"microsecond": 43000 | ||
}, | ||
"ProvisionedThroughput": { | ||
"LastDecreaseDateTime": { | ||
"__class__": "datetime", | ||
"year": 2024, | ||
"month": 2, | ||
"day": 8, | ||
"hour": 16, | ||
"minute": 32, | ||
"second": 49, | ||
"microsecond": 707000 | ||
}, | ||
"NumberOfDecreasesToday": 0, | ||
"ReadCapacityUnits": 1, | ||
"WriteCapacityUnits": 1 | ||
}, | ||
"TableSizeBytes": 0, | ||
"ItemCount": 0, | ||
"TableArn": "arn:aws:dynamodb:us-east-1:123456789012:table/test-1", | ||
"TableId": "ce83b159-c233-4fc7-8617-9d544a0ad076", | ||
"TableClassSummary": { | ||
"TableClass": "STANDARD" | ||
}, | ||
"DeletionProtectionEnabled": false | ||
}, | ||
"ResponseMetadata": {} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
tests/data/placebo/test_dynamodb_cross_account_filter/dynamodb.GetResourcePolicy_1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"status_code": 200, | ||
"data": { | ||
"Policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Statement1\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::210987654321:root\"},\"Action\":\"dynamodb:BatchGetItem\",\"Resource\":\"arn:aws:dynamodb:us-east-1:123456789012:table/c7n-cross-account\"},{\"Sid\":\"Statement2\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:user/TestUser\"},\"Action\":\"dynamodb:*\",\"Resource\":\"arn:aws:dynamodb:us-east-1:644160558196:table/c7n-cross-account\"}]}", | ||
"RevisionId": "1726669535060", | ||
"ResponseMetadata": {} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/data/placebo/test_dynamodb_cross_account_filter/dynamodb.GetResourcePolicy_2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"status_code": 400, | ||
"data": { | ||
"Error": { | ||
"Message": "Resource-based policy not found for the provided ResourceArn: arn:aws:dynamodb:us-east-1:123456789012:table/test-1", | ||
"Code": "PolicyNotFoundException" | ||
}, | ||
"ResponseMetadata": {}, | ||
"message": "Resource-based policy not found for the provided ResourceArn: arn:aws:dynamodb:us-east-1:123456789012:table/test-1" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/data/placebo/test_dynamodb_cross_account_filter/dynamodb.ListTables_1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"status_code": 200, | ||
"data": { | ||
"TableNames": [ | ||
"c7n-cross-account", | ||
"test-1" | ||
], | ||
"ResponseMetadata": {} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
tests/data/placebo/test_dynamodb_cross_account_filter/tagging.GetResources_1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"status_code": 200, | ||
"data": { | ||
"PaginationToken": "", | ||
"ResourceTagMappingList": [], | ||
"ResponseMetadata": {} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
tests/data/placebo/test_dynamodb_has_statement_filter/dynamodb.DescribeTable_1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"status_code": 200, | ||
"data": { | ||
"Table": { | ||
"AttributeDefinitions": [ | ||
{ | ||
"AttributeName": "c7n", | ||
"AttributeType": "S" | ||
} | ||
], | ||
"TableName": "c7n-test", | ||
"KeySchema": [ | ||
{ | ||
"AttributeName": "c7n", | ||
"KeyType": "HASH" | ||
} | ||
], | ||
"TableStatus": "ACTIVE", | ||
"CreationDateTime": { | ||
"__class__": "datetime", | ||
"year": 2024, | ||
"month": 10, | ||
"day": 6, | ||
"hour": 12, | ||
"minute": 8, | ||
"second": 33, | ||
"microsecond": 300000 | ||
}, | ||
"ProvisionedThroughput": { | ||
"NumberOfDecreasesToday": 0, | ||
"ReadCapacityUnits": 1, | ||
"WriteCapacityUnits": 1 | ||
}, | ||
"TableSizeBytes": 0, | ||
"ItemCount": 0, | ||
"TableArn": "arn:aws:dynamodb:us-east-1:123456789012:table/c7n-test", | ||
"TableId": "ea7da970-2519-441a-a7ec-d15c58f1ffef", | ||
"TableClassSummary": { | ||
"TableClass": "STANDARD" | ||
}, | ||
"DeletionProtectionEnabled": false | ||
}, | ||
"ResponseMetadata": {} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
tests/data/placebo/test_dynamodb_has_statement_filter/dynamodb.GetResourcePolicy_1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"status_code": 200, | ||
"data": { | ||
"Policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Statement1\",\"Effect\":\"Deny\",\"Principal\":\"*\",\"Action\":\"dynamodb:*\",\"Resource\":\"arn:aws:dynamodb:us-east-1:123456789012:table/c7n-test\",\"Condition\":{\"Bool\":{\"aws:SecureTransport\":\"false\"}}}]}", | ||
"RevisionId": "1728230913300", | ||
"ResponseMetadata": {} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/data/placebo/test_dynamodb_has_statement_filter/dynamodb.ListTables_1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"status_code": 200, | ||
"data": { | ||
"TableNames": [ | ||
"c7n-test" | ||
], | ||
"ResponseMetadata": {} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
tests/data/placebo/test_dynamodb_has_statement_filter/tagging.GetResources_1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"status_code": 200, | ||
"data": { | ||
"PaginationToken": "", | ||
"ResourceTagMappingList": [], | ||
"ResponseMetadata": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters