Skip to content

Instantly share code, notes, and snippets.

set -e
TEMP_SETUP_DIR=$(mktemp -d)
TF_PROJECT=.deployment/terraform/trident/ap-southeast-1/${ENVIRONMENT}-${MODE}
function cleanup {
rm -fr $TEMP_SETUP_DIR tfplan.out
}
trap cleanup EXIT
terraform {
required_version = "= 0.12.26"
backend "s3" {
bucket = "mycompany-terraform-s3-backend"
key = "terraform-platform-test.tfstate"
region = "ap-northeast-1"
encrypt = true
dynamodb_table = "terraform-lock"
}
}
---
- hosts: atlantis
become: true
roles:
- role: ringanta.atlantis
atlantis_domain: "<ATLANTIS_DOMAIN>"
atlantis_url: "https://<ATLANTIS_DOMAIN>"
atlantis_gh_user: "<GH_USER>"
atlantis_gh_token: "<GH_TOKEN>"
atlantis_gh_webhook_secret: "<GH_WEBHOOK_SECRET"
git init
echo -e ".terraform\ntfplan.out" >> .gitignore
git add .
git commit -m 'Initial commit'
git remote add origin <GITHUB_REPO_URL>
git push -u origin master
output "atlantis_ip" {
value = module.atlantis.atlantis_public_ip
}
output "atlantis_ssh_user" {
value = module.atlantis.atlantis_ssh_user
}
output "atlantis_xip_domain" {
value = module.atlantis.atlantis_xip_domain
terraform {
required_version = "= 0.12.26"
}
provider "aws" {
version = "~> 2.66"
}
provider "random" {
version = "~> 2.2"
@ringanta
ringanta / main.tf
Created June 16, 2020 13:35
Terraform main file
module "atlantis" {
source = "ringanta/ec2-atlantis/aws"
version = "1.0.0"
public_key = "<SSH_PUBLIC_KEY>"
attach_admin_policy = true
}
resource "aws_s3_bucket" "terraform_state" {
bucket = "terraform-s3-backend"
versioning {
http://officecdn.microsoft.com.edgesuite.net/sg/C1297A47-86C4-4C1F-97FA-950631F94777/OfficeMac/Microsoft_Office_2016_15.23.0_160611_Installer.pkg
Slides https://docs.google.com/presentation/d/1ywoymgRCx5sF12qUSnj9_trIFYiU7NrlrvyJHAZcNTk/pub#slide=id.p
Data https://drive.google.com/open?id=0BwV2E43noquyR2k0cFllX0J1TkU
https://gdp-aws.signin.aws.amazon.com/console/