The cloudformation
mock is used to simulate CloudFormation
events. To create a CloudFormation event, use the cloudformation()
builder:
const lambdaEventMock = require( 'lambda-event-mock' );
let myMock = lambdaEventMock.cloudformation()
.stackId( 'arn:aws:cloudformation:us-east-2:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896' )
.responseURL( 'http://pre-signed-S3-url-for-response' )
.resourceType( 'AWS::S3::Bucket' )
.resourceProperty( 'StackName', 'myteststack' )
.logicalResourceId( 'S3Bucket' )
.build();
/* myMock will be:
{
"StackId": "arn:aws:cloudformation:us-east-2:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896",
"ResponseURL": "http://pre-signed-S3-url-for-response",
"ResourceProperties": {
"StackName": "myteststack"
},
"RequestType": "Create",
"ResourceType": "AWS::S3::Bucket",
"RequestId": "unique id for this create request",
"LogicalResourceId": "S3Bucket"
}
*/
Sets the StackId
property
Sets the ResponseURL
property
Sets the ResourceType
property
Adds a single resource property to the ResourceProperties
object
Sets one or more values of the ResourceProperties
object