Use CAPABILITY_AUTO_EXPAND for nested stacks on Cl

2020-06-02 04:22发布

I am trying to use nested stack and when my ChangeSet is being executed, I got this error:

Requires capabilities : [CAPABILITY_AUTO_EXPAND]

I went and create a pipeline with cloudformation.

This can be use to create a pipeline:

Configuration:
  ActionMode: CHANGE_SET_REPLACE
  ChangeSetName: changeset
  RoleArn: ??
  Capabilities: CAPABILITY_IAM
  StackName: appsync-graphql
  TemplatePath: BuildArtifact::output.yaml

This can’t:

Configuration:
  ActionMode: CHANGE_SET_REPLACE
  ChangeSetName: changeset
  RoleArn: ??
  Capabilities: 
    - CAPABILITY_IAM
    - CAPABILITY_AUTO_EXPAND
  StackName: appsync-graphql
  TemplatePath: BuildArtifact::output.yaml

The error was: “Value of property Configuration must be an object with String (or simple type) properties”

This is the closest docs that I find: https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStack.html

It said: Type: Array of strings for capabilites, and the aws cli docs says similarly, but doesn’t give an example.

So I ran out of ideas about what else to try to have CAPABILITY_AUTO_EXPAND capability.

3条回答
爱情/是我丢掉的垃圾
2楼-- · 2020-06-02 04:42

I tried another variant and it worked!

Configuration:
  ..
  Capabilities: CAPABILITY_IAM,CAPABILITY_AUTO_EXPAND
  ...
查看更多
淡お忘
3楼-- · 2020-06-02 04:46

I got the answer from Keeton Hodgson, this cli command works:

sam deploy --template-file output.yaml --stack-name <AppName> --capabilities CAPABILITY_IAM CAPABILITY_AUTO_EXPAND

Notice that there is no comma.

I still don't know how to change the pipeline template for it to work.

查看更多
Fickle 薄情
4楼-- · 2020-06-02 05:03

Put the capabilities property at the very end like this

aws cloud formation deploy COMMAND --capabilities CAPABILITY_NAMED_IAM

Change the order

Configuration:
  ActionMode: CHANGE_SET_REPLACE
  ChangeSetName: changeset
  RoleArn: ??
  StackName: appsync-graphql
  TemplatePath: BuildArtifact::output.yaml
  Capabilities: 
    - CAPABILITY_IAM
    - CAPABILITY_AUTO_EXPAND
查看更多
登录 后发表回答