Optum / dce

Disposable Cloud Environment
Apache License 2.0
320 stars 84 forks source link

Unable to overide variables with dce client / have to deploy with Terraform #382

Open fdeswardt opened 4 years ago

fdeswardt commented 4 years ago

Version information

Describe the bug After deploying DCE with the DCE CLI using dce system deploy unable to override the variables reset_nuke_template_bucket and reset_nuke_template_key with Terraform afterwards as the TF init directory is located at $HOME/.dce/.cache/module/.terraform directory that contains only main.tf as it's module and does not contain these variables. Tried to init the directory $HOME/.dce/.cache/module/.terraform/modules/dce/modules using the state file produced by DCE CLI deployment but the tf plan wants to remove all the infrastructure and replace it with a complete new set of DCE infrastructure and I would have expected a plan that at most will replace the CodeBuild infrastructure or even better just update the Environment variables of the Code Build project.

To Reproduce Steps to reproduce the behavior:

  1. Deploy DCE with CLI i.e. "dce system deploy"
  2. Try tf plan -var reset_nuke_template_bucket=some-bucket-name -var reset_nuke_template_key=custom-config-files/aws-nuke-default.yaml that naturally errors out that the variables are not specified in module main.tf
  3. Also tried dce system deploy --tf-apply-options "-var reset_nuke_template_bucket=some-bucket-name -var reset_nuke_template_key=custom-config-files/aws-nuke-default.yaml" which exits with code 1 without any explanation and didn't find any logs that could help 🤷‍♂️

Expected behavior Would expect the DCE CLI --tf-apply-options to work though now exits with error code 1.

Additional context Is modifying TF variables supported when using DCE CLI, and is it supported to modify then post deployment, or do you have to specify the variable overide values at the time of deployment? What if you want to change the variables after deployment? Is TF deployment the better option if one feels the need to override any variables?`

thebigcosinus commented 2 years ago

Hi, did you find a solution with the dce cli to update the deployement ? I ve got the same issue on my side.

fivehorizons commented 2 years ago

Version information

  • DCE version: 0.5
  • OS version: MacOS 10.15.7
  • Go version: whatever DCE CLI comes with
  • Terraform version : whatever DCE CLI comes with

Describe the bug After deploying DCE with the DCE CLI using dce system deploy unable to override the variables reset_nuke_template_bucket and reset_nuke_template_key with Terraform afterwards as the TF init directory is located at $HOME/.dce/.cache/module/.terraform directory that contains only main.tf as it's module and does not contain these variables. Tried to init the directory $HOME/.dce/.cache/module/.terraform/modules/dce/modules using the state file produced by DCE CLI deployment but the tf plan wants to remove all the infrastructure and replace it with a complete new set of DCE infrastructure and I would have expected a plan that at most will replace the CodeBuild infrastructure or even better just update the Environment variables of the Code Build project.

To Reproduce Steps to reproduce the behavior:

  1. Deploy DCE with CLI i.e. "dce system deploy"
  2. Try tf plan -var reset_nuke_template_bucket=some-bucket-name -var reset_nuke_template_key=custom-config-files/aws-nuke-default.yaml that naturally errors out that the variables are not specified in module main.tf
  3. Also tried dce system deploy --tf-apply-options "-var reset_nuke_template_bucket=some-bucket-name -var reset_nuke_template_key=custom-config-files/aws-nuke-default.yaml" which exits with code 1 without any explanation and didn't find any logs that could help 🤷‍♂️

Expected behavior Would expect the DCE CLI --tf-apply-options to work though now exits with error code 1.

Additional context Is modifying TF variables supported when using DCE CLI, and is it supported to modify then post deployment, or do you have to specify the variable overide values at the time of deployment? What if you want to change the variables after deployment? Is TF deployment the better option if one feels the need to override any variables?`

Is this still an issue? I am having issue with terraform deploy and lambda being not ready. So would try this but want to override nuke settings