deliveredtechnologies / terraform-maven

Terraform Maven Plugin
Apache License 2.0
41 stars 13 forks source link

Add full backend config for tf:apply and tf:destroy #234

Open palaniswamy opened 3 years ago

palaniswamy commented 3 years ago

Is your feature request related to a problem? Please describe. In cases of terraform configurations for applications (distinct from modules), the ability to add spock tests rests on the terraform configurations not having the partial backend configuration. Without the partial backend configuration, the command line backend configuration is not possible (esp. in terraform 0.12).

Describe the solution you'd like The tf:apply and tf:destroy should take the "backendConfig" and convert them into a full backend config json file in the same directory as the terraform configurations

Additional context I am looking at s3 backend config only. I still don't know how the plugin can detect shows backed types.

Clayton7510 commented 3 years ago

@palaniswamy just to recap what we discussed yesterday:

So, something like backendType=s3 would create a backend.json file in the tfRootDir directory that looks like this:

{
  "terraform": {
     "backend": {
        "s3": {}
     }
   }
}