Skip to content

Instantly share code, notes, and snippets.

View sobi3ch's full-sized avatar
🎯
Focusing

Piotr Sobieszczański sobi3ch

🎯
Focusing
View GitHub Profile
@mjaromi
mjaromi / ecs-taskDefinition-memory
Last active February 9, 2021 16:59
Show name / memory / memoryReservation for every ECS taskDefinition
aws ecs list-task-definitions --status active | jq -r '.taskDefinitionArns[]' | cut -d'/' -f2 | while read taskDefinition; do
echo -ne "$taskDefinition - " ; aws ecs describe-task-definition --task-definition $taskDefinition | jq -r '.taskDefinition.containerDefinitions[] | "\(.name) - \(.memory) - \(.memoryReservation)"'
done
@mjaromi
mjaromi / ecs-deploymentConfiguration
Created September 23, 2020 11:30
Show serviceName / desiredCount / minimum/maximumHealthyPercent for ECS services running on $ECS_CLUSTER_NAME cluster
aws ecs list-services --cluster $ECS_CLUSTER_NAME | jq -r '.serviceArns[]' | while read service ; do
aws ecs describe-services --services $service --cluster $ECS_CLUSTER_NAME | jq -r '.services[] | "\(.serviceName) - \(.desiredCount) - \(.deploymentConfiguration.minimumHealthyPercent),\(.deploymentConfiguration.maximumPercent)"'
done
@mjaromi
mjaromi / ecs-placementConstraints
Created September 23, 2020 11:30
Show serviceName / placementConstraints.type/expression for ECS services running on $ECS_CLUSTER_NAME cluster
aws ecs list-services --cluster $ECS_CLUSTER_NAME | jq -r '.serviceArns[]' | while read service ; do
aws ecs describe-services --services $service --cluster $ECS_CLUSTER_NAME | jq -r '.services[] | "\(.serviceName) - \(.placementConstraints[].type) - \(.placementConstraints[].expression)"'
done
@mjaromi
mjaromi / ecs-terraform-task_definition-diff
Last active February 9, 2021 17:01
Show diff between current and new task_definition
terragrunt plan | egrep '(new resource required)|container_definitions' | sed -n '$!N;s/\x1b\[[0-9;]*m//g;s/\n/;/;s/.*aws_ecs_task_definition.//g;s/ *(new resource required)//g;s/ *container_definitions: *"//gp;;s/" *(forces new resource)//g' | while read task_definition; do
echo -e "\nDIFF for: \033[0;31m$(echo $task_definition | cut -d';' -f1)\033[0m\n$(diff <(echo $task_definition | cut -d';' -f2- | sed 's/\\"/"/g;s/^ //g;s/ => /\n/g;s/"\[/\[/g;s/\]"/\]/g;s/ *(forces new resource)//g' | head -1 | jq) <(echo $task_definition | cut -d';' -f2- | sed 's/\\"/"/g;s/^ //g;s/ => /\n/g;s/"\[/\[/g;s/\]"/\]/g;s/ *(forces new resource)//g' | tail -1 | jq))" | egrep -v '\+\+\+|\-\-\-' | egrep '^(\+|\-|DIFF for)'
done
@wvanderdeijl
wvanderdeijl / federation.md
Last active November 2, 2025 00:58
Google Cloud service account to AWS Role federation

Google Cloud service account to AWS Role federation

inspired by https://github.com/shrikant0013/gcp-aws-webidentityfederation

  1. create an AWS Role configured for Web Identity federation using Cognito or any OpenID provider
  2. select Google as the Identity provider in the wizard
  3. set the audience to a dummy value and do not add any additional conditions in the setup wizard. We will edit the trust policy after completing the wizard.
  4. assign any permissions needed to the role
  5. read up on "Available keys for AWS web identity federation" at