This file contains hidden or 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
    
  
  
    
  | # Log into your vault instance if you haven't already | |
| vault login root | |
| # Enable the transit secret engine | |
| vault secrets enable transit | |
| # Create a key | |
| vault write -f transit/keys/my-key | |
| # Read the key, nothing up my sleeves | |
| vault read transit/keys/my-key | |
| # Write some base64 encrypted data to the transit endpoint | |
| vault write transit/encrypt/my-key plaintext=$(base64 <<< "my secret data") | 
  
    
      This file contains hidden or 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
    
  
  
    
  | Nymphs blitz quick vex dwarf jog. (27 letters) | |
| DJs flock by when MTV ax quiz prog. (27 letters) (2 acronyms and a US spelling) | |
| Big fjords vex quick waltz nymph. (27 letters) | |
| Bawds jog, flick quartz, vex nymph. (27 letters) | |
| Junk MTV quiz graced by fox whelps. (28 letters) (Includes proper noun) | |
| Bawds jog, flick quartz, vex nymphs. (28 letters) | |
| Waltz, bad nymph, for quick jigs vex! (28 letters) | |
| Fox nymphs grab quick-jived waltz. (28 letters) | |
| Brick quiz whangs jumpy veldt fox. (28 letters) | |
| Glib jocks quiz nymph to vex dwarf. (28 letters) | 
  
    
      This file contains hidden or 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
    
  
  
    
  | job "java" { | |
| datacenters = ["dc1"] | |
| type = "service" | |
| # This is broken for some reason. | |
| # constraint { | |
| # attribute = "$attr.kernel.name" | |
| # value = "linux" | |
| # } | 
  
    
      This file contains hidden or 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
    
  
  
    
  | ecommerce_servers = "1" | |
| demoami = "ami-05349ec17a04c40fb" | |
| subdomain = "sean" | |
| key_name = "epsilontraining" | 
  
    
      This file contains hidden or 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
    
  
  
    
  | function vencrypt() { | |
| INPUTFILE=$1 | |
| vault write -format=json transit/encrypt/my-key plaintext=@<(base64 -i $INPUTFILE) | jq -r '.data|.ciphertext' | |
| } | |
| function vdecrypt() { | |
| INPUTFILE=$1 | |
| vault write -format=json transit/decrypt/my-key ciphertext=$(cat $INPUTFILE ) | jq -r '.data|.plaintext' | base64 -i -d | |
| } | 
  
    
      This file contains hidden or 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 | |
| # | |
| # Once you have stood up your three Vault instances, run the script on each | |
| # machine with your three IP addresses as script arguments. Put the IP address | |
| # of the local machine *first* in the list. | |
| # | |
| # Once the script is complete you should be able to start Vault and Consul: | |
| # | |
| # systemctl start consul | |
| # systemctl start vault | 
  
    
      This file contains hidden or 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
    
  
  
    
  | provider "azurerm" { | |
| version = "= 1.4" | |
| } | |
| terraform { | |
| required_version = ">= 0.11.7" | |
| } | |
| variable "name" { | |
| default = "seanc03" | 
  
    
      This file contains hidden or 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
    
  
  
    
  | provider "aws" { | |
| assume_role { | |
| role_arn = "arn:aws:iam::582482956935:role/build-automation" | |
| session_name = "Automation" | |
| } | |
| region = "us-west-2" | |
| } | 
  
    
      This file contains hidden or 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
    
  
  
    
  | provisioner "remote-exec" { | |
| inline = ["echo 'Hello World'"] | |
| connection { | |
| type = "ssh" | |
| user = "ec2-user" | |
| private_key = "${file("${var.private_key_path}")}" | |
| } | |
| } | |
  
    
      This file contains hidden or 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
    
  
  
    
  | variable "key_name" { | |
| default = "terraformdemo" | |
| } | |
| resource "tls_private_key" "example" { | |
| algorithm = "RSA" | |
| rsa_bits = 4096 | |
| } | |
| resource "aws_key_pair" "generated_key" { |