I have a SSM Maintenance Window with instance targets linked via a Resource Group.
So the tasks associated with this Maintenance Window make use of the {{RESOURCE_ID}} parameter.
Applying the {{RESOURCE_ID}} to a task which calls an AWS document works fine. Such as AWS-StartEC2Instance and AWS-StopEC2Instance.
I'm now trying to use the {{RESOURCE_ID}} with a new document which executes a powershell script. When i build a new document there is the option to specify the "InputPayload" which i am setting as " InstanceIds : "{{RESOURCE_ID}}", but when i execute the document i get the error...
" Step fails when it is validating and resolving the step inputs. Failed to resolve input: RESOURCE_ID to type Integer or Boolean or String or StringList or StringMap or MapList. RESOURCE_ID is not defined in the Automation Document "
The document content looks like this....
description: TEST
schemaVersion: '0.3'
mainSteps:
- name: Main
action: 'aws:executeScript'
inputs:
Runtime: PowerShell Core 6.0
Script: |-
Write-Host 'hello world';
$inputPayload = $env:InputPayload | ConvertFrom-Json;
<#$parameter = $inputPayload.events.parameter;#>
Write-Host $inputPayload.context;
return @{message='hello'}
InputPayload:
InstanceIds: '{{RESOURCE_ID}}'
Any ideas where i'm going wrong with this?