Skip to content

Commit 9b7f321

Browse files
authored
Merge pull request #60 from RADAR-base/re-org
Group AWS resources into the aws folder
2 parents 2f24a0c + 63768ac commit 9b7f321

33 files changed

+42
-31
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ crash.*.log
1414
# control as they are data points which are potentially sensitive and subject
1515
# to change depending on the environment.
1616
*.tfvars
17+
!aws/cluster/terraform.tfvars
18+
!aws/config/terraform.tfvars
1719
*.tfvars.json
1820

1921
# Ignore override files as they are usually used to override resources locally and so

.pre-commit-config.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ repos:
2121
- id: end-of-file-fixer
2222
exclude: |
2323
(?x)^(
24-
config/README.md|
25-
cluster/README.md|
24+
aws/config/README.md|
25+
aws/cluster/README.md|
2626
azure/README.md
2727
)$
2828
- id: mixed-line-ending
@@ -44,7 +44,7 @@ repos:
4444
args:
4545
- --hook-config=--parallelism-limit=1
4646
- --args=--severity MEDIUM,HIGH,CRITICAL
47-
- --args=--skip-dirs="**.terraform"
47+
- --args=--skip-dirs=.terraform
4848
- --args=--tf-exclude-downloaded-modules
4949
- id: terraform_checkov
5050
args:
@@ -57,27 +57,27 @@ repos:
5757
- repo: local
5858
hooks:
5959
- id: update-terraform-modules-cluster
60-
name: Update terraform modules for the Terraform cluster/
60+
name: Update terraform modules for the Terraform aws/cluster/
6161
language: system
62-
entry: terraform -chdir=cluster init -upgrade
62+
entry: terraform -chdir=aws/cluster init -upgrade
6363
pass_filenames: false
6464
- id: terraform-docs-cluster
65-
name: Generate docs for the Terraform cluster/
65+
name: Generate docs for the Terraform aws/cluster/
6666
language: system
67-
entry: terraform-docs markdown table cluster/
67+
entry: terraform-docs markdown table aws/cluster/
6868
pass_filenames: false
69-
files: 'cluster/'
69+
files: 'aws/cluster/'
7070
- id: update-terraform-modules-config
71-
name: Update terraform modules for the Terraform config/
71+
name: Update terraform modules for the Terraform aws/config/
7272
language: system
73-
entry: terraform -chdir=config init -upgrade
73+
entry: terraform -chdir=aws/config init -upgrade
7474
pass_filenames: false
7575
- id: terraform-docs-config
76-
name: Generate docs for the Terraform config/
76+
name: Generate docs for the Terraform aws/config/
7777
language: system
78-
entry: terraform-docs markdown table config/
78+
entry: terraform-docs markdown table aws/config/
7979
pass_filenames: false
80-
files: 'config/'
80+
files: 'aws/config/'
8181
- id: gitleaks
8282
name: Run Gitleaks
8383
language: system

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RADAR-K8s-Infrastructure
22

