- Install Golang
- Install make
- Install Docker
- Install Docker Compose
- Install development tools by running the following command:
make tools
If you want to print help information, you can run the following command:
$ make
build Build binary
changelog Generate changelog
clean Clean project
docker Start docker (localstack)
generate Generate code from templates
test Start unit test
tools Install dependency tools
The localstack is used to simulate the AWS environment. First, you configure a custom profile to use with LocalStack. Add the following profile to your AWS configuration file (by default, this file is at ~/.aws/config):
[profile localstack]
region=us-east-1
output=json
endpoint_url = http://localhost:4566
Add the following profile to your AWS credentials file (by default, this file is at ~/.aws/credentials):
[localstack]
aws_access_key_id=test
aws_secret_access_key=test
Note
Alternatively, you can also set the AWS_PROFILE=localstack environment variable, in which case the --profile localstack parameter can be omitted in the commands above.
Please access the official website of localstack and obtain a Hobby Subscription. Then, you can get the authentication token from the localstack dashboard. Finally, set the LOCALSTACK_AUTH_TOKEN environment variable. You must not upload the LOCALSTACK_AUTH_TOKEN to the remote repository.
export LOCALSTACK_AUTH_TOKEN=YOUR_AUTH_TOKEN
Run the following command to start localstack:
make docker
Check the status of localstack:
curl -s "http://127.0.0.1:4566/health" | jq .
{
"services": {
"acm": "available",
"apigateway": "available",
"cloudformation": "available",
"cloudwatch": "available",
"config": "available",
"dynamodb": "available",
"dynamodbstreams": "available",
"ec2": "available",
"es": "available",
"events": "available",
"firehose": "available",
"iam": "available",
"kinesis": "available",
"kms": "available",
"lambda": "available",
"logs": "available",
"opensearch": "available",
"redshift": "available",
"resource-groups": "available",
"resourcegroupstaggingapi": "available",
"route53": "available",
"route53resolver": "available",
"s3": "available",
"s3control": "available",
"secretsmanager": "available",
"ses": "available",
"sns": "available",
"sqs": "available",
"ssm": "available",
"stepfunctions": "available",
"sts": "available",
"support": "available",
"swf": "available",
"transcribe": "available"
},
"version": "2.1.1.dev"
}
$ export AWS_PROFILE=localstack
$ export LOCALSTACK_AUTH_TOKEN=YOUR_AUTH_TOKEN
$ make docker
$ make test
make changelog
make coverage-tree