Skip to content

Instantly share code, notes, and snippets.

View ahgittin's full-sized avatar

Alex Heneveld ahgittin

View GitHub Profile
@ahgittin
ahgittin / retrieve-ec2-instance-types.sh
Last active November 13, 2019 10:50 — forked from nmagee/retrieve-ec2-instance-types.sh
Query the AWS Pricing API to get all currently available EC2 instance types
curl https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/index.json > ec2-pricing.json
cat ec2-pricing.json | jq -r '.products[].attributes["instanceType"]' | sort -u | grep '\.' > instances
cat ec2-pricing.json | jq -c '[.products[].attributes] | [ .[] | select(.instanceType) | select(.location) | {location,instanceType} ] | group_by(.location) | [{ (.[][0].location): [ .[][].instanceType ] | unique }] | sort' > instance-by-region.json
cat instance-by-region.json | jq -r '[ .[] | to_entries | { (.[].key): .[].value | join(", ") } ] > instances-string-by-region.json
[
{
"type" : "DeploymentPlan"
"href" : "data://...",
},
{
"type" : "Requirement",
"id" : "file1",
"href" : "data://...",
},
@ahgittin
ahgittin / brooklyn-dependent-entity-config.json
Created July 26, 2012 15:18 — forked from andreisavu/brooklyn-dependent-entity-config.json
Suggestions from Alex for Brooklyn dependent entitiy configuration
{
"name":"web-and-db",
"entities":[{
"type":"brooklyn.entity.webapp.ElasticJavaWebAppService",
"config":{
"java.options":{
"type":"Map",
"operation":"put",
"values":{
"brooklyn.example.db.url":{