Skip to content

Instantly share code, notes, and snippets.

View amasucci's full-sized avatar
😜
Thinking OutOfDevOps

Anto amasucci

😜
Thinking OutOfDevOps
View GitHub Profile
@amasucci
amasucci / Workload-identity-federation.md
Created May 29, 2023 14:15
How to configure workload identity federation in GCP and GitHub

workload-identity-federation

We have two buckets:

  • dev-storage-2023
  • prd-storage-2023
export PROJECT_ID="blue-project-378421"
export PROJECT_NUMBER="32549352397"
@amasucci
amasucci / cloud-config.sh
Created March 14, 2023 16:50
Terraform Automation with GitHub Workflows and Workload Identity Federation
export PROJECT_ID="INSERT-PROJECT-ID"
export PROJECT_NUMBER="INSERT-PROJECT-NUMBER"
export STATE_BUCKET="INSERT-STATE-BUCKET-NAME"
gcloud storage buckets create gs://$STATE_BUCKET --project=$PROJECT_ID --default-storage-class=STANDARD --location=EUROPE-WEST1 --uniform-bucket-level-access
gcloud iam workload-identity-pools create github \
--project=$PROJECT_ID \
--location="global" \
@amasucci
amasucci / config-gh-and-gcp.sh
Last active January 29, 2024 17:58
How to configure GitHub and Workload Identity Federation in GCP
export PROJECT_ID="INSERT-PROJECT-ID"
export PROJECT_NUMBER="INSERT-PROJECT-NUMBER"
export DEV_BUCKET="INSERT-DEV-BUCKET-NAME"
export PRD_BUCKET="INSERT-PRD-BUCKET-NAME"
gcloud storage buckets create gs://$DEV_BUCKET --project=$PROJECT_ID --default-storage-class=STANDARD --location=EUROPE-WEST1 --uniform-bucket-level-access
gcloud storage buckets create gs://$PRD_BUCKET --project=$PROJECT_ID --default-storage-class=STANDARD --location=EUROPE-WEST1 --uniform-bucket-level-access
gcloud iam workload-identity-pools create github \

The full video is here https://youtu.be/bCqPXUcBfJQ

application one/.github/workflows/build.yaml

name: Application One
run-name: SDLC for Application One 🚀
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
<!DOCTYPE html>
<html>
<head>
<title>Welcome to blue!</title>
</head>
<body style="background-color:powderblue;">
<h1>Welcome to blue!</h1>
</body>
</html>
@amasucci
amasucci / high-cpu.sh
Created June 23, 2019 13:50
Put load on cpu
dd if=/dev/urandom | gzip -9 >> /dev/null &
socat TCP4-LISTEN:80,fork,su=nobody TCP6:\[xxx:xxxx:xxx:xxxx:xxx:xxxx:xxx:xxxx\]:80