-
Notifications
You must be signed in to change notification settings - Fork 524
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pubsys: add SSM parameter publishing
`cargo make ssm` will use the amis.json from `cargo make ami` to populate parameter name/value templates from files in `policies/ssm`. The parameters are set in SSM using the full build version, e.g. "0.5.0-abcdef", and it won't overwrite by default. `cargo make promote-ssm -e SSM_TARGET=VERSION` will promote (copy) those values from the full-build-version name to a more general one. It's recommended to promote from the full version to a short version like "0.5.0", then to a well-known pointer like "latest". This allows for easy rollback by promoting from an older version, using `-e SSM_SOURCE=OLD_VERSION`. Co-authored-by: Zac Mrowicki <[email protected]> Co-authored-by: Tom Kirchner <[email protected]>
- Loading branch information
Showing
16 changed files
with
1,460 additions
and
28 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Parameter templates | ||
|
||
Files in this directory contain template strings that are used to generate SSM parameter names and values. | ||
You can pass a different directory to `pubsys` to use a different set of parameters. | ||
|
||
The directory is expected to contain a file named `defaults.toml` with a table entry per parameter, like this: | ||
|
||
``` | ||
[[parameter]] | ||
name = "{variant}/{arch}/{image_version}/image_id" | ||
value = "{image_id}" | ||
``` | ||
|
||
The `name` and `value` can contain template variables that will be replaced with information from the current build and from the AMI registered from that build. | ||
|
||
The available variables include: | ||
* `variant`, for example "aws-k8s-1.17" | ||
* `arch`, for example "x86_64" | ||
* `image_id`, for example "ami-0123456789abcdef0" | ||
* `image_name`, for example "bottlerocket-aws-k8s-1.17-x86_64-v0.5.0-e0ddf1b" | ||
* `image_version`, for example "0.5.0-e0ddf1b" | ||
* `region`, for example "us-west-2" | ||
|
||
# Overrides | ||
|
||
You can also add or override parameters that are specific to `variant` or `arch`. | ||
To do so, create a directory named "variant" or "arch" inside parameters directory, and create a file named after the specific variant or arch for which you want overrides. | ||
|
||
For example, to add extra parameters just for the "aarch64" architecture, create `arch/aarch64.toml`. | ||
Inside you can put the same types of `[[parameter]]` declarations that you see in `defaults.toml`, but they'll only be applied for `aarch64` builds. |
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,7 @@ | ||
[[parameter]] | ||
name = "{variant}/{arch}/{image_version}/image_id" | ||
value = "{image_id}" | ||
|
||
[[parameter]] | ||
name = "{variant}/{arch}/{image_version}/image_version" | ||
value = "{image_version}" |
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
Oops, something went wrong.