* Create a new stack using the base template
(userTemplate, functionsWithUrls)
| 99 | * Create a new stack using the base template |
| 100 | */ |
| 101 | async create(userTemplate, functionsWithUrls) { |
| 102 | for (const [functionName, { uri }] of Object.entries(functionsWithUrls)) { |
| 103 | userTemplate.Resources[functionName].Properties.CodeUri = uri |
| 104 | } |
| 105 | |
| 106 | const { StackId } = await this.client.send( |
| 107 | new CreateStackCommand({ |
| 108 | StackName: this.name, |
| 109 | TemplateBody: JSON.stringify(userTemplate), |
| 110 | Parameters: this.parameters, |
| 111 | Capabilities: [ |
| 112 | 'CAPABILITY_IAM', |
| 113 | 'CAPABILITY_NAMED_IAM', |
| 114 | 'CAPABILITY_AUTO_EXPAND', |
| 115 | ], |
| 116 | }), |
| 117 | ) |
| 118 | this.id = StackId |
| 119 | return await this.progress() |
| 120 | } |
| 121 | |
| 122 | /** |
| 123 | * Check the create/update progress of the status |
no test coverage detected