terraform
Should .terraform.lock.hcl be included in the .gitignore file?
Per the Terraform documentation on the Dependency Lock File: Terraform automatically creates or updates the dependency lock file each time you run the terraform init command. You should include this file in your version control repository so that you can discuss potential changes to your external dependencies via code review, just as you would discuss … Read more
Terraform: Error acquiring the state lock: ConditionalCheckFailedException
Cause of Error This error usually appears when one process fails running terraform plan or terraform apply. For example if your network connection interrupts or the process is terminated before finishing. Then Terraform “thinks” that this process is still working on the infrastructure and blocks other processes from working with the same infrastructure and state … Read more
Best practices when using Terraform [closed]
I am also in a state of migrating existing AWS infrastructure to Terraform so shall aim to update the answer as I develop. I have been relying heavily on the official Terraform examples and multiple trial and error to flesh out areas that I have been uncertain in. .tfstate files Terraform config can be used … Read more
Upgrade terraform to specific version
Especially when playing around with Terraform 0.12 betas, I learned to love tfenv. After installation (via brew install tfenv on MacOS), this allows you to easily discover, install and activate any Terraform version: $ tfenv list-remote 0.12.0 0.12.0-rc1 0.12.0-beta2 0.12.0-beta1 0.12.0 0.11.14 … $ tfenv install 0.11.14 [INFO] Installing Terraform v0.11.14 [INFO] Downloading release tarball … Read more
AWS Lambda:The provided execution role does not have permissions to call DescribeNetworkInterfaces on EC2
This error is common if you try to deploy a Lambda in a VPC without giving it the required network interface related permissions ec2:DescribeNetworkInterfaces, ec2:CreateNetworkInterface, and ec2:DeleteNetworkInterface (see AWS Forum). For example, this a policy that allows to deploy a Lambda into a VPC: { “Version”: “2012-10-17”, “Statement”: [ { “Effect”: “Allow”, “Action”: [ “ec2:DescribeNetworkInterfaces”, … Read more