- go 1.10.x
- dep Golang dependency manager
- awscli
- Setup Consul artifact bucket
- Download Consul zip, extract
consul
binary, and upload to artifact bucket - Setup pipeline source bucket, enable versioning
- Setup pipeline action bucket, enable versioning
- Create EC2 key pair
- Register Route53 domain
- Create SSL cert through AWS ACM for the registered domain in the last step
- Resources must all be created in the same region
- tested in us-east-1 & us-west-2
The setup_and_run_deployment_pipeline.sh
script will do the following:
- Build the key-value CLI
- Package the cfn templates and key-value CLI into a deploy artifact
- Upload the artifact to the pipeline source S3 bucket
- Create a CodePipeline and Codebuild test job using the pipeline cfn template
- The Pipeline will then execute and create an infrastructure stack using the persistent-resources cfn template
- The Pipeline will then create a Consul cluster stack using the consul cfn template
- The Pipeline will then run the Codebuild job to test the key-value binary interaction with the Consul cluster using the
key_value_test.sh
script
./scripts/setup_and_run_deployment_pipeline.sh -s pipeline-source-bucket -a codepipeline-bucket -p my-profile -r us-east-1 -c
- You will be prompted for the resource names from the account setup steps
A basic CLI for interacting with the Consul key-value store API
build.sh
Mac OSX binary can be located at:
./cli/bin/darwin/key-value
Linux binary can be located at:
./cli/bin/linux/key-value
A basic integration test scipt is located at: scripts/key_value_test.sh
This script requires you to have the key-value binary in your current working directory and to set the env server_url
with your server endpoint URL. It is the same script the Codebuild test job runs.
- Example:
export server_url="kvdemo.thehoff.xyz"
Stacks must be torn down in the following order and each stack must be fully destroyed before deleting the following stack, otherwise you may receive resource dependency errors.
aws cloudformation delete-stack --stack-name kv-consul-cluster --profile my-profile --region us-east-1
aws cloudformation delete-stack --stack-name kv-persistent-resources --profile my-profile --region us-east-1
aws cloudformation delete-stack --stack-name kv-pipeline --profile my-profile --region us-east-1
- Front Consul cluster with custom API
- Automate teardown