Create a new background service
Copy the stack folder from aws-stacks/{stack_name}
to compute/ecs/services/{stack_name}
.
Update provider sections to be inline with other services in that repo (Add version
to providers and key to s3
backend config).
Add modules/ecs/service/background
module and supporting terraform data to be used in the module.
Run t plan
in assume-role container.
Note down path for any resources that already exist (KMS, dynamoDB, SQS etc).
Look up resource in terraform docs and find out syntax for import, KMS example: t import path.to.kms.key.resource arn::for::kms::key
.
Create resource with t apply -auto-approve
.
Go to repo of service, and the following to the Dockerfile
:
HEALTHCHECK CMD true
Build binary:
GOOS=linux go build -i -ldflags " -X main.Version=$( cat VERSION) -X main.BuildTime=13/04/2017T09:00:00+0000"
Build container:
docker build -t 406236101787.dkr.ecr.eu-west-1.amazonaws.com/vidsy/{name_of_service}:$( cat VERSION) .
Push container to registry:
docker push 406236101787.dkr.ecr.eu-west-1.amazonaws.com/vidsy/{name_of_service}:$( cat VERSION)
To re-trigger the new version to be deployed go and change the CPU or memory by 1 increment then do a t apply -auto-approve
.