Package: echostream-terrafy
echostream-terrafyEchoStream provides a graphical way to design, build and update processing an integration
networks in real time.However, there are teams that wish to manage all resources (EchoStream and others, such as
Azure or AWS) in Infrastructure as Code (IaC). If you have designed a large network of
processing resource in EchoStream, the ideal solution would be to introspect and extract
those resources into Terraform scripts.echostream-terrafyis the tool that does this, creating:A set of Terraform scripts in HCL JSON format that exactly matches the current state
of your Tenant. These may be used as-is or may be converted into a module for use in
a larger Terraform script.Aterraform.tfstatefile that has all of the resources in the Terraform scripts imported.Installationechostream-terrafyis a Python package that provides an executable. To install it:InstallPython>= 3.9 for your device.InstallTerraform>= 1.3.5 for your device.Warning - if you do not install Terraform to a location in your PATH, make note of the installation location!Create a Python virtual environment for theechostream-terrafyinstallation. This is an optional step, but it prevents Python package mismatch issues and is best practice.python-mvenvechostream-terrafyActivate the virtual environment and installechostream-terrafyinto it.sourceechostream-terrafy/bin/activate
pipinstallechostream-terrafyNote - to deactivate the virtual environment, simply typedeactivateat the command prompt.UsageIn your EchoStream Tenant, create anApiUserwith the admin role.Make note of the following in your ApiUser's credentials:GraphQL Appsync EndpointClient IdUsernamePasswordUser Pool IdYou may executeechostream-terrafyusing either environment variables, command-line parameters, or a combination of both. If a parameter is present in both the environment and on the command line, the command line takes precedence.All output fromechostream-terrafyexecutions will be written to the current working directory, with existing files (including theterraform.tfstatefile) being overwritten.Note - it is recommended that you create a directory for the output ofechostream-terrafyand execute it within that directory.Warning - if you did not installterraforminto your PATH, you must letechostream-terrafyknow where to find it. This may be accomplished by specifying the--terraformcommand-line parameter with the full path to theterraformexecutable.Warning- while the EchoStream Terraform Provider will run in a non-POSIX environment (e.g. - Windows),echostream-terrafywill NOT generate correct paths in a non-POSIX environment. Path construction is OS dependent. Because of this,echostream-terrafywill not run in a non-POSIX envrionment.Executing with environment variablessourceechostream-terrafy/bin/activateexportECHOSTREAM_APPSYNC_ENDPOINT=<api_user_appsync_endpoint>exportECHOSTREAM_CLIENT_ID=<api_user_client_id>exportECHOSTREAM_PASSWORD=<api_user_password>exportECHOSTREAM_TENANT=<my_tenant_name>exportECHOSTREAM_USER_POOL_ID=<api_user_user_pool_id>exportECHOSTREAM_USERNAME=<api_user_username>
echostream-terrafy
deactivateExecuting using command-line variablessourceechostream-terrafy/bin/activate
echostream-terrafy\--appsync-endpoint<api_user_appsync_endpoint>\--client-id<api_user_client_id>\--password<api_user_password>\--tenant<my_tenant_name>\--user-pool-id<api_user_user_pool_id>\--username<api_user_username>
deactivateOutputechostream-terrafywill generate the following files.FilenameContentartifactsDirectory of Python code, config JSON and readme artifacts for resourcesapi-users.tf.jsonThe ApiUser resourcesapps.tf.jsonThe App resourcesfunctions.tf.jsonThe Function data sources and resourceskms-keys.tf.jsonThe KmsKey resources (except the Tenant default KmsKey)main.tf.jsonTheterraformblockmanaged-node-types.tf.jsonThe ManagedNodeType data sources and resourcesmessage-types.tf.jsonThe MessageType data sources and resourcesnodes.tf.jsonThe Node data sources and resourcesprovider.tf.jsonTheproviderblocktenant-users.tf.jsonThe TenantUser resourcestenant.jsonThe Tenant resourceterraform.tfstateThe current state, importedUsing the output as-isYou may use the output fromechostream-terrafyas-is to manage your Tenant.Simply make any changes that you wish to it and runterraform planorterraform apply.Warning - rerunningechostream-terrafyafter you have made manual changes will result in those changes being overwritten!Using the output as a TerraformmoduleCopy all of the.tf.jsonfiles and theartifactsdirectory to another folder.Removeprovider.tf.json. The provider should be passed in by the module caller.Add avariables.tffile and variablize any input (e.g. - configs) that you wish to be modifiable by module users.Add anoutputs.tffile and output any information that needs to be accessed by module users.Register the module with a public/private Terraform registry or include it in amodulesdirectory (either directly or as agitsubmodule) in another Terraform project.Upload the output to Terraform Cloud or Terraform EnterprisePlease see TerraformCloud/Enterprisedocumentation for how to migrate a local terraform workspace to those products.