This repository has been archived by the owner on Jun 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
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 #106 from otakup0pe/aws-creds-template
add a builtin aws credentials file template
- Loading branch information
Showing
2 changed files
with
18 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
name: AWS Credentials Profile | ||
help: This template will generate an AWS credentials file compatible with the CLI and other supported tools. The profile will be named as the AWS path, without the sts/creds element, joined by underscores. Note that any/all hyphens in the path will also be converted to underscores. Also note that this template is really only suitable for AWS secret backends. |
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,16 @@ | ||
{% set w_account = {"hax": ""} -%} | ||
{% for key, secret in aomi_items.iteritems() -%} | ||
{% set path_bits = key.split("_") -%} | ||
{% set account = path_bits[0:path_bits|length - 2] -%} | ||
{% set key = path_bits[path_bits|length - 2] -%} | ||
{% if account != w_account.hax -%} | ||
{% if w_account.update({"hax": account}) -%}# terrible hacks https://stackoverflow.com/questions/9486393/jinja2-change-the-value-of-a-variable-inside-a-loop{% endif -%} | ||
[{{account|reject("equalto", "creds")|reject("equalto", "sts")|join("_")}}] | ||
{% endif -%} | ||
{% if key == "access" -%} | ||
aws_access_key_id = {{secret}} | ||
{% endif -%} | ||
{% if key == "secret" -%} | ||
aws_secret_access_key = {{secret}} | ||
{% endif -%} | ||
{% endfor -%} |