Skip to content

Commit 4d10a08

Browse files
authored
Merge pull request #12 from hadagalikarthik/patch-1
Update Readme.md
2 parents 48d7d3c + 36247c5 commit 4d10a08

File tree

1 file changed

+8
-63
lines changed

1 file changed

+8
-63
lines changed

workflow guides/nginx-nic-napv5/Readme.md

+8-63
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ This workflow requires the following secrets to be configured in your GitHub rep
6868
| `AWS_SESSION_TOKEN` | Secret | Session token for temporary AWS credentials (if using MFA) |
6969
| `NGINX_JWT` | Secret | JSON Web Token for NGINX license authentication |
7070
| `NGINX_Repo_CRT` | Secret | NGINX Certificate |
71-
| `NGINX_Repo_KEY` | Secret | Private key for securing HTTPS and verifying SSL/TLS certificates |
71+
| `NGINX_Repo_KEY` | Secret | Private key for securing HTTPS and verifying SSL/TLS certificates |
72+
| `TF_VAR_AWS_S3_BUCKET_NAME` | Secret | Unique S3 bucket name |
73+
| `TF_VAR_AWS_REGION` | Secret | AWS region. Note: The region should support atleast two availability zones |
7274
### How to Add Secrets
7375

7476
1. Navigate to your GitHub repository
@@ -95,65 +97,8 @@ This workflow requires the following secrets to be configured in your GitHub rep
9597
Rename `infra/terraform.tfvars.examples` to `infra/terraform.tfvars` and add the following data:
9698
* project_prefix = "Your project identifier name in **lower case** letters only - this will be applied as a prefix to all assets"
9799
* resource_owner = "Your-name"
98-
* aws_region = "AWS Region" ex. us-east-1
99-
* azs = ["us-east-1a", "us-east1b"] - Change to Correct Availability Zones based on selected Region
100100

101-
### STEP 3: Modify variable.tf
102-
Modify the `S3/variable.tf` file inside the `S3 directory`:
103-
104-
### Example Configuration:
105-
```hcl
106-
variable "tf_state_bucket" {
107-
type = string
108-
description = "S3 bucket for Terraform state"
109-
default = "your-unique-bucket-name"
110-
}
111-
```
112-
### STEP 4: Configure Backend.tf
113-
Add the S3 bucket name to the `Backend.tf` file in the `Infra/Backend.tf`, `eks-cluster/Backend.tf`, `Nap/Backend.tf`, `Policy/Backend.tf`, and `Arcadia/Backend.tf` directories.
114-
115-
### Example Configuration:
116-
117-
```hcl
118-
terraform {
119-
backend "s3" {
120-
bucket = "your-unique-bucket-name" # Your S3 bucket name
121-
key = "infra/terraform.tfstate" # Path to state file
122-
region = "us-east-1" # AWS region
123-
dynamodb_table = "terraform-lock-table" # DynamoDB table for state locking
124-
encrypt = true
125-
}
126-
}
127-
```
128-
129-
### STEP 5: Configuring `data.tf` for Remote State
130-
131-
Each `data.tf` file in the following directories needs to use the correct format:
132-
133-
- `eks-cluster/data.tf`
134-
- `Nap/data.tf`
135-
- `Policy/data.tf`
136-
- `Arcadia/data.tf`
137-
138-
### Example Configuration:
139-
140-
```hcl
141-
data "terraform_remote_state" "infra" {
142-
backend = "s3"
143-
config = {
144-
bucket = "your-unique-bucket-name" # Your S3 bucket name
145-
key = "infra/terraform.tfstate" # Path to your state file
146-
region = "us-east-1" # AWS region
147-
}
148-
}
149-
```
150-
### STEP 6: Set Bucket Name
151-
Add the name of your S3 bucket inside the and [`destroy-nic-napv5.yml`](https://github.com/f5devcentral/nginx_automation_examples/blob/main/.github/workflows/destroy-nic-napv5.yml) workflow file, which is located in the Terraform _S3 job:
152-
153-
* echo "bucket_name="your-unique-bucket-name" >> $GITHUB_OUTPUT
154-
155-
156-
### STEP 7: Policy
101+
### STEP 3: Policy
157102

158103
The repository includes a default policy file named `policy.json`, which can be found in the `policy` directory.
159104

@@ -175,13 +120,13 @@ Users have the option to utilize the existing policy or, if preferred, create a
175120
![Push](assets/policy.png)
176121

177122

178-
### STEP 8: Commit changes
123+
### STEP 4: Commit changes
179124

180125

181126
![commit](assets/commit.png)
182127

183128

184-
### STEP 9: Deployment Workflow
129+
### STEP 5: Deployment Workflow
185130

186131
* **Step 1**: Check out a branch for the deploy workflow using the following naming convention
187132
* nic-napv5 deployment branch: apply-nic-napv5
@@ -201,7 +146,7 @@ Users have the option to utilize the existing policy or, if preferred, create a
201146
![Apply](assets/apply.png)
202147

203148

204-
### STEP 10: Validation
149+
### STEP 6: Validation
205150

206151
Users can now access the application through the NGINX Ingress Controller Load Balancer, which enhances security for the backend application by implementing the configured Web Application Firewall (WAF) policies. This setup not only improves accessibility but also ensures that the application is protected from various web threats.
207152

@@ -216,7 +161,7 @@ Users can now access the application through the NGINX Ingress Controller Load B
216161
![Block](assets/block.png)
217162

218163

219-
### STEP 11: Destroy Workflow
164+
### STEP 7: Destroy Workflow
220165

221166
* **Step 1**: From your main branch, check out a new branch for the destroy workflow using the following naming convention
222167
* nic-napv5 destroy branch: destroy-nic-napv5

0 commit comments

Comments
 (0)