Skip to content

serverless-plugins/serverless-kms-alias

serverless-kms-alias

NPM version node version

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

Usage

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

Example - Provider kmsKeyArn

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

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

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}'

About

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

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project