- Serverless Framework
- A Datadog Account and API Key
- An AWS Account with Admin access configured in a local profile
- A SensorPush account (and ideally some sensors!)
Start by making a copy of serverless.example.yml
to serverless.yml
. In your new file, set your awsProfile
(if not using default
) and your awsRegion
.
For other options, see the serverless-plugin-datadog page.
- Using AWS Secrets Manager, create a plaintext secret containing the API key to your Datadog environment.
- Set the
datadogSecret
value to the ARN of the secret created above by replacing theDATADOG_SECRET_ARN
placeholder.
- Using AWS Secrets Manager, create a key/value secret containing the attributes
email
andpassword
with your SensorPush credentials. - Set the
sensorpushSecret
value to the ARN of the secret created above by replacing theSENSORPUSH_SECRET_ARN
placeholder.
Mac:
env GOARCH=amd64 GOOS=linux go build -ldflags="-s -w" -o ./bin/bootstrap -tags lambda.norpc handlers/temperature.go
Win (PowerShell):
$Env:GOOS="linux"; $Env:GOARCH="amd64"; go build -ldflags="-s -w" -o ./bootstrap -tags lambda.norpc cmd/temperature/main.go
Any other stage name can be used (
dev
is used by default) to create a test environment with the cron schedule disabled.
serverless deploy --stage prod