Requires
- aws-cli - https://aws.amazon.com/cli/
- jq - https://stedolan.github.io/jq/
Configure path to your ECS SSH key file ~/.bashrc
echo 'export ECS_PEM_FILE=$HOME/docker.pem' >> ~/.bashrc
| # Get number of running containers of a service | |
| aws --profile saml --output json ecs describe-services --cluster DIT-DMZ --service adp-e-bot-kafka | jq '.services[]|.desiredCount' | |
| # Get a list of all task definitions | |
| aws --profile saml --output text ecs list-task-definition-families | |
| # Get the JSONs of a task definition | |
| aws --profile saml --output json ecs describe-task-definition --task-def DIT-adp-e-bot | jq '.taskDefinition|if .networkMode then {family: .family, volumes: .volumes, containerDefinitions: .containerDefinitions, networkMode: .networkMode} else {family: .family, volumes: .volumes, containerDefinitions: .containerDefinitions} end' | |
| # Get all task definition and save each as a JSON |
Requires
Configure path to your ECS SSH key file ~/.bashrc
echo 'export ECS_PEM_FILE=$HOME/docker.pem' >> ~/.bashrc
| { | |
| "rules": [ | |
| { | |
| "rulePriority": 10, | |
| "description": "Cap production images at 25.", | |
| "selection": { | |
| "tagStatus": "tagged", | |
| "countType": "imageCountMoreThan", | |
| "tagPrefixList": [ | |
| "prod" |
| #!/bin/bash | |
| aws ecr list-images --repository-name $1 | jq '.imageIds | unique_by(.imageDigest) | length' |
This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :
| import boto3 | |
| import pandas | |
| AWS_ACCESS_KEY_ID = 'YOUR_AWS_ACCESS_KEY_ID' | |
| AWS_SECRET_ACCESS_KEY = 'YOUR_AWS_SECRET_ACCESS_KEY' | |
| # connect to s3 | |
| s3 = boto3.client( | |
| 's3', | |
| aws_access_key_id=AWS_ACCESS_KEY_ID, |
| -- Create a group | |
| CREATE ROLE readaccess; | |
| -- Grant access to existing tables | |
| GRANT USAGE ON SCHEMA public TO readaccess; | |
| GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess; | |
| -- Grant access to future tables | |
| ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess; |