Skip to content

Incorrect permission (permission denied) on tfvars file #12

Answered by chadgeary
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

ANSWER:
sudo chown $USER *.tfvars && sudo chmod 640 *.tfvars

My hunch is it has something to do with either:

  • elevated powershell for WSL when it shouldn't be elevated, or
  • the file is left open in explorer (save but not quit)

I have not been able to re-produce it.

Hey @mnavidh - sudo should not be used here.

From the README:

# In powershell's WSL window, change to the project's aws directory
cd ~/cloudblock/aws/

# Initialize terraform and apply the terraform state
terraform init
terraform apply -var-file="aws.tfvars"

# Note the outputs from terraform after the apply completes

# Wait for the virtual machine to become ready (Ansible will setup the services for us)

Regards

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@ghost
Comment options

@chadgeary
Comment options

@ghost
Comment options

@chadgeary
Comment options

Answer selected by chadgeary
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant