Skip to content

Instantly share code, notes, and snippets.

@shortjared
Created June 15, 2017 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shortjared/383de622c94506cc0f42850233ccd3d8 to your computer and use it in GitHub Desktop.
Save shortjared/383de622c94506cc0f42850233ccd3d8 to your computer and use it in GitHub Desktop.
sensitive env vars passed as params
# serverless.yml
service:
name: myService
awsKmsKeyArn: arn:aws:kms:us-east-1:XXXXXX:key/some-hash # Optional KMS key arn which will be used for encryption for all functions
frameworkVersion: ">=1.0.0 <2.0.0"
provider:
name: aws
runtime: nodejs6.10
stage: dev # Set the default stage used. Default is dev
region: us-east-1 # Overwrite the default region used. Default is us-east-1
memorySize: 512 # Overwrite the default memory size. Default is 1024
timeout: 10 # The default is 6
environment: # Service wide environment variables
NON_SENSITVE: 12345678
VERY_SENSITVE:
sensitive: true
value: mysecret
functions:
foo: # A Function (uses default KMS, only has default environment)
handler: users.create # The file and module for this specific function.
bar: # A Function
handler: users.create # The file and module for this specific function.
awsKmsKeyArn: arn:aws:kms:us-east-1:XXXXXX:key/some-hash # Optional KMS key arn which will be used for encryption (overwrites the one defined on the service level)
environment: # Function level environment variables
NON_SENSITVE_2: # We should also support sensitive as false, either we only have a string (non-sensitive impled), or sensitive is set to false
sensitive: false
value: 12345678
VERY_SENSITIVE_2:
sensitive: true
value: mysecret2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment