Permalink
Browse files

Simplify serverless.yml

  • Loading branch information...
azeemba committed Jan 15, 2019
1 parent 1269888 commit 5fff7cc7526fd34d6344f29aa91d10dd43faa6c1
Showing with 11 additions and 18 deletions.
  1. +11 −18 serverless.yml
@@ -1,34 +1,27 @@
service: serverless-oauth2
provider:
name: aws
runtime: nodejs6.10
stage: ${opt:stage, self:custom.defaultStage}
runtime: nodejs8.10
profile: lambda
environment:
GIT_HOSTNAME: "/ctrl-alt-del/oauth/${opt:stage, self:provider.stage}/GIT_HOSTNAME"
OAUTH_TOKEN_PATH: "/ctrl-alt-del/oauth/${opt:stage, self:provider.stage}/OAUTH_TOKEN_PATH"
OAUTH_AUTHORIZE_PATH: "/ctrl-alt-del/oauth/${opt:stage, self:provider.stage}/OAUTH_AUTHORIZE_PATH"
OAUTH_CLIENT_ID: "/ctrl-alt-del/oauth/${opt:stage, self:provider.stage}/OAUTH_CLIENT_ID"
OAUTH_CLIENT_SECRET: "/ctrl-alt-del/oauth/${opt:stage, self:provider.stage}/OAUTH_CLIENT_SECRET"
REDIRECT_URL: "/ctrl-alt-del/oauth/${opt:stage, self:provider.stage}/REDIRECT_URL"
OAUTH_SCOPES: "/ctrl-alt-del/oauth/${opt:stage, self:provider.stage}/OAUTH_SCOPES"
GIT_HOSTNAME: "/github/oauth/default/GIT_HOSTNAME"
OAUTH_TOKEN_PATH: "/github/oauth/default/OAUTH_TOKEN_PATH"
OAUTH_AUTHORIZE_PATH: "/github/oauth/default/OAUTH_AUTHORIZE_PATH"
OAUTH_CLIENT_ID: "/github/oauth/default/OAUTH_CLIENT_ID"
OAUTH_CLIENT_SECRET: "/github/oauth/default/OAUTH_CLIENT_SECRET"
REDIRECT_URL: "/github/oauth/default/REDIRECT_URL"
OAUTH_SCOPES: "/github/oauth/default/OAUTH_SCOPES"
TZ: "utc"
iamRoleStatements:
- Effect: Allow
Action:
- ssm:DescribeParameters
- ssm:GetParameters
Resource: "arn:aws:ssm:${opt:region, self:provider.region}:*:parameter/ctrl-alt-del/oauth/${opt:stage, self:provider.stage}/*"
Resource: "arn:aws:ssm:${opt:region, self:provider.region}:*:parameter/github/oauth/default/*"
- Effect: Allow
Action:
- kms:Decrypt
Resource: "arn:aws:kms:${opt:region, self:provider.region}:*:key/${self:custom.kms_key.${opt:region, self:provider.region}.${self:provider.stage}}"

custom:
defaultStage: dev
kms_key:
"us-east-1":
prod: "01660d80-64fb-4444-9b21-bb15ac2f97ec"
dev: "foo"
Resource: "arn:aws:kms:us-east-2:*:key/4ed45fcb-07cb-4309-87cd-8bde14b15f1"

functions:
auth:

0 comments on commit 5fff7cc

Please sign in to comment.