Skip to content

IO platform infrastructure

Notifications You must be signed in to change notification settings

pagopa/io-infra

Folders and files

NameName
Last commit message
Last commit date
Aug 27, 2024
Oct 29, 2024
Aug 17, 2022
Mar 6, 2023
Nov 7, 2024
Apr 29, 2022
Oct 8, 2024
Oct 8, 2024
Oct 28, 2024
Oct 8, 2024
Oct 8, 2024
Oct 1, 2024
Nov 17, 2023
Aug 2, 2023

Repository files navigation

Static Analysis

Continuous Delivery on prod citizen-auth Drift Detection on prod citizen-auth

IO-infrastructure

IO project infrastructure

Requirements

1. terraform

In order to manage the suitable version of terraform it is strongly recommended to install the following tool:

  • tfenv: Terraform version manager inspired by rbenv.

Once these tools have been installed, install the terraform version shown in:

  • .terraform-version

After installation install terraform:

tfenv install

Terraform modules

As PagoPA we build our standard Terraform modules, check available modules:

Apply changes

To apply changes follow the standard terraform lifecycle once the code in this repository has been changed:

./terraform.sh init [dev|uat|prod]

./terraform.sh plan [dev|uat|prod]

./terraform.sh apply [dev|uat|prod]

Terraform lock.hcl

We have both developers who work with your Terraform configuration on their Linux, macOS or Windows workstations and automated systems that apply the configuration while running on Linux. https://www.terraform.io/docs/cli/commands/providers/lock.html#specifying-target-platforms

So we need to specify this in terraform lock providers:

rm .terraform.lock.hcl

./terraform.sh init [dev|uat|prod]

rm .terraform.lock.hcl

terraform providers lock \
  -platform=windows_amd64 \
  -platform=darwin_amd64 \
  -platform=darwin_arm64 \
  -platform=linux_amd64

Precommit checks

Check your code before commit.

https://github.com/antonbabenko/pre-commit-terraform#how-to-install

pre-commit run -a