Skip to content

Commit

Permalink
Merge pull request #233 from sanketnadkarni/gh222-tf-version
Browse files Browse the repository at this point in the history
feat: lock terraform version to 1.4.6
  • Loading branch information
dadiorchen authored Apr 8, 2024
2 parents 431e9fc + 84c0fb1 commit 7c4e90d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
22 changes: 21 additions & 1 deletion database-grants/terraform/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Prerequisites

- Terraform 1.4.6 , please stick to this version for now, tested 1.6.x, it brings issue with the Dititalocean storage as backend
- Ensure you have `tfenv` installed in your system. https://github.com/tfutils/tfenv

- The terraform configuration in this directory requires to have `terraform` binary version to be minimum 1.4.6 Ref: https://developer.hashicorp.com/terraform/tutorials/configuration-language/versions#review-example-configuration





# How to set up terraform
Expand All @@ -22,6 +27,21 @@ source setup_keys.sh

# How to run terraform

Use correct version:
```bash
tfenv use min-required
```
OR if you configure `.terraform-version`

```bash
echo "1.4.6" > .terraform-version
tfenv use # this will configure the correct version from .terraform-version file
```

```bash
terraform version # check if the version matches with the required_version in provider.tf
```

Init:

```bash
Expand Down
3 changes: 3 additions & 0 deletions database-grants/terraform/dev/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ variable "password" {
}

terraform {
# Ref: https://developer.hashicorp.com/terraform/tutorials/configuration-language/versions#review-example-configuration
required_version = "~> 1.4.6"

required_providers {
postgresql = {
source = "cyrilgdn/postgresql"
Expand Down
2 changes: 1 addition & 1 deletion database-grants/terraform/prod/backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ terraform {
skip_credentials_validation = true
# skip_get_ec2_platforms = true
skip_requesting_account_id = true
skip_metadata_api_check = true
skip_metadata_api_check = true
}
}

0 comments on commit 7c4e90d

Please sign in to comment.