Skip to content

Commit

Permalink
make region flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
nour-sb committed Jun 27, 2024
1 parent 3556e89 commit f10ae4b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ap-southeast-1
AWS_REGION: ${{ secrets.AWS_REGION }}
EMAIL_ADDRESS: ${{ secrets.EMAIL_ADDRESS }}
run: |
echo "Running init -----------"
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ name: Destroy the AWS environment

# Controls when the workflow will run
on:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand All @@ -19,13 +18,13 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Running Terraform Destroy command
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ap-southeast-1
AWS_REGION: ${{ secrets.AWS_REGION }}
run: |
sudo apt update
sudo apt install -y gnupg software-properties-common curl
Expand All @@ -38,4 +37,4 @@ jobs:
echo "Running init -----------"
./scripts/init
echo "Running destroy -----------"
./scripts/destroy
./scripts/destroy
1 change: 1 addition & 0 deletions scripts/init
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ if [ ! -f $tf_vars ]; then
| sed "s/E_ADDRESS/$(echo $EMAIL_ADDRESS | sed 's/\//\\\//g')/g" \
| sed "s/PUT_ACCESS_KEY/$(echo $AWS_ACCESS_KEY_ID | sed 's/\//\\\//g')/g" \
| sed "s/PUT_SECRET_KEY/$(echo $AWS_SECRET_ACCESS_KEY | sed 's/\//\\\//g')/g" \
| sed "s/PUT_REGION/$(echo $AWS_REGION | sed 's/\//\\\//g')/g" \
> $tf_vars
else
echo "Terraform vars file already exists, skipping"
Expand Down
2 changes: 1 addition & 1 deletion terraform/terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
aws_access_key = "PUT_ACCESS_KEY"
aws_secret_key = "PUT_SECRET_KEY"
region = "ap-southeast-1"
region = "PUT_REGION"
vpc_cidr = "10.0.0.0/16"
vpc_public_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
gateway_network = "10.10.0.0/24"
Expand Down

0 comments on commit f10ae4b

Please sign in to comment.