From 4f3f2ba23ace688b9af4d7b4bb0ee9f99ec17906 Mon Sep 17 00:00:00 2001 From: WeRockStar Date: Thu, 16 May 2024 17:07:08 +0700 Subject: [PATCH] patch all resource into README --- infra/iac/README.md | 1 + infra/iac/argocd-app/README.md | 5 +++-- infra/iac/eks/README.md | 38 ++++++++++++++++------------------ infra/iac/main.tf | 2 +- infra/iac/provides.tf | 3 +++ infra/iac/rds/README.md | 13 ++++++++---- infra/iac/sonarqube/README.md | 7 ++++--- infra/iac/variables.tf | 3 +-- 8 files changed, 40 insertions(+), 32 deletions(-) create mode 100644 infra/iac/provides.tf diff --git a/infra/iac/README.md b/infra/iac/README.md index 55ad249..f18f33c 100644 --- a/infra/iac/README.md +++ b/infra/iac/README.md @@ -37,6 +37,7 @@ No providers. | [eks](#module\_eks) | ./eks | n/a | | [rds](#module\_rds) | ./rds | n/a | | [sonarqube](#module\_sonarqube) | ./sonarqube | n/a | +| [vpc](#module\_vpc) | ./vpc | n/a | ## Resources diff --git a/infra/iac/argocd-app/README.md b/infra/iac/argocd-app/README.md index 1ff20c7..e7a4678 100644 --- a/infra/iac/argocd-app/README.md +++ b/infra/iac/argocd-app/README.md @@ -24,8 +24,8 @@ This module intended to create ArgoCD application for EKS cluster | Name | Version | |------|---------| -| [argocd](#provider\_argocd) | 6.1.1 | -| [aws](#provider\_aws) | 5.47.0 | +| [argocd](#provider\_argocd) | >= 6.0.0, < 7.0.0 | +| [aws](#provider\_aws) | ~> 5.0 | ## Modules @@ -47,6 +47,7 @@ No modules. | [argocd\_password](#input\_argocd\_password) | ArgoCD password | `string` | n/a | yes | | [argocd\_server\_addr](#input\_argocd\_server\_addr) | ArgoCD server address | `string` | `"argocd.werockstar.dev:443"` | no | | [argocd\_username](#input\_argocd\_username) | ArgoCD username | `string` | `"admin"` | no | +| [batch\_no](#input\_batch\_no) | Workshop batch number | `string` | `"b2"` | no | | [cluster\_name](#input\_cluster\_name) | The name of the EKS cluster | `string` | `"eks-go-workshop"` | no | ## Outputs diff --git a/infra/iac/eks/README.md b/infra/iac/eks/README.md index 908f1e9..12c7746 100644 --- a/infra/iac/eks/README.md +++ b/infra/iac/eks/README.md @@ -80,9 +80,9 @@ data: | Name | Version | |------|---------| -| [aws](#provider\_aws) | 5.48.0 | +| [aws](#provider\_aws) | ~> 5.48.0 | | [cloudflare](#provider\_cloudflare) | 4.31.0 | -| [helm](#provider\_helm) | 2.13.1 | +| [helm](#provider\_helm) | ~> 2.13 | | [kubernetes](#provider\_kubernetes) | 2.29.0 | ## Modules @@ -93,7 +93,6 @@ No modules. | Name | Type | |------|------| -| [aws_eip.nat](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eip) | resource | | [aws_eks_cluster.eks-cluster](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_cluster) | resource | | [aws_eks_node_group.private-nodes](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_node_group) | resource | | [aws_iam_role.eks_iam](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | @@ -102,19 +101,6 @@ No modules. | [aws_iam_role_policy_attachment.nodes-AmazonEC2ContainerRegistryReadOnly](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | | [aws_iam_role_policy_attachment.nodes-AmazonEKSWorkerNodePolicy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | | [aws_iam_role_policy_attachment.nodes-AmazonEKS_CNI_Policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | -| [aws_internet_gateway.igw](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/internet_gateway) | resource | -| [aws_nat_gateway.nat](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/nat_gateway) | resource | -| [aws_route_table.private](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route_table) | resource | -| [aws_route_table.public](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route_table) | resource | -| [aws_route_table_association.private-1a](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route_table_association) | resource | -| [aws_route_table_association.private-1b](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route_table_association) | resource | -| [aws_route_table_association.public-1a](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route_table_association) | resource | -| [aws_route_table_association.public-1b](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route_table_association) | resource | -| [aws_subnet.private-1a](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet) | resource | -| [aws_subnet.private-1b](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet) | resource | -| [aws_subnet.public-1a](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet) | resource | -| [aws_subnet.public-1b](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet) | resource | -| [aws_vpc.workshop](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc) | resource | | [cloudflare_record.argocd](https://registry.terraform.io/providers/cloudflare/cloudflare/4.31.0/docs/resources/record) | resource | | [cloudflare_record.cnames-dev](https://registry.terraform.io/providers/cloudflare/cloudflare/4.31.0/docs/resources/record) | resource | | [cloudflare_record.cnames-prod](https://registry.terraform.io/providers/cloudflare/cloudflare/4.31.0/docs/resources/record) | resource | @@ -130,14 +116,26 @@ No modules. |------|-------------|------|---------|:--------:| | [argocd\_namespace](#input\_argocd\_namespace) | The namespace where ArgoCD is installed | `string` | `"argocd"` | no | | [batch\_no](#input\_batch\_no) | Workshop batch number | `string` | `"b2"` | no | +| [capacity\_type](#input\_capacity\_type) | The capacity type for the EKS nodes | `string` | n/a | yes | | [cloudflare\_api\_token](#input\_cloudflare\_api\_token) | Cloudflare API Token | `string` | n/a | yes | -| [cluster\_name](#input\_cluster\_name) | The name of the EKS cluster | `string` | `"eks-go-workshop"` | no | +| [cluster\_name](#input\_cluster\_name) | The name of the EKS cluster | `string` | n/a | yes | +| [desired\_size](#input\_desired\_size) | The desired size of the EKS nodes | `number` | n/a | yes | | [eks\_node\_role](#input\_eks\_node\_role) | The IAM role for the EKS nodes | `string` | `"eks-nodes-role"` | no | | [eks\_role](#input\_eks\_role) | The IAM role for the EKS cluster | `string` | `"eks-go-workshop-role"` | no | +| [igw\_id](#input\_igw\_id) | The ID of the Internet Gateway | `string` | n/a | yes | | [ingress\_namespace](#input\_ingress\_namespace) | The namespace where the Ingress Controller is installed | `string` | `"ingress-nginx"` | no | -| [nat\_name](#input\_nat\_name) | The name of the NAT Gateway | `string` | `"go-workshop-nat"` | no | -| [subdomains](#input\_subdomains) | List of subdomains | `list(string)` |
[
"group-0",
"group-1",
"group-2",
"group-3",
"group-4",
"group-5"
]
| no | -| [vpc\_name](#input\_vpc\_name) | The name of the VPC | `string` | `"go-workshop-vpc"` | no | +| [instance\_type](#input\_instance\_type) | The instance type for the EKS nodes | `string` | n/a | yes | +| [max\_size](#input\_max\_size) | The maximum size of the EKS nodes | `number` | n/a | yes | +| [min\_size](#input\_min\_size) | The minimum size of the EKS nodes | `number` | n/a | yes | +| [nat\_id](#input\_nat\_id) | ID of the NAT Gateway | `string` | n/a | yes | +| [subdomains](#input\_subdomains) | List of subdomains | `list(string)` | n/a | yes | +| [subnet\_private-1a](#input\_subnet\_private-1a) | ID of the private subnet in AZ 1a | `string` | n/a | yes | +| [subnet\_private-1b](#input\_subnet\_private-1b) | ID of the private subnet in AZ 1b | `string` | n/a | yes | +| [subnet\_private-1c](#input\_subnet\_private-1c) | ID of the private subnet in AZ 1c | `string` | n/a | yes | +| [subnet\_public-1a](#input\_subnet\_public-1a) | ID of the public subnet in AZ 1a | `string` | n/a | yes | +| [subnet\_public-1b](#input\_subnet\_public-1b) | ID of the public subnet in AZ 1b | `string` | n/a | yes | +| [subnet\_public-1c](#input\_subnet\_public-1c) | ID of the public subnet in AZ 1c | `string` | n/a | yes | +| [vpc\_id](#input\_vpc\_id) | ID of the VPC | `string` | n/a | yes | | [zone\_id](#input\_zone\_id) | Cloudflare Zone ID | `string` | `"460c65b55ec2a251ab45cf8eedac4734"` | no | ## Outputs diff --git a/infra/iac/main.tf b/infra/iac/main.tf index 8db3974..c97e079 100644 --- a/infra/iac/main.tf +++ b/infra/iac/main.tf @@ -36,7 +36,7 @@ module "rds" { source = "./rds" db_password = var.rds_db_password db_username = var.rds_db_username - db_name = "workshop" + db_name = var.rds_db_name rds_vpc_id = module.vpc.vpc_id rds_subnet_public-1a = module.vpc.subnet_public-1a rds_subnet_public-1b = module.vpc.subnet_public-1b diff --git a/infra/iac/provides.tf b/infra/iac/provides.tf new file mode 100644 index 0000000..104ed4a --- /dev/null +++ b/infra/iac/provides.tf @@ -0,0 +1,3 @@ +terraform { + required_version = "~> 1.8.0" +} diff --git a/infra/iac/rds/README.md b/infra/iac/rds/README.md index 8ad4315..6022ad5 100644 --- a/infra/iac/rds/README.md +++ b/infra/iac/rds/README.md @@ -10,7 +10,7 @@ | Name | Version | |------|---------| -| [aws](#provider\_aws) | 5.48.0 | +| [aws](#provider\_aws) | ~> 5.0 | ## Modules @@ -21,16 +21,21 @@ No modules. | Name | Type | |------|------| | [aws_db_instance.postgres](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance) | resource | +| [aws_db_subnet_group.db_subnet_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_subnet_group) | resource | | [aws_security_group.db-sg](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource | -| [aws_vpc.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc) | data source | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [db\_name](#input\_db\_name) | database name | `string` | `"workshop"` | no | +| [db\_name](#input\_db\_name) | database name | `string` | n/a | yes | | [db\_password](#input\_db\_password) | password for db | `string` | n/a | yes | | [db\_username](#input\_db\_username) | username for db | `string` | n/a | yes | +| [publicly\_accessible](#input\_publicly\_accessible) | Whether the RDS instance is publicly accessible | `bool` | n/a | yes | +| [rds\_subnet\_public-1a](#input\_rds\_subnet\_public-1a) | ID of the public subnet in AZ 1a | `string` | n/a | yes | +| [rds\_subnet\_public-1b](#input\_rds\_subnet\_public-1b) | ID of the public subnet in AZ 1b | `string` | n/a | yes | +| [rds\_subnet\_public-1c](#input\_rds\_subnet\_public-1c) | ID of the public subnet in AZ 1c | `string` | n/a | yes | +| [rds\_vpc\_id](#input\_rds\_vpc\_id) | ID of the VPC | `string` | n/a | yes | ## Outputs @@ -39,4 +44,4 @@ No modules. | [database\_endpoint](#output\_database\_endpoint) | n/a | | [database\_name](#output\_database\_name) | n/a | | [database\_port](#output\_database\_port) | n/a | - \ No newline at end of file + diff --git a/infra/iac/sonarqube/README.md b/infra/iac/sonarqube/README.md index 3758ed2..59ad0b6 100644 --- a/infra/iac/sonarqube/README.md +++ b/infra/iac/sonarqube/README.md @@ -20,9 +20,9 @@ sudo cat /home/bitnami/bitnami_credentials | Name | Version | |------|---------| -| [aws](#provider\_aws) | 5.47.0 | -| [cloudflare](#provider\_cloudflare) | 4.30.0 | -| [local](#provider\_local) | 2.5.1 | +| [aws](#provider\_aws) | ~> 5.0 | +| [cloudflare](#provider\_cloudflare) | >= 4.0.0, < 5.0.0 | +| [local](#provider\_local) | >= 2.0.0 | ## Modules @@ -49,6 +49,7 @@ No modules. |------|-------------|------|---------|:--------:| | [cloudflare\_api\_token](#input\_cloudflare\_api\_token) | Cloudflare API Token | `string` | n/a | yes | | [instance\_name](#input\_instance\_name) | Name of the instance | `string` | `"sonarqube"` | no | +| [instance\_type](#input\_instance\_type) | Instance type | `string` | n/a | yes | | [zone\_id](#input\_zone\_id) | Cloudflare Zone ID | `string` | `"460c65b55ec2a251ab45cf8eedac4734"` | no | ## Outputs diff --git a/infra/iac/variables.tf b/infra/iac/variables.tf index 9339d57..31a5eab 100644 --- a/infra/iac/variables.tf +++ b/infra/iac/variables.tf @@ -36,6 +36,5 @@ variable "rds_db_username" { variable "rds_db_name" { type = string - default = "workshop" - description = "database name" + description = "initial database name" }