Package: terrastorm
TerrastormA simple cli to help you work with using terraservice layouts for terraformTerraservice?https://www.youtube.com/watch?v=wgzgVm7Sqlkhttps://www.slideshare.net/opencredo/hashidays-london-2017-evolving-your-infrastructure-with-terraform-by-nicki-watthttps://www.hibri.net/2017/11/13/terraform-for-grownups/NBWhats important to note is that we have added alayersabstraction. This abstraction allows you to compose infra objects that can then be used by your environments, instead of referencing modules directly.Example layoutmodulesare standard terraform moduleslayersimplementmodules- they dont store secrets, just compose object representations that can be used by the environmentsenvironmentsimplement any number oflayers- here you configure secrets and variables for the individual environmentsEnvironment - ServicesEnvironmentsallow us to implementserviceswhich areinstancesoflayerswithenvironment specific configurationcan take secretscompose layersmaintain the remote encrypted s3 stateLayersLayersallow us to combine a number ofmodulesno secretscompose modulesModulesModulesact as normal terraform modules and provide access to the standard concept.stnadrad terraform modulesBut now you have to go to theproductionenvironment and runterraform planandterraform applyfor each of yourservicesthis gets repetative├──environments
│├──dev
││├──iam
│││├──README.md
│││├──main.tf
│││├──secrets.auto.tfvars
│││└──terraform.tfvars
││└──network
││├──README.md
││├──main.tf
││├──secrets.auto.tfvars
││└──terraform.tfvars
│└──prod
│├──iam
││├──README.md
││├──main.tf
││├──secrets.auto.tfvars
││└──terraform.tfvars
│└──network
│├──README.md
│├──main.tf
│├──secrets.auto.tfvars
│└──terraform.tfvars
├──layers
│├──iam
││├──README.md
││├──main.tf
││├──outputs.tf
││└──variables.tf
│└──network
│├──README.md
│├──main.tf
│├──outputs.tf
│└──variables.tf
└──modules├──subnets│├──README.md│├──main.tf│├──outputs.tf│└──variables.tf└──vpc├──README.md├──main.tf├──outputs.tf└──variables.tfUsageModify the makefile so your aws and ti-landscape are mounted to the right places1.makeshell2.`terrastormrunnonprodinit`<--willinitonalltheservicesinnonprodStory 1 - Setup a new ProjectAs an infra-op
I need to create a new project based on the terraservices pattern
So that I can injectsparklesinto the lives of our clientsterrastorm setup /path/to/projectwill create a new project based on the template defined in the.terrastorm.yamltemplates.project=https://github.com/williamtsoi1/terraservices-example.gitStory 2 - See my settingsAs an infra-op
I want to see my current config settings
So that I can check all is wellterrastorm show_configwill output the current config settings loaded from~/.terrastorm.yamland the default.terrastorm.yamlStory 3 - Create a new Terraform ModuleAs an infra-op
I need to create a new segment of infrastructure
So that I can injectsparklesinto the lives of our clientsterrastorm create module :new_module_namewill create a new "module" with the appropriate:name.tf,input.tf,output.tffilesStory 4 - Create a new LayerAs an infra-op
I need to create a newlayerof infrastructure
So that I can compose an infrastructure represenation for use in my environments.terrastorm create layer :new_module_namewill create a new "module" with the appropriate:name.tf,input.tf,output.tffilesStory 5 - Create a new EnvironmentAs an infra-op
I need to create a new environment, optionally excluding or including certain modules
So that I can inject goodness into the lives of our clientsterrastorm create environment :new_environment_namewill create a new environmentStory 6 - Add a new service to an EnvironmentAs an infra-op
I need to be able to add a module interface to an environment
So that I canmake magic happeterrastorm add service :environment :new_service_namewill create a new service instance in the environment specifiedStory 7 - Run a terraform command in an environment serviceAs an infra-op
I need to run terraform commands on the appropriate environment
So that I canmake magic happeterrastorm run :environment :cmd :service_name|allenvironment - staging|production|...cmd - fmt|init|plan|applyservice None|all|:name_of_your_serviceStory 8 - Exec and shell command in an environmentAs an infra-op
I need to run shell commands in the appropriate environment
So that I canmake magic happeterrastorm cmd :environment ':cmd'environment - staging|production|...cmd -ls -alh|tree . -L 3service None|all|:name_of_your_service
cmd dev 'ls -alh'Developmentdockerbuild-tterrastorm:latest.
dockerrun-it--rm\-v$PWD:/src\-v/Users/ross/p/ross.crawford/ti-landscape:/terraform\terrastorm:latestsh

dockerrun-it--rm\-v$PWD:/src\terrastorm:latestshUsingdockerrun-it--rm\-v$PWD:/src\-v/path/to/project:/terraform\rosscdh/terrastorm:latestsh

>>terrastormsetup/terraform
>>ls/tearraform