-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verify hook handler with extraneous fields (#431)
* Verify that handler can handle input with extraneous fields
- Loading branch information
1 parent
53ab291
commit 5b354cf
Showing
5 changed files
with
286 additions
and
5 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
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
62 changes: 62 additions & 0 deletions
62
...formation/data/hook/preCreate.request.with-resource-properties-and-extraneous-fields.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,62 @@ | ||
{ | ||
"clientRequestToken": "123456", | ||
"awsAccountId": "123456789012", | ||
"stackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/SampleStack/e722ae60-fe62-11e8-9a0e-0ae8cc519968", | ||
"changeSetId": "arn:aws:cloudformation:us-east-1:123456789012:changeSet/SampleChangeSet-conditional/1a2345b6-0000-00a0-a123-00abc0abc000", | ||
"hookTypeName": "AWS::Test::TestModel", | ||
"hookTypeVersion": "1.0", | ||
"hookModel": { | ||
"property1": "abc", | ||
"property2": 123 | ||
}, | ||
"actionInvocationPoint": "CREATE_PRE_PROVISION", | ||
"requestData": { | ||
"targetName": "AWS::Example::ResourceTarget", | ||
"targetType": "RESOURCE", | ||
"targetLogicalId": "myResource", | ||
"targetModel": { | ||
"resourceProperties": { | ||
"BucketName": "someBucketName", | ||
"BucketEncryption": { | ||
"ServerSideEncryptionConfiguration": [ | ||
{ | ||
"BucketKeyEnabled": true, | ||
"ServerSideEncryptionByDefault": { | ||
"SSEAlgorithm": "aws:kms", | ||
"KMSMasterKeyID": "someKMSMasterKeyID" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"previousResourceProperties": null | ||
}, | ||
"callerCredentials": "callerCredentials", | ||
"providerCredentials": "providerCredentials", | ||
"providerLogGroupName": "providerLoggingGroupName", | ||
"hookEncryptionKeyArn": "hookEncryptionKeyArn", | ||
"hookEncryptionKeyRole": "hookEncryptionKeyRole" | ||
}, | ||
"targetName": "STACK", | ||
"template": "<Original json template as string>", | ||
"previousTemplate": "<Original json template as string>", | ||
"changedResources": [ | ||
{ | ||
"logicalId": "MyBucket", | ||
"typeName": "AWS::S3::Bucket", | ||
"lineNumber": 3, | ||
"action": "CREATE", | ||
"beforeContext": "<Resource Properties as json string>", | ||
"afterContext": "<Resource Properties as json string>" | ||
}, | ||
{ | ||
"logicalId": "MyBucketPolicy", | ||
"typeName": "AWS::S3::BucketPolicy", | ||
"lineNumber": 15, | ||
"action": "CREATE", | ||
"beforeContext": "<Resource Properties as json string>", | ||
"afterContext": "<Resource Properties as json string>" | ||
} | ||
], | ||
"requestContext": {} | ||
} |
41 changes: 41 additions & 0 deletions
41
.../software/amazon/cloudformation/data/hook/preCreate.request.with-resource-properties.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,41 @@ | ||
{ | ||
"clientRequestToken": "123456", | ||
"awsAccountId": "123456789012", | ||
"stackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/SampleStack/e722ae60-fe62-11e8-9a0e-0ae8cc519968", | ||
"changeSetId": "arn:aws:cloudformation:us-east-1:123456789012:changeSet/SampleChangeSet-conditional/1a2345b6-0000-00a0-a123-00abc0abc000", | ||
"hookTypeName": "AWS::Test::TestModel", | ||
"hookTypeVersion": "1.0", | ||
"hookModel": { | ||
"property1": "abc", | ||
"property2": 123 | ||
}, | ||
"actionInvocationPoint": "CREATE_PRE_PROVISION", | ||
"requestData": { | ||
"targetName": "AWS::Example::ResourceTarget", | ||
"targetType": "RESOURCE", | ||
"targetLogicalId": "myResource", | ||
"targetModel": { | ||
"resourceProperties": { | ||
"BucketName": "someBucketName", | ||
"BucketEncryption": { | ||
"ServerSideEncryptionConfiguration": [ | ||
{ | ||
"BucketKeyEnabled": true, | ||
"ServerSideEncryptionByDefault": { | ||
"SSEAlgorithm": "aws:kms", | ||
"KMSMasterKeyID": "someKMSMasterKeyID" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"previousResourceProperties": null | ||
}, | ||
"callerCredentials": "callerCredentials", | ||
"providerCredentials": "providerCredentials", | ||
"providerLogGroupName": "providerLoggingGroupName", | ||
"hookEncryptionKeyArn": "hookEncryptionKeyArn", | ||
"hookEncryptionKeyRole": "hookEncryptionKeyRole" | ||
}, | ||
"requestContext": {} | ||
} |