Remove template_variables from cirrus workflows #92
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit reduces the cirrus workflow module's complexity by relying on the user to simply provide Cirrus task output attribute lookups directly in their workflow state machine definition rather than using arbitrary variable names with associated entries under a workflow config 'template_variables' attribute.
The rendered JSON is now parsed via regexes to determine which resource ARNs the workflow IAM role needs permissions to execute. This also removes the need for the optional 'non_cirrus_lambda_arns' workflow config setting.
The workflow IAM role's lambda and batch policy documents were merged into one with conditional statements based on whether lambda or batch resources are used by the workflow's tasks.
Related issue(s)
Proposed Changes
template_variables
andnon_cirrus_lambda_arns
from cirrus workflow config objectstemplate_filepath
tostate_machine_filepath
in cirrus workflow config objects (for clarity)template_variables
being passed around between modules. Instead, the workflow state machine JSON is templated and then parsed for any lambda functions, batch jobs, or batch queues that the workflow IAM role will need to execute.Testing
This change was validated by the following observations:
Checklist