-
Creating a Personal Access Token (PAT): help.github.com
-
Provider documentation: terraform.io/docs/providers/github
-
Provider source: github.com/terraform-providers/terraform-provider-github
-
Sensitive Data in Terraform State: terraform.io/docs/state/sensitive-data.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_providers { | |
http = "~> 1.2" | |
} | |
required_version = "~> 0.12.29" | |
} | |
data "http" "terraform_cloud_ip_ranges" { | |
url = "https://app.terraform.io/api/meta/ip-ranges" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DOMAINS=(example.com example.net) | |
CONTACT="FirstName=Clifford,LastName=Smith,ContactType=COMPANY,OrganizationName=Method,AddressLine1=Sample Lane 123,City=Amsterdam,CountryCode=NL,ZipCode=1234 AB,PhoneNumber=+31.123456789,Email=clifford@withmethod.example" | |
for DOMAIN in "${DOMAINS[@]}" | |
do | |
echo "going to update domain ${DOMAIN}" | |
aws \ |
This code is based around a question posted on Twitter
- Log into Terraform Cloud using
terraform login
. - Apply the three outputs in
main.tf
usingterraform apply
. - Execute
get-terraform-cloud-output-values.sh
to retrieve the output values through the TFC API.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script sends a requests to the Terraform Cloud API and updates the | |
# organization name from "${OLD_TFC_ORG_NAME}" to "${NEW_TFC_ORG_NAME}". | |
# | |
# This script can be useful when you need to rename a TFC Organization without | |
# wanting to (or being able to) start from scratch. | |
# | |
# Use this script with care, as this request is carried out against the API, only. | |
# Check your (local) Terraform Resources for references to `OLD_TFC_ORG_NAME` and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
VERSIONS=(0.0.37 0.0.36 0.0.35 0.0.33 0.0.32 0.0.31 0.0.30 0.0.29 0.0.28 0.0.27 0.0.26 0.0.25 0.0.24 0.0.23 0.0.22 0.0.21 0.0.20 0.0.19 0.0.18 0.0.17 0.0.16 0.0.15 0.0.14 0.0.13 0.0.12 0.0.11 0.0.10 0.0.9 0.0.8 0.0.7) | |
SHIPYARD="/Users/ksatirli/Downloads/yard-darwin" | |
for VERSION in "${VERSIONS[@]}" | |
do | |
${SHIPYARD} version install "${VERSION}" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
pipelines: | |
cloudfront: | |
- step: | |
image: python:3.5.1 | |
script: | |
- pip install awscli | |
# set up AWS access credentials incl. region | |
- export AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}" |
generate a signed URL for AWS S3 Bucket Objects by calling this script the following way:
python s3-generate-signed-url.py "us-west-1" "my-bucket" "index.html"
The output will look something like this:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker \ | |
run \ | |
--name portainer \ | |
--privileged \ | |
--detach \ | |
-p 9000:9000 \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
-v ~/Sites/docker-data/portainer/:/data \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# login to Azure CLI | |
az login | |
# complete flow by opening aka.ms/devicelogin and entering code | |
# list Azure VMs, pipe to `jq`, then get `plan` details of 0th instance | |
az vm list | jq .[0].plan |
NewerOlder