Skip to content

Commit

Permalink
feat(cdk-v2): fixing assertion tests to work with both v1 and v2 (#370)
Browse files Browse the repository at this point in the history
* feat(cdk-v2): fixing assertion tests to work with both v1 and v2

* feat(cdk-v2): fixing assertion tests to work with both v1 and v2

* feat(cdk-v2): fixing assertion tests to work with both v1 and v2
  • Loading branch information
hnishar authored Sep 16, 2021
1 parent 0dbe295 commit c4c20e4
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 525 deletions.
2 changes: 1 addition & 1 deletion .viperlightignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ source/patterns/@aws-solutions-constructs/aws-lambda-sqs/test/integ.existingFunc
source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apigateway-sqs-crud.expected.json:201
source/tools/cdk-integ-tools/package-lock.json:373
source/patterns/@aws-solutions-constructs/core/test/step-function-helper.test.js:115
source/patterns/@aws-solutions-constructs/core/test/lambda-helper.test.ts:297
source/patterns/@aws-solutions-constructs/core/test/lambda-helper.test.ts:248
source/patterns/@aws-solutions-constructs/aws-dynamodb-stream-lambda/test/dynamodb-stream-lambda.test.ts:102
source/patterns/@aws-solutions-constructs/aws-dynamodbstreams-lambda/test/dynamodbstreams-lambda.test.ts:102
source/patterns/@aws-solutions-constructs/aws-iot-lambda-dynamodb/test/iot-lambda-dynamodb.test.ts:219
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,63 +213,6 @@ test('check the sns topic properties with existing KMS key', () => {
});

expect(stack).toHaveResource('AWS::KMS::Key', {
KeyPolicy: {
Statement: [
{
Action: [
"kms:Create*",
"kms:Describe*",
"kms:Enable*",
"kms:List*",
"kms:Put*",
"kms:Update*",
"kms:Revoke*",
"kms:Disable*",
"kms:Get*",
"kms:Delete*",
"kms:ScheduleKeyDeletion",
"kms:CancelKeyDeletion",
"kms:GenerateDataKey",
"kms:TagResource",
"kms:UntagResource"
],
Effect: "Allow",
Principal: {
AWS: {
"Fn::Join": [
"",
[
"arn:",
{
Ref: "AWS::Partition"
},
":iam::",
{
Ref: "AWS::AccountId"
},
":root"
]
]
}
},
Resource: "*"
},
{
Action: [
"kms:Decrypt",
"kms:Encrypt",
"kms:ReEncrypt*",
"kms:GenerateDataKey*"
],
Effect: "Allow",
Principal: {
Service: "events.amazonaws.com"
},
Resource: "*"
}
],
Version: "2012-10-17"
},
Description: "my-key",
EnableKeyRotation: true
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,63 +101,6 @@ test('check the sqs queue properties with existing KMS key', () => {
});

expect(stack).toHaveResource('AWS::KMS::Key', {
KeyPolicy: {
Statement: [
{
Action: [
"kms:Create*",
"kms:Describe*",
"kms:Enable*",
"kms:List*",
"kms:Put*",
"kms:Update*",
"kms:Revoke*",
"kms:Disable*",
"kms:Get*",
"kms:Delete*",
"kms:ScheduleKeyDeletion",
"kms:CancelKeyDeletion",
"kms:GenerateDataKey",
"kms:TagResource",
"kms:UntagResource"
],
Effect: "Allow",
Principal: {
AWS: {
"Fn::Join": [
"",
[
"arn:",
{
Ref: "AWS::Partition"
},
":iam::",
{
Ref: "AWS::AccountId"
},
":root"
]
]
}
},
Resource: "*"
},
{
Action: [
"kms:Decrypt",
"kms:Encrypt",
"kms:ReEncrypt*",
"kms:GenerateDataKey*"
],
Effect: "Allow",
Principal: {
Service: "events.amazonaws.com"
},
Resource: "*"
}
],
Version: "2012-10-17"
},
Description: "my-key",
EnableKeyRotation: true
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,63 +213,6 @@ test('check the sns topic properties with existing KMS key', () => {
});

expect(stack).toHaveResource('AWS::KMS::Key', {
KeyPolicy: {
Statement: [
{
Action: [
"kms:Create*",
"kms:Describe*",
"kms:Enable*",
"kms:List*",
"kms:Put*",
"kms:Update*",
"kms:Revoke*",
"kms:Disable*",
"kms:Get*",
"kms:Delete*",
"kms:ScheduleKeyDeletion",
"kms:CancelKeyDeletion",
"kms:GenerateDataKey",
"kms:TagResource",
"kms:UntagResource"
],
Effect: "Allow",
Principal: {
AWS: {
"Fn::Join": [
"",
[
"arn:",
{
Ref: "AWS::Partition"
},
":iam::",
{
Ref: "AWS::AccountId"
},
":root"
]
]
}
},
Resource: "*"
},
{
Action: [
"kms:Decrypt",
"kms:Encrypt",
"kms:ReEncrypt*",
"kms:GenerateDataKey*"
],
Effect: "Allow",
Principal: {
Service: "events.amazonaws.com"
},
Resource: "*"
}
],
Version: "2012-10-17"
},
Description: "my-key",
EnableKeyRotation: true
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,63 +101,6 @@ test('check the sqs queue properties with existing KMS key', () => {
});

expect(stack).toHaveResource('AWS::KMS::Key', {
KeyPolicy: {
Statement: [
{
Action: [
"kms:Create*",
"kms:Describe*",
"kms:Enable*",
"kms:List*",
"kms:Put*",
"kms:Update*",
"kms:Revoke*",
"kms:Disable*",
"kms:Get*",
"kms:Delete*",
"kms:ScheduleKeyDeletion",
"kms:CancelKeyDeletion",
"kms:GenerateDataKey",
"kms:TagResource",
"kms:UntagResource"
],
Effect: "Allow",
Principal: {
AWS: {
"Fn::Join": [
"",
[
"arn:",
{
Ref: "AWS::Partition"
},
":iam::",
{
Ref: "AWS::AccountId"
},
":root"
]
]
}
},
Resource: "*"
},
{
Action: [
"kms:Decrypt",
"kms:Encrypt",
"kms:ReEncrypt*",
"kms:GenerateDataKey*"
],
Effect: "Allow",
Principal: {
Service: "events.amazonaws.com"
},
Resource: "*"
}
],
Version: "2012-10-17"
},
Description: "my-key",
EnableKeyRotation: true
});
Expand Down
Loading

0 comments on commit c4c20e4

Please sign in to comment.