An open API service indexing awesome lists of open source software.

https://github.com/serverless-plugins/serverless-kms-alias

Serverless plugin to expand a KMS alias variable to the ARN of the KMS key
https://github.com/serverless-plugins/serverless-kms-alias

hacktoberfest hacktoberfest2022 serverless serverless-framework

Last synced: 2 days ago
JSON representation

Serverless plugin to expand a KMS alias variable to the ARN of the KMS key

Awesome Lists containing this project

README

          

# serverless-kms-alias

[![NPM version](https://img.shields.io/npm/v/serverless-kms-alias.svg?style=flat)](https://npmjs.org/package/serverless-kms-alias)
[![node version](https://img.shields.io/node/v/serverless-kms-alias.svg?style=flat)](https://nodejs.org)

Serverless plugin to expand a KMS alias variable to the ARN of the KMS key

## Usage

`${kms:}` will expand to the ARN of the kms key. The variable can be used anywhere that other Serverless
variables are resolved.

### Example - Provider kmsKeyArn

```yaml
service: foo

provider:
name: aws
kmsKeyArn: '${kms:alias/aws/lambda}'
runtime: nodejs20.x

plugins:
- serverless-kms-alias

functions:
foo:
handler: foo.handler
```

### Example - Function kmsKeyArn

```yaml
service: foo
provider:
name: aws
runtime: nodejs20.x

plugins:
- serverless-kms-alias

functions:
foo:
handler: foo.handler
kmsKeyArn: '${kms:arn:aws:kms:${aws:region}:${aws:accountId}:alias/aws/lambda}'
```

### Example - Disable the plugin

```yaml
service: foo
provider:
name: aws
runtime: nodejs20.x

plugins:
- serverless-kms-alias

custom:
kmsAlias:
enabled: false

functions:
foo:
handler: foo.handler
kmsKeyArn: '${kms:arn:aws:kms:${aws:region}:${aws:accountId}:alias/aws/lambda}'
```