Required Capabilities Cloudformation Template

0

I am getting an exception when Deploying a cloud formation template regarding Requires capabilities : [CAPABILITY_IAM].

I have done some research and found out that when using IAM resources in the template we have to explicitly tell AWS that we are aware of IAM resources in the template.

I have done that. Below is my command

$ ./update.sh ScalableAppCore AppServers.yml AppParameterCore.json --capabilities CAPABILITY_IAM

$ ./update.sh ScalableAppCore AppServers.yml AppParameterCore.json --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM

$ ./create.sh ScalableAppCore AppServers.yml AppParameterCore.json --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND

Tried all 3 commands but still, the output shows:
An error occurred (InsufficientCapabilitiesException) when calling the UpdateStack operation: Requires capabilities : [CAPABILITY_IAM]

Here is the actual code :

This is the Role I have created for S3

IamS3Role:
    Type: AWS::IAM::Role
    Properties:
      ManagedPolicyArns:
        - "arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess"
      AssumeRolePolicyDocument:
        Version: "2012-10-17"
        Statement:
          - Effect: Allow
            Principal:
              Service:
                - ec2.amazonaws.com
            Action:
              - 'sts:AssumeRole'
      Path: /

Instance Profile attachment

ProfileWithRolesForApp:
    Type: AWS::IAM::InstanceProfile
    Properties:
      Path: "/"
      Roles:
        - !Ref IamS3Role
  

Please let me know where I am wrong . Thanks in advance

2개 답변
0
수락된 답변

There was a mistake in my update.sh script. All resolved now

Ashish
답변함 2년 전
0

Hi. I think the problem is not at Cloudformation, it causes by your credential. Should you check whether the credential is authoried to do UpdateStack action at the target resource?

답변함 2년 전
  • Yes, it has. My user is admin and I am working on this stack for a long time. Now I have IAM resource to deploy

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