Skip to content

ljxau/drone-terraform

 
 

Repository files navigation

drone-terraform

Drone CI/CD infrastructure using Terraform in AWS.

Requirement

AWS Fargate with Amazon ECS is currently only available in the following regions:

Region Name Region
US East (N. Virginia) us-east-1
US East (Ohio) us-east-2
US West (Oregon) us-west-2
EU West (Ireland) eu-west-1
Asia Pacific (Tokyo) ap-northeast-1
Asia Pacific (Singapore) ap-southeast-1
Asia Pacific (Sydney) ap-southeast-2

See AWS Fargate on Amazon ECS to get more detail information. Service discovery is available in the following AWS Regions:

Region Name Region
US East (N. Virginia) us-east-1
US East (Ohio) us-east-2
US West (N. California) us-west-1
US West (Oregon) us-west-2
EU West (Ireland) eu-west-1

See AWS Service Discovery to get more detail information. So you can only create the drone infrastructure in us-east-1, us-east-2, us-west-2 or eu-west-1 region using Terraform. Before you begin, make sure you've read the limition.

Configuration

create new file with terraform.tfvars filename and put the following variable:

aws_access_key = "xxx"
aws_secret_key = "xxx"
drone_github_client = "xxxx"
drone_github_secret = "xxxx"
ssh_public_key = "ssh-rsa xxxxxx appleboy@xxxx"

Build Infrastructure

The first command to run for a new configuration

$ terraform init
Initializing the backend...
Initializing provider plugins...
- downloading plugin for provider "aws"...

Apply Changes

$ terraform apply

You will see the output:

Outputs:

alb_hostname = http://drone-front-alb-xxxxxxx.us-east-1.elb.amazonaws.com
database_root_password = <sensitive>
region = us-east-1

How to testing

$ go test -timeout 30m -v .

About

drone infrastructure in AWS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 95.2%
  • Go 4.8%