QT-DevOps / DevOpsIssues

This Repo will be used to demonstrate the Skills & Questions in DevOps
Apache License 2.0
27 stars 131 forks source link

unable to execute command : terraform plan . #1022

Open uravi409 opened 3 years ago

uravi409 commented 3 years ago

after validate i execute plan command its showing error as below and i given script also correct

script 👍

provider "aws" {
region = "us-east-2" access_key = "xxxxxxxxxxxxxxxxxxxxxxx" secret_key = "xxxxxxxxxxxxxxxxxxxxxxx" } resource "aws_instance" "terraform" { ami = "ami-08962a4068733a2b6" instance_type = "t2.micro" key_name = "terraform" security_groups = [ "launch-wizard-2" ] }

Results:

PS E:\Softwares\Devops\Terraform\May2021> terraform plan . ╷ │ Error: Too many command line arguments │ │ To specify a working directory for the plan, use the global -chdir flag. ╵

For more help on using this command, run: terraform plan -help

Nihira123 commented 3 years ago

Please remove access keys, secret keys. Please do not post keys in any open forums.

Nihira123 commented 3 years ago

Are you executing the commands on the same folder where scripts saved. by looking this message "To specify a working directory for the plan, use the global -chdir flag." shows you might be on different path.

uravi409 commented 3 years ago

No i am working on same directory sir

rakeshgh commented 2 years ago

I think you should remove '.' next to plan simply, terraform plan does your job.