1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
1
You can directly provide the parameter values to the stack being deployed using the parameterOverrides
attribute (see the API documentation for details).
new CloudFormationCreateReplaceChangeSetAction({ actionName: 'PrepareChanges', stackName: 'my-stack', changeSetName: 'StagedChangeSet', adminPermissions: true, templatePath: sourceOutput.atPath('cloudformation/cf-test.yaml'), runOrder: 1, parameterOverrides: { 'AppDeployBucket' : 'your-value', 'DatabaseNamespace' : 'your-value' } });
In the example above, the parameter names and values are hard-coded.
If you want to specify the parameters using an artifact file, use templateConfiguration
instead (documentation link):
new CloudFormationCreateReplaceChangeSetAction({ actionName: 'PrepareChanges', stackName: 'my-stack', changeSetName: 'StagedChangeSet', adminPermissions: true, templatePath: sourceOutput.atPath('cloudformation/cf-test.yaml'), runOrder: 1, templateConfiguration: sourceOutput.atPath('parameter-file.json'), });
The template configuration file should contain a JSON object that should look like this:
{ "Parameters": {...}, "Tags": {...}, "StackPolicy": {...} }
답변함 2년 전