Skip to content

merger #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 84 commits into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
9e2702a
Your commit message
akashdan90 Feb 10, 2025
a0749bb
Create NIC-NAP-apply.yml
akananth Feb 11, 2025
77dd095
Rename NIC-NAP-apply.yml to Nginx-nap-apply.yml
akananth Feb 11, 2025
ff2c387
Update Nginx-nap-apply.yml
akananth Feb 11, 2025
21e52e1
Fix missing infra directory
akashdan90 Feb 11, 2025
94a381f
Update and rename terraform.tfvars.examples to terraform.tfvars
akananth Feb 11, 2025
b92dbb1
Add or update GitHub Actions workflow
akashdan90 Feb 11, 2025
9a6ce53
Update data.tf
akananth Feb 11, 2025
24fb397
Update data.tf
akananth Feb 11, 2025
250acf0
Update nic.tf
akananth Feb 11, 2025
d9545e0
Update nap.tf
akananth Feb 11, 2025
1168a54
Update terraform.tfvars
akananth Feb 11, 2025
3501160
Update terraform.tfvars
akananth Feb 11, 2025
a5c333a
Update terraform.tfvars
akananth Feb 11, 2025
25b9a8e
Update terraform.tfvars
akananth Feb 11, 2025
21e98cb
Create AWS-NIC-apply.yml
akananth Feb 11, 2025
611d110
Update Nginx-nap-apply.yml
akananth Feb 11, 2025
f9cc034
Update and rename Nginx-nap-apply.yml to aws-nap-apply.yml
akananth Feb 11, 2025
4bc5733
Update aws-nap-apply.yml
akananth Feb 11, 2025
a46c25f
Update terraform.tfvars
akananth Feb 11, 2025
3c4e74a
Update aws-nap-apply.yml
akananth Feb 11, 2025
75dd223
Update aws-nap-apply.yml
akananth Feb 11, 2025
d3af20f
Update variables.tf
akananth Feb 11, 2025
504ad7f
Update variables.tf
akananth Feb 11, 2025
bbcb31b
Update variables.tf
akananth Feb 12, 2025
1db16d6
Update main.tf
akananth Feb 12, 2025
61655f1
Update variables.tf
akananth Feb 12, 2025
fc69142
Update network.tf
akananth Feb 12, 2025
246cdb3
Update network.tf
akananth Feb 12, 2025
e341183
Update variables.tf
akananth Feb 12, 2025
b1ec393
Update network.tf
akananth Feb 12, 2025
539be29
Update variables.tf
akananth Feb 12, 2025
9abc7a7
Update terraform.tfvars
akananth Feb 12, 2025
3cac66b
Update grafana.tf
akananth Feb 12, 2025
8bfaaa9
Update prometheus.tf
akananth Feb 12, 2025
a052a27
Update prometheus.tf
akananth Feb 12, 2025
2c73e13
Update nic.tf
akananth Feb 12, 2025
95a92ed
Update nap.tf
akananth Feb 12, 2025
482d0ce
Update nap.tf
akananth Feb 12, 2025
b710a95
Update grafana.tf
akananth Feb 12, 2025
ac4490f
Update prometheus.tf
akananth Feb 12, 2025
c1e8b7f
Delete .github/workflows/AWS-NIC-apply.yml
akananth Feb 12, 2025
276186a
Create aws-destroy.yml
akananth Feb 12, 2025
cf8abf2
Update aws-destroy.yml
akananth Feb 12, 2025
9868d6d
Update aws-destroy.yml
akananth Feb 12, 2025
8aac542
Update aws-destroy.yml
akananth Feb 12, 2025
c06a155
Update aws-destroy.yml
akananth Feb 12, 2025
3858a43
Update aws-destroy.yml
akananth Feb 12, 2025
804a433
Update aws-destroy.yml
akananth Feb 12, 2025
45b76a7
Update aws-destroy.yml
akananth Feb 12, 2025
0753c54
Update grafana.tf
akananth Feb 12, 2025
8dfda30
Update prometheus.tf
akananth Feb 12, 2025
a67be1d
Update nap.tf
akananth Feb 12, 2025
7c1a6a9
Update aws-destroy.yml
akananth Feb 12, 2025
cda1504
Update aws-nap-apply.yml
akananth Feb 12, 2025
dec2152
Update aws-destroy.yml
akananth Feb 12, 2025
3852cf8
Delete .github/workflows/aws-destroy.yml
akananth Feb 12, 2025
db81e54
Delete .github/workflows/aws-nap-apply.yml
akananth Feb 12, 2025
f3f4d53
Add files via upload
akananth Feb 12, 2025
eceef27
Update eks_cluster.tf
akananth Feb 14, 2025
7617ec1
Update terraform.tfvars
akananth Feb 14, 2025
f988bb0
Update nap.tf
akananth Mar 3, 2025
72bf98d
Update nap.tf
akananth Mar 3, 2025
e931e88
Delete nginx/nap-deployment-aws-cloud directory
akananth Mar 18, 2025
9f20440
Delete requirements.txt
akananth Mar 18, 2025
71ad203
Delete code_of_conduct.md
akananth Mar 18, 2025
5e440a8
Delete README.md
akananth Mar 18, 2025
e4c5114
Delete .DS_Store
akananth Mar 18, 2025
00e416c
Delete nic directory
akananth Mar 20, 2025
31e6ed5
Delete nap/charts/nginx-plus-ingress directory
akananth Mar 20, 2025
99de5bb
Create README.md
akananth Mar 20, 2025
8fd97f9
Update README.md
akananth Mar 21, 2025
18ed6b1
Update README.md
akananth Mar 24, 2025
7f99bd8
Update README.md
akananth Mar 24, 2025
9553d5d
Update README.md
akananth Mar 24, 2025
f9312ce
Update README.md
akananth Mar 24, 2025
45abf7b
Update README.md
akananth Mar 24, 2025
837a120
Update README.md
akananth Mar 24, 2025
0d06c91
Update README.md
akananth Mar 25, 2025
2097e7f
Update README.md
akananth Mar 25, 2025
00a6e40
Update README.md
akananth Mar 25, 2025
e7a2e3b
Update README.md
akananth Mar 25, 2025
8c4eaaf
Update README.md
akananth Mar 25, 2025
a043b56
Update README.md
akananth Mar 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
108 changes: 83 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,104 @@
## Overview
# Deploying NGINX Ingress Controller with NGINX WAFv5 in AWS
---------------------------------------------------------------

