7
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Docker Compose と Amazon ECS を利用したソフトウェアデリバリの自動化 のエラー解決

Posted at

エラー内容

Docker Compose と Amazon ECS を利用したソフトウェアデリバリの自動化を手順通り実行していくと、CodePipelineの ExecuteChangeSet でエラーとなる。

98.png
99.png

状態の理由
Resource handler returned message: "User is not authorized to perform that action on the specified resource (Service: Efs, Status Code: 403, Request ID: hogehogefugafuga)" (RequestToken: hogehogefugafuga, HandlerErrorCode: GeneralServiceException)

解決策

pipeline フォルダ内の cloudformation.yaml 184行目付近に arn:aws:iam::aws:policy/AmazonVPCFullAccess を追加する。

cloudformation.yaml
  ExtractBuildRole:
    Type: AWS::IAM::Role
    Properties:
      ManagedPolicyArns:
        - "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"
        - "arn:aws:iam::aws:policy/AmazonVPCFullAccess"
      AssumeRolePolicyDocument:
        Statement:
          - Action: sts:AssumeRole
            Effect: Allow
            Principal:
              Service: codebuild.amazonaws.com
          - Action: sts:AssumeRole
            Effect: Allow
            Principal:
              Service: cloudformation.amazonaws.com
        Version: "2012-10-17"

フォルダ構成

.
├── LICENSE
├── README.md
├── application
│   ├── docker-compose.yml
│   └── frontend
│       ├── Dockerfile
│       ├── myweb
│       │   ├── app.py
│       │   ├── static
│       │   │   ├── blue.png
│       │   │   ├── green.png
│       │   │   └── style.css
│       │   └── templates
│       │       ├── health.html
│       │       └── index.html
│       └── requirements.txt
├── infrastructure
│   └── cloudformation.yaml
└── pipeline
    └── cloudformation.yaml

GitHub

GitHubにソースコードを公開しています。

7
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?