Releases: daidokoro/qaz
cfn-lint Support, Template Functions Info Page, BugFixes & Plumbing...
This release adds some restructuring to the internal code base, moving Qaz towards a more idiomatic foundation.
Changes:
- Added
qaz template-functions
which describes all the internal custom template functions - Established initial testing structure, more tests to come
- -i/--interactive flag added to
qaz update
command - CFN-lint support added
Validates stack by calling cfn-lint
Usage:
qaz lint [stack] [flags]
Examples:
qaz lint -c config.yml -t stack::source
qaz lint vpc -c config.yml
Flags:
-c, --config string path to config file (default "config.yaml")
-h, --help help for lint
-t, --template string path to template source Or stack::source
Global Flags:
--debug Run in debug mode...
--no-colors disable colors in outputs
-p, --profile string configured aws profile (default "default")
-r, --region string configured aws region: if blank, the region is acquired via the profile
qaz parameters
command added
Prints parameters of deployed stack
Usage:
qaz parameters [stack] [flags]
Examples:
qaz parameters vpc subnets --config path/to/config
Flags:
-c, --config string path to config file (default "config.yaml")
-h, --help help for parameters
Global Flags:
--debug Run in debug mode...
--no-colors disable colors in outputs
-p, --profile string configured aws profile (default "default")
-r, --region string configured aws region: if blank, the region is acquired via the profile
Warning:
The qaz invoke
command for invoking lambda functions is being deprecated as the AWS Lambda experience comprises of far more than just simple invocation and I believe there are better tools for engaging with lambda. If there's an explicit dependency on this functionality or you believe it should stay, create an Issue and let's discuss.
SNS Stack Notifications
This release adds support for setting SNS Notification ARNs per stack.
Example:
stacks:
vpc:
source: <your source>
# Add your SNS ARNs
notification-arns:
- arn:aws:sns:eu-west-1:012345678910:uchiha
cf:
cidr: 10.10.0.0/16
bash/zsh completion
Changes:
It is now possible to let cobra generate autocompletion code for bash and zsh by using a new completion
command like this:
# for current bash session
qaz completion bash > /tmp/qaz-completion.sh
source /tmp/qaz-completion.sh
# for future bash sessions if using homebrew
qaz completion bash > $(brew --prefix)/etc/bash_completion.d/qaz
# for current zsh session
source <(qaz completion zsh)
# for future zsh sessions
qaz completion zsh > "${fpath[1]}/_qaz"
The resulting completion script could be improved by implementing autocompletion for config files, stack names and profiles like this (here: zsh, note the :profile:_profiles
and :stack:_stacks
extension to refer the custom functions _profile
and _stacks
in the argument description)
function _stacks {
# warning: this operates on the default config.yml and does not consider a previously given config file using the -c|--config option
local -a stacks
stacks=( $(echo "ls" | qaz shell | awk 'NR>5{flag=1}/EOF/{flag=0}flag' | sort) )
_describe 'stack' stacks
}
function _profiles {
local -a profiles
profiles=( $( cat ~/.aws/credentials 2>/dev/null | sed -n "s/^\[\(.*\)\]$/\1/p" | sort) )
_describe 'profile' profiles
}
function _qaz {
local -a commands
_arguments -C \
'--debug[Run in debug mode...]' \
'--no-colors[disable colors in outputs]' \
'(-p --profile)'{-p,--profile}'[configured aws profile]:profile:_profiles' \
...
function _qaz_change_create {
_arguments \
'(-c --config)'{-c,--config}'[path to config file (Required)]:filename:_files' \
'(-s --stack)'{-s,--stack}'[Qaz local project Stack Name (Required)]:stack:_stacks' \
...
The full extended completion script can be found here: https://gist.githubusercontent.com/thorstenhuhn/7a8356cc57cc07d120eb2e4edb111790/raw/4372f7a280a2116b8dcf3eaa4f0ef2b47318cbe4/_qaz
Author: @thorstenhuhn
Stack Name Overwrite
v0.81-beta - BugFixes, Better Session Management, Stack Protection and More
This release adds a few interesting features and squashes some bugs.
Bug Fixes
- Added errror checking to terminating stacks. Fixes intermittent stack trace during termination commands in shell-mode
Features
-
region can now be specified in config for each stack as a keyword.
stacks:
mystack:
region: us-east-1
source: some.template
cf:
some: value
As each stack will have it's own session, the stack_output gen-time template command can be used for cross-region output sharing, without the need to set up a new AWS profile.
-
Termination Protects can now be enabled for all stacks.
$ qaz protect --all --config some.yaml # turns on protection for all
$ qaz protect --all --off --config some.yaml # turns off protection for all
Individual stacks can also be specified.
$ qaz protect mystack --config some.yaml
$ qaz protect mystack --off --config some.yaml
-
git-status
A git-status command has been added. This command allows you to check the status of a deployment by calling the config file on a Git Repo directly.
qaz git-status https://github.com/cfn-deployable/simplevpc
info: fetching git repo: [simplevpc]
--
Counting objects: 14, done.
Total 14 (delta 0), reused 0 (delta 0), pack-reused 14
--
create_pending -> vpc [qaz-project-vpc]
Updated 2018-08-29:
@thorstenhuhn Added mod Gen-Time function for Modulus Division within templates. I.e Returns the remainder of an uneven division.
Example:
{{ mod 7 3 }} returns --> 1
Updated 2018-09-22:
@thorstenhuhn Added seq Gen-Time function for sequence iteration. I.e Iteration over a given range.
Example:
{{ range $i, $seq := seq 1 5 }}
MyInstance{{ $seq }}:
Type: AWS::EC2::Instance
...
{{ end }}
Version 0.80-beta - Config Functions
It's been awhile since the last release and though this one may seem low on features, there has been much work done on the inner workings of Qaz. Lower API call rates and CPU Usage are some of those benefits.
What's new!
- Template Functions can now be used with Config files.
Example Config File:
project: mytest
stacks:
db:
parameters:
password: {{ GET https://some.endpoint.com/cipher.txt | kms_decrypt }}
- Qaz will now detect config.yaml files in working directory
Bug Fixes
- Fixed High CPU Usage and API Calls in shell mode.
Interactive Shell & Support AWS Serverless Architecture Model Termplates!
This release sees further enhancements and functionality for Qaz as well as some fixes in the backend.
What's New!
- Support for AWS Serverless Architecture Model Templates
- New Interactive Shell-Mode (very beta)
qaz shell --config path/to/config.yml
Orqaz shell --config https://some/config.yml
- New deploy/gen time, template function: literal will write a string to the template without evaluating special characters. Eg.
{{ cat "somefile.txt" | literal }}
. - More colorful output for some commands
Fixes
- Reduced the number of API calls being made when dealing with multiple stacks during deploy/terminate
- Fixed Parameter support for Change-Sets
Re-Structured & More Stable!
0.60-beta sees a restructuring of the backend code. This will help with future changes and enhance overall stability. There are however, some goodies for you in this release as well 👍
New Features
- Support for configuration files written in HCL
- Stack Tags Now supported using the new tags keyword under stacks, see Wiki for more detail
- Stack Timeouts can now be set using the timeout keyword under stacks
{{ invoke }}
template function now handles raw string and JSON responses from lambda. More Wiki entries to come on how this works.- New Values command added. This command prints the values in config for a specific stack.
Print stack values from config in YAML format
Usage:
qaz values [stack] [flags]
Examples:
qaz values stack
Flags:
-c, --config string path to config file (default "config.yml")
-h, --help help for values
Global Flags:
--debug Run in debug mode...
--no-colors disable colors in outputs
-p, --profile string configured aws profile (default "default")
Changes
{{ .stack }}
now represents the values of the stack calling the template and can be used interchangeably with the stack name when templating values. Feature added by @jaffee{{ .name }}
now returns the name of the stack calling the template
Git-Deploy Support!
-
Qaz is now able to deploy Cloudformation directly from Git Repositories! See the Wiki for details.
-
Added support for MFA.
When Specifying MFA Roles on a workstation, both the role and profile name need to be specified. -
Qaz will now clean up deployments on re-deploy.
-
Better reverse dependency terminations
-
Other Bug Fixes..
Update
- New loop deploy/gen time function... see examples... Thanks @jaffee
Roles Switching!
Qaz now supports Role Switching by specifying the RoleARN for each stack.
stack:
role: arn:aws:iam::9999999999:role/my-role-name
source: https://example.api/vpc
Note: It is not recommended to use both the profile and role keywords on a single stack, only one or the other.
- Minor bug fixes
- No Colors flag added
--no-colors