🎯 To link the Cloud9-IDE in the Default VPC and the CI/CD VPC (used for the CodeBuild) to the private EKS VPC using VPC Peering.
Allows the required traffic to flow so we can communicate with the EKS Cluster from the Cloud9-IDE in the Default VPC and the CodeBuild ENI that will be provisioned in the private subnet of the CI/CD VPC.
EKS VPC
.Default VPC
.EKS VPC
.EKS Worker Nodes
Security Group allowing traffic in port 22 from the Cloud9-IDE Security Group.EKS Cluster
Security Group allowing traffic in port 443 from the Cloud9-IDE Security Groupexport TF_VAR_fully_private_cluster=true
cd modules/vpc-peering
terraform init -reconfigure -backend-config="region=${AWS_REGION}" \
-backend-config="bucket=${TF_STATE_S3_BUCKET}" \
-backend-config="key=${PROJECT_ID}-vpc-peering.tfstate" \
-backend-config="dynamodb_table=${TF_STATE_DYNAMODB_TABLE}"
terraform plan -out tfplan
terraform apply -input=false -auto-approve tfplan
cd ../..