Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
fix: add kms permission to work with cicd pipeline (#836)
Browse files Browse the repository at this point in the history
  • Loading branch information
maghirardelli authored Dec 17, 2021
1 parent ff11c16 commit 9ecd9ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 4 additions & 2 deletions main/cicd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The pipeline stops upon failure of any stage and notifies user via configured SN

* Create a settings file in `cicd/cicd-source/config/settings` for the environment for which you want to create the
CI/CD pipeline. For example, to create the CI/CD pipeline for `dev` environment, create `dev.yml` file in
`cicd/cicd-source/config/settings/`. You can create the settings file by copying the sample `demo.yml` file.
`cicd/cicd-source/config/settings/`. You can create the settings file by copying the sample `example-codecommit.yml` file.
Please adjust the settings as per your environment. Read inline comments in the file for information about each
setting.

Expand All @@ -79,9 +79,11 @@ The pipeline stops upon failure of any stage and notifies user via configured SN

* Create a settings file in `cicd/cicd-pipeline/config/settings` for the environment for which you want to create the
CI/CD pipeline. For example, to create the CI/CD pipeline for `dev` environment, create `dev.yml` file in
`cicd/cicd-pipeline/config/settings/`. You can create the settings file by copying the sample `demo.yml` file.
`cicd/cicd-pipeline/config/settings/`. You can create the settings file by copying the sample `example-codecommit.yml` file.
Please adjust the settings as per your environment. Read inline comments in the file for information about each
setting.

* Edit the settings file in `main/config/settings` for the environment. Comment out the line that states the `awsProfile`.

* Deploy the `cicd-pipeline` stack.
```bash
Expand Down
6 changes: 2 additions & 4 deletions main/cicd/cicd-pipeline/config/infra/cloudformation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ Resources:
Type: AWS::SNS::Topic
Properties: !If
- SubscribeNotificationEmail
-
Subscription:
- Subscription:
- Endpoint: ${self:custom.settings.emailForNotifications}
Protocol: email
KmsMasterKeyId: alias/aws/sns
Expand Down Expand Up @@ -117,8 +116,6 @@ Resources:
Rules:
- ExpirationInDays: 365 # Delete old artifacts from S3 after 1 year to save costs
Status: Enabled
VersioningConfiguration:
Status: Enabled

# The artifacts bucket S3 policy to allow CodePipeline's source stage to upload artifacts
AppArtifactBucketPolicy:
Expand Down Expand Up @@ -378,6 +375,7 @@ Resources:
- kms:TagResource
- kms:UntagResource
- kms:GetKeyPolicy
- kms:EnableKeyRotation
Resource:
- !Sub 'arn:aws:kms:${AWS::Region}:${AWS::AccountId}:alias/*${self:custom.settings.namespace}*'
- !Sub 'arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/*'
Expand Down

0 comments on commit 9ecd9ee

Please sign in to comment.