aztfmod / rover

The rover is a docker container in charge of the deployment of the Terraform platform engineering for Azure
MIT License
176 stars 146 forks source link

Add support for 'terraform show' #225

Closed brk3 closed 2 years ago

brk3 commented 2 years ago

Example usage:

Show current state:

/tf/rover/rover.sh \
  -lz /tf/caf/landingzones/caf-terraform-landingzones/caf_solution/ \
  -level level3 \
  -tfstate aks.tfstate \
  -env foo \
  -a show [-json]

Show a plan file:

/tf/rover/rover.sh \
  -lz /tf/caf/landingzones/caf-terraform-landingzones/caf_solution/ \
  -level level3 \
  -tfstate aks.tfstate \
  -env foo \
  -a show [-json] /tmp/out.plan

Implements https://github.com/aztfmod/rover/issues/181

brk3 commented 2 years ago

Hi Rover team, I've had to modify scripts/tfstate_azurerm.sh:other() to not pass -state by default. Not all 'other' commands take this arg, show being one. However I'm concerned this may break certain commands falling through to the other function that may require the state file?

If someone has some of these use cases would appreciate if they could confirm this patch is OK for their use case.

LaurentLesle commented 2 years ago

Thanks @brk3 . Going to include it in the next rover release and do the integration test into the tfc branch

arnaudlh commented 2 years ago

thanks @brk3 for your contribution to Cloud Adoption Framework!

arnaudlh commented 2 years ago

Tested and will need more rework so rolled back @brk3 ! Lets iterate for next month release.