Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get an AWS SSM Key Arn from an Alias using CloudFormation?

Is it possible to get a KMS Key ARN using CloudFormation using an alias? I want to give specific permissions to a Key in my AWS Account.

Something like the following?

  - Effect: Allow
    Action: kms:Decrypt
    Resource:
      - 'Fn::GetAtt': 
        - 'alias/someAliasOfAKMSKey'
        - 'arn'
like image 765
Claudiordgz Avatar asked Jan 29 '19 22:01

Claudiordgz


1 Answers

You can do something like this:

- Effect: Allow
  Action:
  - kms:Decrypt
  Resource:
  - !Sub 'arn:aws:kms:${AWS::Region}:${AWS::AccountId}:key/someKeyNameOfAKMSKey'
like image 140
Deiv Avatar answered Nov 15 '22 03:11

Deiv