Azure / caf-terraform-landingzones-accelerator

Starter project for Applications (level 4) Cloud Adoption Framework for Azure landing zones on Terraform
MIT License
206 stars 230 forks source link

Error: Too many command line arguments #95

Closed ghost closed 3 years ago

ghost commented 3 years ago

Describe the bug after running the following, receive an error, seemingly from Terraform itself, that suggests rover is building a CLI that has too many arguments for the terraform plan command.

image

āš ļø NOTE: I am not modifying the configuration for launchpad. Simply trying to get a foundational understanding of the ecosystem and tooling.

To Reproduce

  1. Follow setup guide for caf-terraform-landingzones-starter demo
  2. Complete prerequisites
  3. Attempt to execute step one (with action == plan)
    rover -lz /tf/caf/landingzones/caf_launchpad \
     -launchpad \
     -var-folder /tf/caf/configuration/${environment}/level0/launchpad \
     -parallelism 30 \
     -level level0 \
     -env ${caf_environment} \
     -a plan
  4. See error

Expected behavior Expected this step to run clean and without issue so that I could move on to step 2 šŸ˜„

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context I am sure this is going to end up being something simple, šŸ˜‰, please forgive the ignorance! FWIW, I attempted to run the following directly and got the same error:

terraform plan -var-file /tf/caf/configuration/demo/level0/launchpad/configuration.tfvars \ 
-var-file /tf/caf/configuration/demo/level0/launchpad/dynamic_secrets.tfvars \ 
-var-file /tf/caf/configuration/demo/level0/launchpad/iam_role_mapping.tfvars \ 
-var-file /tf/caf/configuration/demo/level0/launchpad/keyvaults.tfvars \ 
-var-file /tf/caf/configuration/demo/level0/launchpad/storage_accounts.tfvars \ 
- parallelism 30

image

ghost commented 3 years ago

ā„¹ļø INFO I just noticed a space before parallelism argument! Removed that and ran command directly again:

terraform plan -var-file /tf/caf/configuration/demo/level0/launchpad/configuration.tfvars \ 
-var-file /tf/caf/configuration/demo/level0/launchpad/dynamic_secrets.tfvars \ 
-var-file /tf/caf/configuration/demo/level0/launchpad/iam_role_mapping.tfvars \ 
-var-file /tf/caf/configuration/demo/level0/launchpad/keyvaults.tfvars \ 
-var-file /tf/caf/configuration/demo/level0/launchpad/storage_accounts.tfvars \ 
-parallelism 30

New error: image

Am I running this in the wrong directory? I didn't see a change directory, so assumed I would run it from root of project.

ghost commented 3 years ago

Ok, I figured it out, sorry for the noise. I had a space in the rover CLI (which I should have noticed when I saw the space in the output terraform plan execution arguments):

rover -lz /tf/caf/landingzones/caf_launchpad \
  -launchpad \
  -var-folder /tf/caf/configuration/${environment}/level0/launchpad \
  - parallelism 30 \
  -level level0 \
  -env ${caf_environment} \
  -a plan

Also, the direct execution required me to be in the /tf/caf/landingzones/caf_launchpad directory, so figured that out, too. Closing this issue myself.