Creating a VPC using Terraform as IAAC and GitHub Actions as CI/CD for the NT548.P11 course - Fall 2024 semester at University of Information Technology - VNUHCM.
vpc-terraform-github-actions
├── .github
│ └── workflows
│ └── terraform-deploy.yml /* GitHub Actions workflow file */
├── modules
│ ├── VPC
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ └── variables.tf
│ ├── NAT
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ └── variables.tf
│ ├── Route_Table
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ └── variables.tf
│ ├── Security_Groups
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ └── variables.tf
│ └── EC2
│ ├── main.tf
│ ├── outputs.tf
│ └── variables.tf
├── main.tf
├── outputs.tf
├── variables.tf
├── assets /* Images */
└── README.md /* Readme file with instructions */
-
Create AWS IAM User:
- Go to the IAM section in AWS.
- Go to
Users
section. - Create a new user with your user name.
- Attach the necessary policies.
- Now we can see our user on the AWS platform.
- Click on our user, then
Security credentials
. - Go to
Access keys
and clickCreate access key
. - Choose
CLI
. - Then
Create access key
. - Now, we can either download the CSV file to save the keys or copy them directly.
-
Configure GitHub Secrets:
-
Clone the Repository:
git clone https://github.com/meowwkhoa/vpc-terraform-github-actions.git cd vpc-terraform-github-actions
-
Create a New Branch:
git checkout -b test
-
Make Changes and Push:
- Make any necessary changes to the code.
- Stage and commit the changes:
git add . git commit -m "test" git push origin test
- Create a Pull Request:
- Go to the repository on GitHub.
- Create a pull request from the
test
branch to themain
branch.
-
Monitor Deployment:
-
The GitHub Action will trigger automatically.
-
Monitor the infrastructure changes in the AWS Management Console.
-
Public Routable
Public Routable group 12
and Private RoutablePrivate Routable group 12
. -
Public Instance
Public Instance group 12
and Private InstancePrivate Instance group 12
. -
Public Security Group
Group 12: Public Security Group
and Private Security GroupGroup 12: Private Security Group
.
-
-
Running a security scan with Checkov