In my AWS infrasructure, I have several environments existing under an an application, i.e:
- foo-application (AWS elasticbeanstalk app)
- foo-application-dev (tomcat envs)
- foo-application-int
- foo-application-sys
Of these envs, SYS is closest to the architecture and configuration I need. I want to be able to re-create the other environments to look like sys (but named dev, int). I have terraform scripts that were originally used to create some envs, but these have now deviated from current state. I would like to take the current state from SYS, and apply that to dev and int. I am a newbie to terraform, and stackoverflow, so please cut me some slack :)
All of the envs have a state file, this what I am trying to do but not sure how to go about it..
- delete all state files
- create a new state file from the SYS env in SYS workspace
- copy state to dev and int workspaces
- apply the dev and int plans and get the envs in synch.
I hope this makes sense.
I ran a terraform plan against the dev env and it looked like it was going to do a lot more than I expected. My research tells me that terraform compares current state to the last time terraform was run - so things done manually in the env may cause issues. I am not confident enough to run apply for fear it will damage my SYS env which I can't have.
what I want: three environments that are very identical except for naming conventions.