Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aws - lambda-layer - cross-account ignore layers with no policies (#6827
- Loading branch information
Showing
8 changed files
with
84 additions
and
75 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
17 changes: 3 additions & 14 deletions
17
tests/data/placebo/test_lambda_layer_cross_account/lambda.GetLayerVersionPolicy_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 |
---|---|---|
@@ -1,19 +1,8 @@ | ||
{ | ||
"status_code": 200, | ||
"data": { | ||
"ResponseMetadata": { | ||
"RequestId": "3aa70f82-02af-11e9-8f13-8b7358831acf", | ||
"HTTPStatusCode": 200, | ||
"HTTPHeaders": { | ||
"date": "Tue, 18 Dec 2018 10:25:23 GMT", | ||
"content-type": "application/json", | ||
"content-length": "295", | ||
"connection": "keep-alive", | ||
"x-amzn-requestid": "3aa70f82-02af-11e9-8f13-8b7358831acf" | ||
}, | ||
"RetryAttempts": 0 | ||
}, | ||
"Policy": "{\"Version\":\"2012-10-17\",\"Id\":\"default\",\"Statement\":[{\"Sid\":\"Grant\",\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"lambda:GetLayerVersion\",\"Resource\":\"arn:aws:lambda:us-east-1:644160558196:layer:test:2\"}]}", | ||
"RevisionId": "dc14c754-0f12-49cb-b263-95dd45f45bd3" | ||
"ResponseMetadata": {}, | ||
"Policy": "{\"Version\":\"2012-10-17\",\"Id\":\"default\",\"Statement\":[{\"Sid\":\"xaccount2\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789123:root\"},\"Action\":\"lambda:GetLayerVersion\",\"Resource\":\"arn:aws:lambda:us-east-1:644160558196:layer:c7n-botocore1-20-33-boto31-17-33:1\"}]}", | ||
"RevisionId": "23d7f01d-6216-49c4-8eb4-c395afcfb47d" | ||
} | ||
} |
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
12 changes: 12 additions & 0 deletions
12
tests/data/placebo/test_lambda_layer_cross_account/lambda.GetLayerVersionPolicy_3.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,12 @@ | ||
{ | ||
"status_code": 404, | ||
"data": { | ||
"Error": { | ||
"Message": "Layer version arn:aws:lambda:us-east-1:644160558196:layer:c7n-botocore1-20-33-boto31-17-33:1 does not have any resource policy.", | ||
"Code": "ResourceNotFoundException" | ||
}, | ||
"ResponseMetadata": {}, | ||
"Type": "User", | ||
"Message": "Layer version arn:aws:lambda:us-east-1:644160558196:layer:c7n-botocore1-20-33-boto31-17-33:1 does not have any resource policy." | ||
} | ||
} |
26 changes: 11 additions & 15 deletions
26
tests/data/placebo/test_lambda_layer_cross_account/lambda.ListLayerVersions_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
17 changes: 17 additions & 0 deletions
17
tests/data/placebo/test_lambda_layer_cross_account/lambda.ListLayerVersions_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,17 @@ | ||
{ | ||
"status_code": 200, | ||
"data": { | ||
"ResponseMetadata": {}, | ||
"LayerVersions": [ | ||
{ | ||
"LayerVersionArn": "arn:aws:lambda:us-east-1:644160558196:layer:c7n-test:1", | ||
"Version": 1, | ||
"Description": "second test layer", | ||
"CreatedDate": "2021-07-28T17:51:31.295+0000", | ||
"CompatibleRuntimes": [ | ||
"python3.8" | ||
] | ||
} | ||
] | ||
} | ||
} |
43 changes: 26 additions & 17 deletions
43
tests/data/placebo/test_lambda_layer_cross_account/lambda.ListLayers_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
12 changes: 1 addition & 11 deletions
12
...s/data/placebo/test_lambda_layer_cross_account/lambda.RemoveLayerVersionPermission_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 |
---|---|---|
@@ -1,16 +1,6 @@ | ||
{ | ||
"status_code": 204, | ||
"data": { | ||
"ResponseMetadata": { | ||
"RequestId": "3ab519af-02af-11e9-b4a7-053d0d22210b", | ||
"HTTPStatusCode": 204, | ||
"HTTPHeaders": { | ||
"date": "Tue, 18 Dec 2018 10:25:23 GMT", | ||
"content-type": "application/json", | ||
"connection": "keep-alive", | ||
"x-amzn-requestid": "3ab519af-02af-11e9-b4a7-053d0d22210b" | ||
}, | ||
"RetryAttempts": 0 | ||
} | ||
"ResponseMetadata": {} | ||
} | ||
} |