This is a consolidated automation repo for different verified designs customer use case examples using `F5 Nginx`. Users can use this to test a specific use case end to end by using the automation code available in this repo. </br>
</br>
**NOTE: To learn about each use case check the devcentral article link provided in each scenario folder README** </br>
</br>
Introduction :
---------------
This demo guide offers a step-by-step walkthrough for configuring the NGINX Ingress Controller with NGINX App Protect v5 on AWS Cloud, using Terraform scripts to automate the deployment. For more information, refer to the devcentral article: <Coming Soon>


## Getting Started

## Prerequisites

* [AWS Account](https://aws.amazon.com) - Due to the assets being created, free tier will not work.
* The F5 NGINX App Protect AMI being used from the [AWS Marketplace](https://aws.amazon.com/marketplace) should be subsribed to your account
* Please make sure resources like VPC and Elastic IP's are below the threshold limit in that aws region
* [NGINX Plus with App Protect and NGINX Ingress Controller license](https://www.nginx.com/free-trial-request/)
* [AWS Account](https://aws.amazon.com) - Due to the assets being created, the free tier will not work.
* [GitHub Account](https://github.com)

## Steps to execute
## Assets

* **nap:** NGINX Ingress Controller for Kubernetes with NGINX App Protect (WAF and API Protection)
* **infra:** AWS Infrastructure (VPC, IGW, etc.)
* **eks:** AWS Elastic Kubernetes Service
* **arcadia:** Arcadia Finance test web application and API
* **policy:** NGINX WAF Compiler Docker and Policy
* **S3:** Amazon S3 bucket and IAM role and policy for storage.

## Tools

* **Cloud Provider:** AWS
* **IAC:** Terraform
* **IAC State:** Amazon S3
* **CI/CD:** GitHub Actions


## GitHub Secrets Configuration

This workflow requires the following secrets to be configured in your GitHub repository:

### Required Secrets

| Secret Name | Type | Description | Example Value/Format |
|------------------------|---------|-----------------------------------------------------------------------------|----------------------------|
| `AWS_ACCESS_KEY_ID` | Secret | AWS IAM user access key ID with sufficient permissions | `AKIAXXXXXXXXXXXXXXXX` |
| `AWS_SECRET_ACCESS_KEY` | Secret | Corresponding secret access key for the AWS IAM user | (40-character mixed case string) |
| `AWS_SESSION_TOKEN` | Secret | Session token for temporary AWS credentials (if using MFA) | (Base64-encoded string) |
| `NGINX_JWT` | Secret | JSON Web Token for NGINX license authentication | `eyJhbGciOi...` (JWT format) |
| `NGINX_CRT` | Secret | NGINX Certificate in PKCS#12 format | `api.p12` file contents |
| `NGINX_KEY` | Secret | Private key for securing HTTPS and verifying SSL/TLS certificates | YourCertificatePasrivatekey|

### How to Add Secrets

1. Navigate to your GitHub repository
2. Go to **Settings** → **Secrets and variables** → **Actions**
3. Click **New repository secret**
4. Enter the secret name exactly as shown above
5. Paste the secret value
6. Click **Add secret**


## Workflow Runs

**STEP 1:** Check out a branch for the workflow you wish to run using the following naming convention.

**DEPLOY**

| Workflow | Branch Name |
| ------------ | ---------------- |
| NGINX V5-NIC/NAP Apply| apply-NIC/NAP |

1. Clone the repo locally and update AWS credentials like `access keys`, `secret key` and `session token` be in `settings` --> `Secrets` --> `Actions` section <br />
![image](https://user-images.githubusercontent.com/6093830/209962425-1c3452ec-9b32-4509-adb5-cc85d4a67a10.png)
> Note: Above values typically expire in every 12 hours. If you are not using session token please remove this field accordingly in workflow file step name-`configure aws credentials` in all jobs

**DESTROY**

| Workflow | Branch Name |
| ------------ | ----------------- |
| NGINX V5-NIC/NAP Destroy| destroy-NIC/NAP |

2. EC2 keys should be updated properly in `settings` --> `Secrets` --> `Actions` section <br />
> Note: Make sure passwords follow company security standards like alpha numeric, etc. <br />

3. EC2 key related pem and pub file should be copied to terraform folder in your use case<br />

4. Make sure you have subscribed to the `NGINX App Protect AMI` in AWS account <br />
**STEP 2:** Rename `infra/terraform.tfvars.examples` to `infra/terraform.tfvars` and add the following data:
* project_prefix = "Your project identifier name in **lower case** letters only - this will be applied as a prefix to all assets"
* resource_owner = "Your-name"
* aws_region = "AWS Region" ex. us-east-1
* azs = ["us-east-1a", "us-east1b"] - Change to Correct Availability Zones based on selected Region
* Also update assets boolean value as per your work-flows

5. Update your `ENV` variables in `/data/testbed-data.json` file in your use case folder <br />
**STEP 3:** In the `S3 directory`, inside the `variable.tf` file modify the following data
* description = "S3 bucket for Terraform remote state storage"
* default = "your-unique-bucket-name" # Replace with your actual bucket name


6. Install self hosted runner and add it to this repo <br />
**STEP 4:** Commit and push your build branch to your forked repo
* Build will run and can be monitored in the GitHub Actions tab and TF Cloud console

7. Make sure `awscli`, `kubectl`, `ansible-playbook`, `pytest`, `git` and other required tools are installed in this private custom runner. Refer `requirements.txt` file for more details <br />

> Note: Please install and make sure python packages like `pytest-html`, `awscli==1.18.105` and `botocore==1.17.28` are available with their correct versions in runner to avoid failures <br />
**STEP 5:** Once the pipeline is complete, verify that your assets were deployed or destroyed based on your workflow.

8. Go to `Actions` tab and select your article work-flow <br />
**NOTE:** The autocert process takes time. It may be 5 to 10 minutes before Let's Encrypt has provided the cert.

9. Click on `Run Workflow` option and execute it <br />

10. Check the CI/CD jobs execution and check the artifacts for more details <br />
<br />
## Development

Outline any requirements to setup a development environment if someone would like to contribute. You may also link to another file for this information.

## Support

Expand All @@ -56,7 +114,7 @@ Please refer to the [F5 DevCentral Community Code of Conduct](code_of_conduct.md

## Copyright

Copyright 2014-2023 F5 Networks Inc.
Copyright 2014-2020 F5 Networks Inc.

### F5 Networks Contributor License Agreement

Expand Down
Loading