Skip to content

Commit

Permalink
Merge pull request #25 from hairyhenderson/ec2tag-ec2region-doc-update
Browse files Browse the repository at this point in the history
Updating README for ec2tag and e2region
  • Loading branch information
hairyhenderson committed Mar 28, 2016
2 parents e1b4c10 + 80f56a1 commit 37a6896
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,31 @@ $ echo '{{ (ec2dynamic "instance-identity/document" | json).region }}' | ./gompl
us-east-1
```

#### `ec2region`

Queries AWS to get the region. Returns `unknown` if it can't be determined for some reason.

##### Example

```console
$ echo '{{ ec2region }}' | ./gomplate
us-east-1
```

#### `ec2tag`

Queries the AWS EC2 API to find the value of the given [user-defined tag](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). An optional default
can be provided.

#### Example

```console
$ echo 'This server is in the {{ ec2tag "Account" }} account.' | ./gomplate
foo
$ echo 'I am a {{ ec2tag "classification" "meat popsicle" }}.' | ./gomplate
I am a meat popsicle.
```

### Some more complex examples

##### Variable assignment and `if`/`else`
Expand All @@ -135,6 +160,15 @@ You are root!

_Note:_ it's important for the `if`/`else`/`end` keywords to appear on the same line, or else `gomplate` will not be able to parse the pipeline properly

## Releasing

Right now the release process is semi-automatic.

1. Create a release tag: `git tag -a v0.0.9 -m "Releasing v0.9.9"`
2. Build binaries: `make build-x`
3. _(optional)_ compress the binaries with `upx` (may not work for all architectures)
4. Create a release in [github](https://github.com/hairyhenderson/gomplate/releases)!

## License

[The MIT License](http://opensource.org/licenses/MIT)
Expand Down

0 comments on commit 37a6896

Please sign in to comment.