diff --git a/demo.sh b/demo.sh new file mode 100644 index 0000000..5d8a10e --- /dev/null +++ b/demo.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +BRANCH="Add_GCP_Firewall_Config_${RANDOM}" + +######################## +# include the magic +######################## +. ./demo-magic/demo-magic.sh + +# hide the evidence +clear + +# Run Terraform Plan +pe "terraform plan" + +# Create Branch +pe "git checkout -b ${BRANCH}" + +# Change Configuration +pe "vi main.tf" + +# Run Terraform Plan +pe "terraform plan" + +# Stage the changes +pe "git add ." + +# Commit the changes +pe "git commit -m 'Update GCP Firewall Security'" + +# Push the changes +pe "git push origin ${BRANCH}" + +# Create Pull Request +pe "gh pr create \\ +--title 'Update firewall config security' \\ +--body 'This PR closes the open access' \\ +--label 'enhancement'" diff --git a/main.tf b/main.tf index 18a7216..4019d6b 100644 --- a/main.tf +++ b/main.tf @@ -20,7 +20,6 @@ terraform{ } - provider "google" { // credentials = file("./tmp/credentials2.json") @@ -39,8 +38,8 @@ resource "google_compute_firewall" "default" { ports = ["22"] } - source_ranges = ["192.168.1.0/24"] -// source_ranges = ["0.0.0.0/0"] +// source_ranges = ["192.168.1.0/24"] + source_ranges = ["0.0.0.0/0"] } resource "google_compute_network" "default" { diff --git a/tools/demo-magic b/tools/demo-magic new file mode 160000 index 0000000..10abf53 --- /dev/null +++ b/tools/demo-magic @@ -0,0 +1 @@ +Subproject commit 10abf5390b6d5461155dc58012081490598f7bad