-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move KMS validation for SSESpecification on Tables (#3700)
* Remove rule E3640 and move to standard schemas
- Loading branch information
Showing
11 changed files
with
161 additions
and
51 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
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
20 changes: 0 additions & 20 deletions
20
src/cfnlint/data/schemas/extensions/aws_dynamodb_table/ssespecification_kms.json
This file was deleted.
Oops, something went wrong.
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
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
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 |
---|---|---|
|
@@ -421,6 +421,10 @@ | |
"type": "boolean" | ||
}, | ||
"SSEType": { | ||
"enum": [ | ||
"AES256", | ||
"KMS" | ||
], | ||
"type": "string" | ||
} | ||
}, | ||
|
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
31 changes: 0 additions & 31 deletions
31
src/cfnlint/rules/resources/dynamodb/TableSseSpecification.py
This file was deleted.
Oops, something went wrong.
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,61 @@ | ||
[ | ||
{ | ||
"Filename": "test/fixtures/templates/integration/aws-dynamodb-table.yaml", | ||
"Id": "9853e961-d150-10b3-4728-32a621c7fbf6", | ||
"Level": "Error", | ||
"Location": { | ||
"End": { | ||
"ColumnNumber": 23, | ||
"LineNumber": 22 | ||
}, | ||
"Path": [ | ||
"Resources", | ||
"Table1", | ||
"Properties", | ||
"SSESpecification" | ||
], | ||
"Start": { | ||
"ColumnNumber": 7, | ||
"LineNumber": 22 | ||
} | ||
}, | ||
"Message": "'SSEType' is a dependency of 'KMSMasterKeyId'", | ||
"ParentId": null, | ||
"Rule": { | ||
"Description": "When certain properties are specified it results in other properties to be required", | ||
"Id": "E3021", | ||
"ShortDescription": "Validate that when a property is specified that other properties should be included", | ||
"Source": "https://github.com/aws-cloudformation/cfn-lint/blob/main/docs/cfn-schema-specification.md#dependentrequired" | ||
} | ||
}, | ||
{ | ||
"Filename": "test/fixtures/templates/integration/aws-dynamodb-table.yaml", | ||
"Id": "ecae4565-1f41-0f11-949a-c27038ed5a02", | ||
"Level": "Error", | ||
"Location": { | ||
"End": { | ||
"ColumnNumber": 16, | ||
"LineNumber": 44 | ||
}, | ||
"Path": [ | ||
"Resources", | ||
"Table2", | ||
"Properties", | ||
"SSESpecification", | ||
"SSEType" | ||
], | ||
"Start": { | ||
"ColumnNumber": 9, | ||
"LineNumber": 44 | ||
} | ||
}, | ||
"Message": "'AES256' is not one of ['KMS']", | ||
"ParentId": null, | ||
"Rule": { | ||
"Description": "Check if properties have a valid value in case of an enumator", | ||
"Id": "E3030", | ||
"ShortDescription": "Check if properties have a valid value", | ||
"Source": "https://github.com/aws-cloudformation/cfn-lint/blob/main/docs/cfn-schema-specification.md#enum" | ||
} | ||
} | ||
] |
44 changes: 44 additions & 0 deletions
44
test/fixtures/templates/integration/aws-dynamodb-table.yaml
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,44 @@ | ||
|
||
Resources: | ||
KMS: | ||
Type: AWS::KMS::Key | ||
UpdateReplacePolicy: Retain | ||
DeletionPolicy: Retain | ||
Table1: | ||
UpdateReplacePolicy: Retain | ||
DeletionPolicy: Retain | ||
Type: AWS::DynamoDB::Table | ||
Properties: | ||
TableName: table1 | ||
AttributeDefinitions: | ||
- AttributeName: id | ||
AttributeType: S | ||
KeySchema: | ||
- AttributeName: id | ||
KeyType: HASH | ||
ProvisionedThroughput: | ||
ReadCapacityUnits: 1 | ||
WriteCapacityUnits: 1 | ||
SSESpecification: | ||
KMSMasterKeyId: !GetAtt KMS.Arn | ||
SSEEnabled: true | ||
# SSEType: KMS # to provide an error | ||
Table2: | ||
UpdateReplacePolicy: Retain | ||
DeletionPolicy: Retain | ||
Type: AWS::DynamoDB::Table | ||
Properties: | ||
TableName: table2 | ||
AttributeDefinitions: | ||
- AttributeName: id | ||
AttributeType: S | ||
KeySchema: | ||
- AttributeName: id | ||
KeyType: HASH | ||
ProvisionedThroughput: | ||
ReadCapacityUnits: 1 | ||
WriteCapacityUnits: 1 | ||
SSESpecification: | ||
KMSMasterKeyId: !GetAtt KMS.Arn | ||
SSEEnabled: true | ||
SSEType: AES256 |
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