Skip to content

Commit

Permalink
[terraform] Rename generated files to ease reviews (#1019)
Browse files Browse the repository at this point in the history
* [terraform] Rename generated files to ease reviews

* Update links
  • Loading branch information
barroco authored Apr 12, 2024
1 parent 5a93c34 commit 8a1a5e9
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Kubernetes in AWS.

## Configuration

See [variables.tf](variables.tf).
See [variables.gen.tf](variables.gen.tf).

## Design

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ and operate the cluster.

## Configuration

See [variables.tf](variables.tf).
See [variables.gen.tf](variables.gen.tf).
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ This folder only contains the terraform module which deploys the kubernetes clus

## Configuration

See [variables.tf](variables.tf).
See [variables.gen.tf](variables.gen.tf).
8 changes: 4 additions & 4 deletions deploy/infrastructure/modules/terraform-aws-dss/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ Download & install the following tools to your workstation:
### Deployment of the Kubernetes cluster

1. Create a new folder in `/deploy/infrastructure/personal/` named, for instance, `terraform-aws-dss-dev`.
2. Copy main.tf, output.tf and variables.tf to the new folder.
2. Copy main.tf, output.tf and variables.gen.tf to the new folder.
3. Copy `terraform.dev.example.tfvars` and rename to `terraform.tfvars`
4. Check that your new directory contains the following files:
- main.tf
- output.tf
- terraform.tfvars
- variables.tf
5. Set the variables in `terraform.tfvars` according to your environment. See [TFVARS.md](TFVARS.md) for variables descriptions.
- variables.gen.tf
5. Set the variables in `terraform.tfvars` according to your environment. See [TFVARS.gen.md](TFVARS.gen.md) for variables descriptions.
6. In the new directory (ie /deploy/infrastructure/personal/terraform-aws-dss-dev), initialize terraform: `terraform init`.
7. Run `terraform plan` to check that the configuration is valid. It will display the resources which will be provisioned.
8. Run `terraform apply` to deploy the cluster. (This operation may take up to 15 min.)
Expand Down Expand Up @@ -70,4 +70,4 @@ It contains scripts to operate the cluster and setup the services.
2. To delete all resources, run `tk delete .` in the workspace folder.
3. Make sure that all [load balancers](https://eu-west-1.console.aws.amazon.com/ec2/home#LoadBalancers:) and [target groups](https://eu-west-1.console.aws.amazon.com/ec2/home#TargetGroups:) have been deleted from the AWS region before next step.
4. `terraform destroy` in your infrastructure folder.
5. On the [EBS page](https://eu-west-1.console.aws.amazon.com/ec2/home#Volumes:), make sure to manually clean up the persistent storage. Note that the correct AWS region shall be selected.
5. On the [EBS page](https://eu-west-1.console.aws.amazon.com/ec2/home#Volumes:), make sure to manually clean up the persistent storage. Note that the correct AWS region shall be selected.
6 changes: 3 additions & 3 deletions deploy/infrastructure/modules/terraform-google-dss/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ Download & install the following tools to your workstation:
### Deployment of the Kubernetes cluster

1. Create a new folder in `/deploy/infrastructure/personal/` named for instance `terraform-google-dss-dev`.
2. Copy main.tf, output.tf and variables.tf to the new folder. (Note that the modules can be added to existing projects)
2. Copy main.tf, output.tf and variables.gen.tf to the new folder. (Note that the modules can be added to existing projects)
3. Copy `terraform.dev.example.tfvars` and rename to `terraform.tfvars`
4. Check that your new directory contains the following files:
- main.tf
- output.tf
- terraform.tfvars
- variables.tf
5. Set the variables in `terraform.tfvars` according to your environment. See [TFVARS.md](TFVARS.md) for variables descriptions.
- variables.gen.tf
5. Set the variables in `terraform.tfvars` according to your environment. See [TFVARS.gen.md](TFVARS.gen.md) for variables descriptions.
6. In the new directory (ie /deploy/infrastructure/personal/terraform-google-dss-dev), initialize terraform: `terraform init`.
7. Run `terraform plan` to check that the configuration is valid. It will display the resources which will be provisioned.
8. Run `terraform apply` to deploy the cluster. (This operation may take up to 15 min.)
Expand Down
2 changes: 1 addition & 1 deletion deploy/infrastructure/utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ This directory contains the following tools to simplify the management of the te
## `generate_terraform_variables.sh`
Terraform variables can't be shared between modules without repeating their definition at every level of encapsulation.
To prevent repeating ourselves and to maintain a consistent level of quality for every module and dependencies, this script takes variables
in the `definitions` directory and creates a `variables.tf` file in each modules with the appropriate content.
in the `definitions` directory and creates a `variables.gen.tf` file in each modules with the appropriate content.
Assignment of `definitions` files to modules is made in `variables.py`.
4 changes: 2 additions & 2 deletions deploy/infrastructure/utils/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import hcl2

DEFINITIONS_PATH = join(abspath(dirname(__file__)), "definitions")
GENERATED_TFVARS_MD_FILENAME = "TFVARS.md"
GENERATED_VARIABLES_FILENAME = "variables.tf"
GENERATED_TFVARS_MD_FILENAME = "TFVARS.gen.md"
GENERATED_VARIABLES_FILENAME = "variables.gen.tf"
INTERNAL_VARIABLES_FILENAME = "variables_internal.tf"
GENERATED_COMMENT = """
# This file has been automatically generated by /deploy/infrastructure/utils/generate_terraform_variables.py.
Expand Down
File renamed without changes.

0 comments on commit 8a1a5e9

Please sign in to comment.