@@ -4,7 +4,7 @@ category: Plugins
44description : ' <code>deploy</code> lifecycle hook plugins'
55---
66
7- ` deploy ` lifecycle hook plugins expose functionality to extend the capabilities of Architect deployments.
7+ ` deploy ` lifecycle hook plugins expose functionality to extend the capabilities of [ Architect deployments] ( ../../../cli/reference/deploy ) .
88
99
1010## Plugin parameters
@@ -14,9 +14,10 @@ All `deploy` methods accept async or synchronous functions, and receive a single
1414| Property | Type | Description |
1515| -------------------| ---------| ---------------------------------------------------|
1616| ` arc ` | object | Raw Architect project object |
17- | ` cloudformation ` | object | CloudFormation deployment |
17+ | ` cloudformation ` | object | [ CloudFormation template ] [ cfn-json ] in JSON |
1818| ` dryRun ` | boolean | ` true ` if ` --dry-run ` or ` --eject ` flags are used |
1919| ` inventory ` | object | [ Inventory] ( ./inventory ) object |
20+ | ` stackName ` | string | [ CloudFormation stack] [ cfn-stack ] name |
2021| ` stage ` | string | ` testing ` , ` staging ` or ` production ` |
2122
2223
@@ -29,7 +30,7 @@ Example:
2930``` javascript
3031// Do something only for staging deployments
3132module .exports = { deploy: {
32- start: async ({ arc, cloudformation, dryRun, inventory, stage }) => {
33+ start: async ({ arc, cloudformation, dryRun, inventory, stackName, stage }) => {
3334 if (stage !== ' staging' ) return
3435
3536 let config = await getSomeConfig ()
@@ -50,7 +51,7 @@ Examples:
5051``` javascript
5152// Create some identifiers associated with custom S3 bucket credentials
5253module .exports = { deploy: {
53- services: async ({ arc, cloudformation, dryRun, inventory, stage }) => {
54+ services: async ({ arc, cloudformation, dryRun, inventory, stackName, stage }) => {
5455 // If the user isn't using this plugin, you can just return
5556 if (! arc[' myS3Bucket' ]) return
5657
@@ -89,7 +90,7 @@ Example:
8990
9091``` javascript
9192module .exports = { deploy: {
92- target: async ({ arc, cloudformation, dryRun, inventory, stage }) => {
93+ target: async ({ arc, cloudformation, dryRun, inventory, stackName, stage }) => {
9394 if (dryRun) return
9495
9596 deployToAnotherService ({ inventory, stage })
@@ -107,8 +108,11 @@ Example:
107108``` javascript
108109const { rm } = require (' fs/promises' )
109110module .exports = { deploy: {
110- end: async ({ arc, cloudformation, dryRun, inventory, stage }) => {
111+ end: async ({ arc, cloudformation, dryRun, inventory, stackName, stage }) => {
111112 await rm (someBuildArtifact)
112113 }
113114} }
114115```
116+
117+ [ cfn-json ] : https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-overview.html#cfn-concepts-templates
118+ [ cfn-stack ] : https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-overview.html#cfn-concepts-stacks
0 commit comments