aws@localhost: localstack + iac
sample deployment scenario with localstack and terraform / aws community day 2021
$ (cd localstack-compose && docker-compose up)
$ (cd infrastructure && terraform init && terraform apply -auto-approve)
$ (cd src && ./pack.sh APP-lambda VERSION)
$ (cd src/.deploy/APP-lambda && terraform init)
$ (cd src/.deploy/APP-lambda && terraform apply -var="lambda_version=VERSION" -auto-approve)
$ (cd src/.deploy/APP-lambda && terraform destroy)
$ (cd infrastructure && terraform destroy)
chmod +x ./_init.sh && ./_init.sh
- query-lambda
cli | |
---|---|
pack | (cd src && ./pack.sh query-lambda v1) |
deploy | (cd src/.deploy/query-lambda && terraform apply -var="lambda_version=v1" -auto-approve) |
request | curl http://localhost:4566/restapis/[API_ID]/test/_user_request_/HASH |
logs | aws --endpoint-url=http://localhost:4566 logs tail /aws/lambda/query-lambda --follow |
- consumer-lambda
cli | |
---|---|
pack | (cd src && ./pack.sh consumer-lambda v1) |
deploy | (cd src/.deploy/consumer-lambda && terraform apply -var="lambda_version=v1" -auto-approve) |
logs | aws --endpoint-url=http://localhost:4566 logs tail /aws/lambda/consumer-lambda --follow |