Skip to content

Commit

Permalink
Adding undo, numeric and template inject features
Browse files Browse the repository at this point in the history
  • Loading branch information
ljacobsson committed Aug 22, 2020
1 parent 63661e5 commit f929bdd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/template-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@ async function injectPattern(pattern) {
: YAML.stringify(template)
);
}
if (resource.value.Type === "AWS::Events::Rule") {
const eventBus = await inputUtil.getEventBusName(new AWS.EventBridge());
if (!resource.value.Properties) {
resource.value.Properties = {};
}
resource.value.Properties.EventPattern = pattern
resource.value.Properties.EventBusName = eventBus
template.Resources[resource.name] = resource.value;
fs.writeFileSync(
templatePath,
format === "json"
? JSON.stringify(template, null, 2)
: YAML.stringify(template)
);
}
}

module.exports = {
Expand Down

0 comments on commit f929bdd

Please sign in to comment.