Skip to content

Instantly share code, notes, and snippets.

View andresvia's full-sized avatar
💭
adsking

Andres Villarroel andresvia

💭
adsking
View GitHub Profile
locals {
configs = {
prod = [
"prodconfiga",
"and",
"prodconfigb",
]
other = [
"configa",
"configb",
module "ue1" {
source = "git::https://gist.github.com/0ddd58161ecc62163f2bd0bfef09e79c.git//?ref=master"
}
module "uw2" {
source = "git::https://gist.github.com/0ddd58161ecc62163f2bd0bfef09e79c.git//?ref=master"
}
output "result" {
value = {
./locals.tf.json.real
module "core1" {
source = "git::https://gist.github.com/a0757d5396e36c10a5dee7ba00f16307.git//?ref=master"
}
// normally there are other things here...
// adding core2 just as filler
module "core2" {
source = "git::https://gist.github.com/a0757d5396e36c10a5dee7ba00f16307.git//?ref=master"
}
module "config" {
source = "git::https://gist.github.com/7ee8813d4f1df942bb21a9386b457888.git//?ref=master"
}
resource "random_pet" "core" {
prefix = join("-", module.config.config)
}
output "core" {
value = random_pet.core.id
root@60b4defcedf2:/tmp/tf012# ls -lhart
total 41M
-rwxrwxr-x 1 root root 41M Feb 28 21:12 terraform
-rw-r--r-- 1 root root 73 Mar 19 00:54 main.tf
drwxr-xr-x 4 root root 128 Mar 19 00:58 .
drwxrwxrwt 1 root root 4.0K Mar 19 00:58 ..
root@60b4defcedf2:/tmp/tf012# cat main.tf
resource "random_pet" "random_pet" {
name_prefix = "random_pet_"
@andresvia
andresvia / aws
Last active August 1, 2018 22:02
aws
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
trap - INT TERM
docker run --rm \
-t $(tty &>/dev/null && echo "-i") \
@andresvia
andresvia / terraform.tfvars
Last active July 13, 2018 21:37
terragrunt repro
terragrunt {
terraform {
source = "git::https://gist.github.com/e193045664d62fbf8b1b93fd21e5914c.git//?ref=master"
}
remote_state {
backend = "s3"
config {
bucket = "t-villa-tg-0162"
dynamodb_table = "t-villa-tg-0162"
encrypt = true
@andresvia
andresvia / main.tf
Last active July 13, 2018 21:31
terragrunt repro child repo
terraform { backend "s3" {} }
resource "random_pet" "pet" {}