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年前