3-
This repository aims to provide [IaC](https://en.wikipedia.org/wiki/Infrastructure_as_code) templates for [RADAR-Kubernetes](https://github.com/RADAR-base/RADAR-Kubernetes) users who intend to deploy the platform to Kubernetes clusters supported by cloud providers such as [AWS](https://aws.amazon.com/eks/).
3+
This repository aims to provide [IaC](https://en.wikipedia.org/wiki/Infrastructure_as_code) templates for [RADAR-Kubernetes](https://github.com/RADAR-base/RADAR-Kubernetes) users who intend to deploy the platform to Kubernetes clusters supported by cloud providers such as [AWS](https://aws.amazon.com/eks/) and [Azure](https://azure.microsoft.com).
44

55
---
66

@@ -35,12 +35,14 @@ It is recommended that you use RADAR-K8s-Infrastructure as a template and create
3535

3636
## Workspaces
3737

38-
The definition of resources required for running RADAR-base components is located in the `cluster` directory, while other optional resources are defined in the `config` directory. Please treat each directory as a separate workspace and perform terraform operations individually. The `cluster` resources need to be created and made fully available before you proceed with the creation of the `config` ones.
38+
To run RADAR-base components on AWS, the definition of required resources is located in the `aws/cluster` directory, while other optional resources are defined in the `aws/config` directory. Please treat each subdirectory as a separate workspace and perform terraform operations individually. The `cluster` resources need to be created and made fully available before you proceed with the creation of the `config` ones.
3939

4040
To retain the user-specific configurations for future infrastructure updates, modify `terraform.tfvars` within the workspace and push the change to your repository. If needed, additional variables defined in `variables.tf` can also be included there.
4141
| :information_source: Important Notice |
4242
|:----------------------------------------|
43-
|As a best practice, never save raw values of secret variables in your repository. Instead, always encrypt them before committing. If your cluster is no longer in use, run `terraform destroy` to delete all the associated resources and reduce your cloud spending. If you have resources created within `config`, run `terraform destroy` in that directory before running the counterpart in `cluster`.|
43+
|As a best practice, never save raw values of secret variables in your repository. Instead, always encrypt them before committing. If your cluster is no longer in use, run `terraform destroy` to delete all the associated resources and reduce your cloud spending. If you have resources created within `aws/config`, run `terraform destroy` in that directory before running the counterpart in `aws/cluster`.|
44+
45+
To run RADAR-base components on Azure, you need a single workspace located in the `azure` directory. Please refer to [READMEs](azure/README.md) inside that directory and its subdirectories for more details.
4446

4547
## Configure credentials
4648

@@ -55,7 +57,7 @@ export TF_VAR_AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN
5557
## Create the infrastructure
5658

5759
```
58-
cd cluster
60+
cd aws/cluster
5961
```
6062

6163
```
@@ -123,16 +125,16 @@ You could also automate this value injection by implementing your own templating
123125

124126
## Configure the cluster (optional)
125127

126-
N.B.: To get external DNS, Cert Manager and SMTP working via Route 53 (if chosen as your DNS service), you need to configure your registered top-level domain and its corresponding hosted zone ID via variable `domain_name` in [config/terraform.tfvars](./config/terraform.tfvars). Additionally, set `enable_route53` to `true`.
128+
N.B.: To get external DNS, Cert Manager and SMTP working via Route 53 (if chosen as your DNS service), you need to configure your registered top-level domain and its corresponding hosted zone ID via variable `domain_name` in [aws/config/terraform.tfvars](./aws/config/terraform.tfvars). Additionally, set `enable_route53` to `true`.
127129

128130
```
129-
cd config
131+
cd aws/config
130132
terraform init
131133
terraform plan
132134
terraform apply --auto-approve
133135
```
134136

135-
Optional resource creations are disabled by default. To enable the creation of a specific resource named `X`, navigate to [config/terraform.tfvars](./config/terraform.tfvars) and update the value of `enable_X` to `true` before applying the template.
137+
Optional resource creations are disabled by default. To enable the creation of a specific resource named `X`, navigate to [aws/config/terraform.tfvars](./aws/config/terraform.tfvars) and update the value of `enable_X` to `true` before applying the template.
136138

137139
Created resources (if all enabled):
138140

@@ -157,7 +159,7 @@ devbox shell
157159
158160
To download all of the dependencies and install to Git hooks to lint the configuration before it is committed.
159161
160-
In order to support new version of EKS you need to make sure the addons that we use are compatible with the new target version. You can get a list of addons and their EKS compatibility with running `aws eks describe-addons-versions` and then searching for the addons that are defined in [cluster/data.tf](./cluster/data.tf).
162+
In order to support new version of EKS you need to make sure the addons that we use are compatible with the new target version. You can get a list of addons and their EKS compatibility with running `aws eks describe-addons-versions` and then searching for the addons that are defined in [aws/cluster/data.tf](./aws/cluster/data.tf).
161163
162164
This project also uses [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) to have a standardized commit message. Please have a look and make sure your commit message follows that.
163165
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)