Referencing values from external integration sources.
In addition to setting internal parameter values directly within CloudTruth, parameters can also be created with external values that reference CloudTruth external integration sources. External values can be used as overrides in any CloudTruth environment and parameters can contain a mix of external and internal values.
First, setup CloudTruth integrations from your desired source.
When creating or editing a parameter value, select the
You are now presented with an external value screen for setting integration source values. The Location window will display your configured integration sources. In the example below we have both an AWS and GitHub integration.
This example uses SSM to select a key
TF_VAR_availability_zone_nameswhich sets the CloudTruth value to
The following example uses a JMESpath selector
timeoutto set the externally referenced value of
500from the JSON content in the integration into to our CloudTruth parameter. You can test your reference by clicking "See Value" in order to display the contents of the Referenced Value. If the JMESPath selector does not return a valid result, error details will be displayed.
JMESPath with JSON
XML with or without node attributes can be searched with JMESPath, however the expression can be a bit tricky. Consider the following simple XML content:
A JMESPath query for
Data.Superwould give you the value
A JMESPath query for
Data.Project.Parameter[?"@name"==`rowena`]."#text" | would give you the value
castiel. Let's break that down:
Data.Projectinspects each "Project", creating an array.
Parameter[?"@name"==`rowena`]searches the array for a Parameter entry with a
nameattribute set to
"#text"extracts the textual content of that node.
| takes the resulting array matches (from step 1), filtered by step 2 and returns the first one. Without this, the result is
When refencing values from AWS Secrets Manager or Secure Strings from SSM the CloudTruth parameter must be marked as a secret in order to reference the secret value. If the CloudTruth Parameter is not marked as a secret the values will be locked.
Since AWS Secrets manager values are always secure, secrets manager is locked at the top level.
AWS Parameter store will intelligently only lock Secure String values.
Each time you use the integration explorer from the parameter edit panel, CloudTruth will read the content and store the value to satisfy configuration queries. You can also refresh all of the values CloudTruth is handling through an integration by visiting the Actions menu and selecting Import. Each integration has a mapped import action you can trigger from there to refresh all of the mapped external values for that integration.
In the future we plan to offer ways to keep the values synchronized automatically by watching the integration for changes through events and updating the values.