Module: ssm_runbooks
Defines custom SSM Automation Documents (runbooks) for orchestration tasks (e.g., updating status parameters, stopping instances via Lambda).
Input Map Key Pattern
Root variable: ssm_runbooks
(map of objects).
Field | Type | Description |
---|---|---|
name | string | Override document name |
document_type | string | Typically Automation |
document_format | string | YAML or JSON |
content | object | Structured content: parameters, mainSteps, description, schema_version |
tags | map(string) | Optional tags |
Dynamic Lambda Resolution
If a runbook step references FunctionName
equal to a key in the lambdas
map, the module resolves and injects the fully qualified Lambda function name / ARN automatically (pattern implemented in the root wiring logic).
Example
ssm_runbooks = {
Stop-Instances-Runbook-TF = {
name = "Stop-Instances-Runbook"
document_type = "Automation"
document_format = "YAML"
content = {
schema_version = "0.3"
description = "Stop pilot light instances using Lambda function"
mainSteps = [
{
name = "invokeLambda"
action = "aws:invokeLambdaFunction"
isEnd = true
inputs = {
FunctionName = "ec2-stop-function"
Payload = <<-EOT
{ "patch_groups": ["epicIREwss"], "targets": { "use2-ephsw-i": 1, "use2-epicf-i": "50%" } }
EOT
}
}
]
}
}
}