-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #173 from sparkprime/libsonnet
Provide examples for new .libsonnet convention
- Loading branch information
Showing
64 changed files
with
2,474 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ service.list | |
*.tf | ||
service_account_key.json | ||
tilegen/mandelbrot | ||
credentials.jsonnet | ||
credentials.libsonnet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
tests/testenv.jsonnet | ||
tests/testenv.libsonnet | ||
examples/test_google.jsonnet | ||
examples/test_amazon.jsonnet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
case_studies/micromanage/lib/mmlib/v0.1.2/amis/debian.libsonnet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Connect to machines using the username "admin" and -i yourkey.pem | ||
|
||
// Source: https://wiki.debian.org/Cloud/AmazonEC2Image/Wheezy | ||
|
||
// HVM, EBS | ||
{ | ||
wheezy: { | ||
amd64: { | ||
"20150128": { | ||
"ap-northeast-1": "ami-b25d44b3", | ||
"ap-southeast-1": "ami-aeb49ffc", | ||
"ap-southeast-2": "ami-6b770351", | ||
"eu-central-1": "ami-98043785", | ||
"eu-west-1": "ami-61e56916", | ||
"sa-east-1": "ami-3d8b3720", | ||
"us-east-1": "ami-e0efab88", | ||
"us-west-1": "ami-b4869ff1", | ||
"us-west-2": "ami-431a4273", | ||
"us-gov-west-1": "ami-d13455f2", | ||
"cn-north-1": "ami-48029071", | ||
}, | ||
}, | ||
}, | ||
} |
33 changes: 33 additions & 0 deletions
33
case_studies/micromanage/lib/mmlib/v0.1.2/amis/ubuntu.libsonnet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Connect to machines using the username "ubuntu" and -i yourkey.pem | ||
|
||
// Source: http://cloud-images.ubuntu.com/locator/ec2/ | ||
// There is a URL to get a JSON dump but I've lost it. | ||
|
||
local regions(amis) = std.set([a[0] for a in amis]); | ||
local region_amis(amis, v) = [a for a in amis if a[0] == v]; | ||
|
||
local oses(amis) = std.set([a[1] for a in amis]); | ||
local os_amis(amis, v) = [a for a in amis if a[1] == v]; | ||
|
||
local archs(amis) = std.set([a[3] for a in amis]); | ||
local arch_amis(amis, v) = [a for a in amis if a[3] == v]; | ||
|
||
local dates(amis) = std.set([a[5] for a in amis]); | ||
local date_amis(amis, v) = [a for a in amis if a[5] == v]; | ||
|
||
local strip_from_url(url) = | ||
local suffix = std.split(url, ">")[1]; | ||
std.substr(suffix, 0, std.length(suffix) - 3); | ||
|
||
local all_amis = (import "ubuntu_raw.json").aaData; | ||
|
||
{ | ||
[os]: local this_os_amis = os_amis(all_amis, os); { | ||
[arch]: local this_arch_amis = arch_amis(this_os_amis, arch); { | ||
[date]: local this_date_amis = date_amis(this_arch_amis, date); { | ||
[r]: strip_from_url(region_amis(this_date_amis, r)[0][6]) | ||
for r in regions(this_date_amis) | ||
} for date in dates(this_arch_amis) | ||
} for arch in archs(this_os_amis) | ||
} for os in oses(all_amis) | ||
} |
Binary file not shown.
Oops, something went wrong.