Accidental Admin
Accidental Admin

Reputation: 166

gitignore .tfvars but not .auto.tfvars

I'm trying to avoid committing some Terraform vars while committing others. I was hoping something like the following in gitignore would work, but it doesn't.

*.tfvars
!.auto.tfvars

I've tried .tfvars.json but am struggling to get JSON to a TF map object to work properly and think a gitignore exception like !.auto.tfvars to be superior.

Thanks for any suggestions.

Upvotes: 2

Views: 888

Answers (1)

Accidental Admin
Accidental Admin

Reputation: 166

NM I need to make it

*.tfvars
!*.auto.tfvars

with the * before .auto.tfvars

Upvotes: 3

Related Questions