adhocteam / soapbox

Apache License 2.0
11 stars 3 forks source link

Using terraform configs with many apps #89

Closed rnagle closed 7 years ago

rnagle commented 7 years ago

Rough idea:

Initializing the backend...

Successfully configured the backend "s3"! Terraform will automatically
use this backend unless the backend configuration changes.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your environment. If you forget, other
commands will detect it and remind you to do so if necessary.
temp: /var/folders/qv/35cnkddj229bv3_wddmn20fm0000gn/T/tmp.xvIQGGSv
paulsmith commented 7 years ago

Does this apply to both network and deployment TF configs? Or would you run this once per network and once per deployment?

rnagle commented 7 years ago

Run it once per, changing the -t (type) flag: ./init_app_tf.sh -t <deployment|network>

paulsmith commented 7 years ago

@rnagle I got this when running APP=example-web-app ENV=test ./init_app_tf.sh -t network:

Initializing the backend...
Error inspecting state in "s3": NoSuchBucket: The specified bucket does not exist
        status code: 404, request id: 4F84F11941D8CF00, host id: wjaMsV4e6qbzWsq4OjgmgyLTh6kn2yY/1CCDNayFMWBRa8ylfBB5dmW4Y6MdB0lTol50EQ+geAE=

Prior to changing backends, Terraform inspects the source and destination
states to determine what kind of migration steps need to be taken, if any.
Terraform failed to load the states. The data in both the source and the
destination remain unmodified. Please resolve the above error and try again.
rnagle commented 7 years ago

@paulsmith Hm. Can you double check your AWS_PROFILE and give it another shot? The s3 bucket and dynamo db table are present and the script appears to work for me.