Tool for visualizing AWS CloudFormation Import/Exports and displaying a dependency graph
Project description
Infrastructure Dependency visualization
This tool is looking at CloudFormation Export/Imports and visualizes them. It can additionally abstract and group dependencies at a higher level based on Tags attached on the involved CloudFormation tags.
In its default configuration it is looking for the tags ServiceName/Service
, ComponentName/Component
and expects a stack naming scheme like the following:
reco-dev-storeloader-task-rfystorage
<project>-<env>-<component_name>
This things can be changed and need to be changed if you want to apply it in other accounts.
This tool additionally looks for upstream external dependencies which are not in the targeted AWS account. It does that by looking for CloudFormation parameter descriptions with metadata embedded. The following is one example:
Parameters:
...
SnowflakeAccount:
Type: String
Description: "The snowflake account name which is used to connect to. | team=Data,service=Snowflake"
It generates GraphViz output in the output
folder. Other additionally interesting information about the stacks is displayed in the stdout.
Configuration
Rename the config.hocon.template
to config.hocon
and adapt if you have external downstream dependencies depending on your services.
Names need to match up with discovered service names.
Additionally it is also possible to specify internal manual dependencies like manully create infrastructure components.
In the configuration it is also possible to configure for which CloudFormation tags the higher level grouping is done.
Instead of having a config in your current folder you can also use infra-graph init
which creates a config in ~/.config/aws-infra-graph/config.hocon
How to execute
brew install graphviz # depends on the availability of the dot tool
poetry install
poetry shell
infra-graph --help
infra-graph init
infra-graph export
open output/
Heavy operations like gathering data from AWS are cached to disk. In case you want to re-gather the data add the --refresh
flag.
Usage
Usage: infra-graph [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
export Gather data about the infra and visualize them
init Initialize config after installation
Usage: infra-graph export [OPTIONS]
Gather data about the infra and visualize them
Options:
-e, --env TEXT On which environment to run this task. e.g. dev,
stg, prd [default: dev]
-t, --project-name TEXT Project/Team name is expected of part of the
resource name and need to be specified here or
taken from config
-r, --refresh In case of disc cached result clear them beforehand
--help Show this message and exit.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for aws_infra_graph-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51718df271f214902bce59386d7bd41d098651f24fd5ebc53bd84a00ea926e3d |
|
MD5 | 7168a3d9a17386c4488418c9f37b2fbb |
|
BLAKE2b-256 | 05d0a47d8dba5e3e21ccde2fba341d39aa6ead7377efb10360fba403edb30c92 |