Skip to content

Instantly share code, notes, and snippets.

@darko-mesaros
Last active July 28, 2020 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darko-mesaros/e029a1dabe4cc645dead6787b19f2bbd to your computer and use it in GitHub Desktop.
Save darko-mesaros/e029a1dabe4cc645dead6787b19f2bbd to your computer and use it in GitHub Desktop.
CDK - Testing bit of CodePipeline where we setup a testing stage to test CloudFormation templates with Lambda
// --- test stage and actions ---
const prepTestChanges = new codepipeline_actions.CloudFormationCreateReplaceChangeSetAction({
actionName: 'PrepTestChanges',
stackName: stageStackName,
changeSetName: stageChangeSetName,
adminPermissions: true,
parameterOverrides: {
"Environment": "STAGING",
"MinSize": "1",
"MaxSize": "2",
"InstanceType": "t2.micro"
},
templatePath: buildOutput.atPath('template.yml'),
templateConfiguration: buildOutput.atPath('template-config.json'),
runOrder: 1,
});
const executeTestChanges = new codepipeline_actions.CloudFormationExecuteChangeSetAction({
actionName: 'ExecuteTestChanges',
stackName: stageStackName,
changeSetName: stageChangeSetName,
runOrder: 2,
});
const lambdaTest = new codepipeline_actions.LambdaInvokeAction({
actionName: 'lambdaIntegTest',
lambda: integLambda,
userParameters: [stageStackName],
runOrder: 3,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment