Custom CloudFormation
One of Architect’s chief responsibilities is to generate a standard CloudFormation document for deployment to AWS. This infrastructure-as-code document is available to Architect plugins to mutate however you see fit.
deploy.start plugins
deploy.start plugins allow you to process and mutate Architect-generated CloudFormation prior to deployment. This enables deep customization of any Architect default behavior, as well as allowing apps to extend into the entire AWS ecosystem of services.
Architect @plugins are implemented as a Node.js CJS module with the following function signature:
// Do something only for staging deployments
module.exports = { deploy: {
start: async ({ arc, cloudformation, dryRun, inventory, stackName, stage }) => {
if (stage !== 'staging') return
let config = await getSomeConfig()
cloudformation.Resources.whatever = config
// The returned mutated CloudFormation document will be passed to any other `deploy.start` plugins in sequence
return cloudformation
}
} }
Additional resources
- Learn more about authoring
deploy.startplugins - Port existing
@macrosextensions todeploy.startplugins
Tip: preview generated CloudFormation without deploying by running
arc deploy --dry-runand viewingsam.json