Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow use of Ref, Fn::GetAtt and Fn::ImportValue in awsKmsKeyArn #7083

Merged
merged 1 commit into from
Dec 12, 2019

Conversation

tume
Copy link
Contributor

@tume tume commented Dec 12, 2019

Allows to use Ref, Fn::GetAtt or Fn::ImportValue in awsKmsKeyArn config.

My first PR to this project so not sure how good approach this is but tried to mimic stuff that already exists.

I'm mainly interested in Fn:GetAtt and Fn::ImportValue in my own project but used the ready-made function which now also supports the Ref. Not sure if needed here?

Modified error message a bit and added a couple of simple test cases.

Closes #7057

How can we verify it

service:
  name: test-service
  awsKmsKeyArn: !GetAtt ['MyKmsKey', 'Arn']

resources:
  Resources:
    CustomKmsKey:
      Type: "AWS::KMS::Key"
      Properties:
        KeyPolicy:
          Version: "2012-10-17"
          Id: "CustomKmsKey"
          Statement:
            - Sid: "Enable IAM User Permissions"
              Effect: "Allow"
              Principal:
                AWS: <aws account_id>
              Action:
                - "kms:*"
              Resource: "*"

Todos

Useful Scripts
  • npm run test:ci --> Run all validation checks on proposed changes
  • npm run lint:updated --> Lint all the updated files
  • npm run lint:fix --> Automatically fix lint problems (if possible)
  • npm run prettier-check:updated --> Check if updated files adhere to Prettier config
  • npm run prettify:updated --> Prettify all the updated files
  • [ X ] Write and run all tests
  • Write documentation
  • [ X ] Enable "Allow edits from maintainers" for this PR
  • [ X ] Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

@codecov-io
Copy link

Codecov Report

Merging #7083 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7083      +/-   ##
==========================================
+ Coverage   88.63%   88.63%   +<.01%     
==========================================
  Files         231      231              
  Lines        8479     8481       +2     
==========================================
+ Hits         7515     7517       +2     
  Misses        964      964
Impacted Files Coverage Δ
lib/plugins/aws/package/compile/functions/index.js 95.9% <100%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 33b5e13...6ae765c. Read the comment docs.

@medikoo medikoo added this to the 1.60.0 milestone Dec 12, 2019
Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great thanks @tume, looks good

@medikoo medikoo merged commit f9b6507 into serverless:master Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using Fn::ImportValue for getting awsKmsKeyArn value
3 participants