Skip to content

Commit

Permalink
Improve deploy.sh & standardise resource names for better integration
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesJJ committed Mar 10, 2021
1 parent ebfdce3 commit 9d383b0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
16 changes: 13 additions & 3 deletions aws-serverless/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,24 @@

set -eou pipefail

SANITY="../main.go"
SAM_DIR="$(dirname "$0")"
FUNC_DIR_RELATIVE=".."

cd "${SAM_DIR}"

SANITY="${FUNC_DIR_RELATIVE}/main.go"
if [ ! -f "${SANITY}" ] ; then
echo "ERROR: File not found: ${SANITY}" 1>&2
exit 1
fi

GOOS=linux GOARCH=amd64 go build -o main ..
cd "${FUNC_DIR_RELATIVE}"
GOOS=linux GOARCH=amd64 go build -o main
cd -

mv "${FUNC_DIR_RELATIVE}/main" ./
sam deploy -g --tags "tenant=fcg"
rm -f ./main

sam deploy --tags "tenant=fcg" -g


5 changes: 3 additions & 2 deletions aws-serverless/samconfig.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ version = 0.1
[default]
[default.deploy]
[default.deploy.parameters]
stack_name = "dmarc-report-lambda"
s3_prefix = "dmarc_report_lambda"
stack_name = "dmarc-report-parser"
s3_prefix = "dmarc-report-parser"
region = "us-west-2"
confirm_changeset = true
capabilities = "CAPABILITY_IAM"
parameter_overrides = "DELETESQS=\"true\" EMPTYPOLLS=\"1\" MOVE=\"archive-dmarc\" VERBOSE=\"false\""
3 changes: 2 additions & 1 deletion aws-serverless/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Resources:
DelaySeconds: "0"
MaximumMessageSize: "262144"
MessageRetentionPeriod: "1209600"
QueueName: ses-received-dmarc-emails
QueueName: !Join [ "-", [ !Ref AWS::StackName , "sqs" ] ]
ReceiveMessageWaitTimeSeconds: "10"
VisibilityTimeout: "3600"
SQSQueuePolicy:
Expand Down Expand Up @@ -53,6 +53,7 @@ Resources:
Function:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Join [ "-", [ !Ref AWS::StackName , "lambda" ] ]
Handler: main
Runtime: go1.x
CodeUri: .
Expand Down

0 comments on commit 9d383b0

Please sign in to comment.