Skip to content

Instantly share code, notes, and snippets.

@bensojona
Created April 13, 2015 07:59
Show Gist options
  • Save bensojona/384a2bdc15f78e301b46 to your computer and use it in GitHub Desktop.
Save bensojona/384a2bdc15f78e301b46 to your computer and use it in GitHub Desktop.
Attempting to create an infrastructure that will use the local-exec provisioner to call a shell script that creates a key pair on the atlas_artifact resource creation. After key pair creation, there is an aws_key_pair resource that depends on this atlas_artifact that will use the newly created public key to create the AWS key pair to be later us…
aws_security_group.allow_all: Creating...
description: "" => "Allow all inbound traffic"
egress.#: "" => "<computed>"
ingress.#: "" => "1"
ingress.532441254.cidr_blocks.#: "" => "1"
ingress.532441254.cidr_blocks.0: "" => "0.0.0.0/0"
ingress.532441254.from_port: "" => "0"
ingress.532441254.protocol: "" => "-1"
ingress.532441254.security_groups.#: "" => "0"
ingress.532441254.self: "" => "0"
ingress.532441254.to_port: "" => "65535"
name: "" => "allow_all"
owner_id: "" => "<computed>"
tags.#: "" => "1"
tags.Name: "" => "allow_all"
vpc_id: "" => "<computed>"
atlas_artifact.metamon: Creating...
file_url: "" => "<computed>"
metadata_full.#: "" => "<computed>"
name: "" => "jb_hashicorp/metamon_4"
slug: "" => "<computed>"
type: "" => "aws.ami"
version_real: "" => "<computed>"
atlas_artifact.consul: Creating...
file_url: "" => "<computed>"
metadata_full.#: "" => "<computed>"
name: "" => "jb_hashicorp/consul_4"
slug: "" => "<computed>"
type: "" => "aws.ami"
version_real: "" => "<computed>"
atlas_artifact.metamon: Provisioning with 'local-exec'...
atlas_artifact.metamon (local-exec): Executing: /bin/sh -c "sh scripts/generate_key_pair.sh metamon"
atlas_artifact.metamon (local-exec): No metamon-key pair exists, generating new keys...
atlas_artifact.metamon (local-exec): Generating RSA private key, 1024 bit long modulus
atlas_artifact.metamon (local-exec): .................................++++++
atlas_artifact.metamon (local-exec): .++++++
atlas_artifact.metamon (local-exec): e is 65537 (0x10001)
atlas_artifact.metamon (local-exec): ssh_keys/metamon-key.pem contents...
atlas_artifact.metamon (local-exec): -----BEGIN RSA PRIVATE KEY-----
atlas_artifact.metamon (local-exec): MIICXAIBAAKBgQCztHPqkUl+UICjFCu+mfHGq8XzTCEoGVVMIwhAXFq+DAAqmPCj
atlas_artifact.metamon (local-exec): 4u0EAUUoLQ7aoJCr98EEeBUPTinCW41SDh5Np7ARoBFh7mflCnOThv/nIKeZ2d5L
atlas_artifact.metamon (local-exec): nrgGiMcJInzj+hhRNIsdOssaQofmA9iivoDfqjBZCswOX+2edzojWGf7WQIDAQAB
atlas_artifact.metamon (local-exec): AoGAX49b/KZZsIPag93cDTULrpv1XZVkJFCkXSJb5u21i04SYJSHkn6/jtumDOE4
atlas_artifact.metamon (local-exec): /uVXSTssNtYsTMFBz4qjsbi0P67cur1Yt4/lfTtUiW1sXboLMUbRd0vrXjRQAzSG
atlas_artifact.metamon (local-exec): zMwZEPKWBoV5B+8p9Y6SRrHWviS4/Q78ggfaQG7g5baGMaECQQDe/EX3a4hM9RS9
atlas_artifact.metamon (local-exec): 1Fwsoj8qPl833EN04RwJn8zfUSwovKmGQRpLkHYxrPh7Cp2tDSHa19SWxOS1fxvH
atlas_artifact.metamon (local-exec): IFrW47qtAkEAzk+8AwE5jBRLc9IWYq7J/DFY8P+1tFEp0c5mM+f+ui0Ab1fqjNub
atlas_artifact.metamon (local-exec): Dvm3TdWMGOPhzuHL9QXZBXGUNONCMz2k3QJBAJ7q5iZuccZ/CFg95687to6xwwS5
atlas_artifact.metamon (local-exec): qy26XVQSml0xqaoiwyLWdRoTi9jdcH2oVDWH3W/tUCpfiqw7OZ3R1ku+I0UCQCn4
atlas_artifact.metamon (local-exec): JnMmCKLqbf79ufgRPp3DHCjKnBg2ep9nsXrVswgEp5X++IP3GLAPNK7sxjc6BHGl
atlas_artifact.metamon (local-exec): lWwe6GsnE9M+d/UckTECQC+GI36131JAh6Kt5OfB/uSMLoHMfA7OGE9M2MgQKgcd
atlas_artifact.metamon (local-exec): FNuIeV3y+9i5e0H2in3v8MhmsjkEabtNIKAVofk7gQw=
atlas_artifact.metamon (local-exec): -----END RSA PRIVATE KEY-----
atlas_artifact.metamon (local-exec): ssh_keys/metamon-key.pub contents...
atlas_artifact.metamon (local-exec): ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCztHPqkUl+UICjFCu+mfHGq8XzTCEoGVVMIwhAXFq+DAAqmPCj4u0EAUUoLQ7aoJCr98EEeBUPTinCW41SDh5Np7ARoBFh7mflCnOThv/nIKeZ2d5LnrgGiMcJInzj+hhRNIsdOssaQofmA9iivoDfqjBZCswOX+2edzojWGf7WQ==
atlas_artifact.metamon: Creation complete
atlas_artifact.consul: Provisioning with 'local-exec'...
atlas_artifact.consul (local-exec): Executing: /bin/sh -c "sh scripts/generate_key_pair.sh consul"
atlas_artifact.consul (local-exec): No consul-key pair exists, generating new keys...
atlas_artifact.consul (local-exec): Generating RSA private key, 1024 bit long modulus
atlas_artifact.consul (local-exec): ....++++++
atlas_artifact.consul (local-exec): .......................................++++++
atlas_artifact.consul (local-exec): e is 65537 (0x10001)
atlas_artifact.consul (local-exec): ssh_keys/consul-key.pem contents...
atlas_artifact.consul (local-exec): -----BEGIN RSA PRIVATE KEY-----
atlas_artifact.consul (local-exec): MIICXQIBAAKBgQDk70ZjV9TSmxaF0muS9d/EZOzJs1Zh8XN3afV5NRI9ohtUZq9S
atlas_artifact.consul (local-exec): cAARSQyuYdzsrD2qIs383UYt613D2HbZZKQxnkjZfEsPWNktk/ydYC8Mtj6BtH5N
atlas_artifact.consul (local-exec): Prd+Sex3moOo1/8E2WvFtRo9puVClxCoPGM9cnu0qC7lbmO8YEW8eIZNsQIDAQAB
atlas_artifact.consul (local-exec): AoGAF+IScMi37iS5y8ow6Mr3xjBVN5GbAGrFBf8q2bM8rOtdeIeh4LLIfwUk6ohR
atlas_artifact.consul (local-exec): GOu7HyW0YZ3f9WhphsXtWC6Upln85JCMGFyQKFnSjXwBm42uQ8yb4kP40kTqLAHT
atlas_artifact.consul (local-exec): 6h0wH9Enzvn/pBtk86W6qxseXsIAf3xEGJQKIAzuIgwhPAECQQD2es9aeWIpR1Qr
atlas_artifact.consul (local-exec): /zPh2mbOOEAPQZOGggjL0Lb3guiYlUHaTac5Sx16xYceoICCSkJV4Zusst8ibzdP
atlas_artifact.consul (local-exec): oJEs1k1BAkEA7cb6w4ysABwORuTDTJCmFTAZn47Eu7mpjHhaTdwYnDBSzk46ksay
atlas_artifact.consul (local-exec): bLYj/JnpITLb3rxqNK0UyD2bFGH1jf00cQJATHae2vdrD1k0cI20H62sVO84WENE
atlas_artifact.consul (local-exec): q+atKeVuzWwMEkHDcyDB7tExrQOYPlUWaNT2rUPXEoVPGZSc+RPb1agJwQJBAJhy
atlas_artifact.consul (local-exec): dKAfdr9zPWwSi2xxaSo4dpUoEdZSCPR4zV0R+e1Zxh1jZoZoQkkU1inD/AY+91zs
atlas_artifact.consul (local-exec): 7CLtvV9MsDr3O1pXtuECQQCHYJUyS1uR8ns9uH7dJe+gNNDXaA3VP5TN3ZD2NA/7
atlas_artifact.consul (local-exec): gUQIcWUarUpklGjk6WLyIGnKkWSvRboBvVV9jm01AVoY
atlas_artifact.consul (local-exec): -----END RSA PRIVATE KEY-----
atlas_artifact.consul (local-exec): ssh_keys/consul-key.pub contents...
atlas_artifact.consul (local-exec): ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDk70ZjV9TSmxaF0muS9d/EZOzJs1Zh8XN3afV5NRI9ohtUZq9ScAARSQyuYdzsrD2qIs383UYt613D2HbZZKQxnkjZfEsPWNktk/ydYC8Mtj6BtH5NPrd+Sex3moOo1/8E2WvFtRo9puVClxCoPGM9cnu0qC7lbmO8YEW8eIZNsQ==
atlas_artifact.consul: Creation complete
aws_security_group.allow_all: Creation complete
Error applying plan:
2 error(s) occurred:
* 1 error(s) occurred:
* aws_key_pair.metamon: diffs didn't match during apply. This is a bug with Terraform and should be reported.
* 1 error(s) occurred:
* aws_key_pair.consul: diffs didn't match during apply. This is a bug with Terraform and should be reported.
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment