-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improved deployment flow and error handling
- Loading branch information
Stevenson Jean-Pierre
committed
May 13, 2018
1 parent
1723014
commit 399c864
Showing
5 changed files
with
69 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
# Serverless directories | ||
.serverless | ||
|
||
.idea/ | ||
aws_certificate_auditor.iml | ||
# golang output binary directory | ||
bin | ||
|
||
cert_auditor.zip | ||
.idea | ||
aws_certificate_auditor.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,3 @@ | ||
# Builds and packages go application for use with AWS lambda | ||
all: clean build package post | ||
|
||
clean: | ||
@echo "removing previous package" | ||
@rm -f cert_auditor.zip | ||
|
||
build: | ||
@echo "building binary for use with lambda" | ||
@GOARCH=amd64 GOOS=linux go build -o ./lambda/cert_auditor | ||
|
||
package: | ||
@echo "building package cert-auditor.zip for upload to lambda" | ||
@zip -r -j cert_auditor.zip lambda/* | ||
|
||
post: | ||
@echo "deleting binary from build step" | ||
@rm -f ./lambda/cert_auditor | ||
|
||
.PHONY: all clean post | ||
go get github.com/aws/aws-lambda-go/lambda | ||
env GOOS=linux go build -ldflags="-s -w" -o bin/audit main.go |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
service: aws-cert-expiration-auditor | ||
|
||
provider: | ||
name: aws | ||
runtime: go1.x | ||
region: eu-west-1 | ||
profile: prod | ||
stage: global | ||
memorySize: 128 | ||
iamRoleStatements: | ||
- Effect: "Allow" | ||
Action: | ||
- "iam:ListServerCertificates" | ||
- "elasticloadbalancing:DescribeLoadBalancers" | ||
Resource: "*" | ||
|
||
|
||
package: | ||
exclude: | ||
- ./** | ||
include: | ||
- ./bin/** | ||
|
||
functions: | ||
audit: | ||
handler: bin/audit | ||
events: | ||
- schedule: rate(24 hours) | ||
environment: | ||
DD_API_KEY: ${env:DD_API_KEY} | ||
DD_APP_KEY: ${env:DD_APP_KEY} | ||
AWS_ACCOUNT_NAME: "ELSM-PROD" | ||
timeout: 180 |