How to create an AWS Lambda in Terraform
Step 1 – Lambda Code in Python
The following code expects a python file with the contents as follows in a file called python/script1.py
:
def …
Read Article →
83 articles about terraform development, tools, and best practices
The following code expects a python file with the contents as follows in a file called python/script1.py
:
def …
Read Article →
If you get the Instance Profile already exists
error when running your Terraform apply
, then it is either because an instance profile with that name …
If you are using S3 as the backend for your state management in Terraform, then you can create environment specific configuration files where you …
Read Article →Sometimes your infrastructure may be out of sync with your Terraform state because resources may have been amended or deleted manually.
For this you …
Read Article →If
/Else
statements are conditional statements that perform decisions based on some known state, or variable.
Terraform allows you to perform these …
Read Article →Terraform state
reflects the most up to date reference of the infrastructure.
Sometimes you may need to remove a resource from the Terraform state …
Read Article →Running terraform destroy
will tear down the whole stack associated to some terraform code.
However, sometimes you might only want to remove a …
Read Article →resource "aws_dynamodb_table" "dynamodb-terraform-state-lock" {
name = …
Read Article →
Terraform, a powerful Infrastructure as Code (IaC) tool, allows you to define and provision infrastructure resources. Properly commenting your …
Read Article →If you have Terraform reporting an error but want more information, then you can configure debug logging.
export …
Read Article →
If you have an aws_lambda_function
block that needs to make use of environment variables, then you can simply do the following:
resource …
Read Article →
If you need to generate a random number or string in Terraform, then you can use the following:
resource "random_id" "myrandom" { …
Read Article →