I would like to create an SSM document for scheduling weekly backup AMI images, I have tried to copy the content from the built-in AWS-CreateImage document and made a few quick modifications to meet my requirements, but I couldn't pass the examination and keep getting this error message:
InvalidDocumentContent: Unknown plugin name: aws:createImage
Here is the content of my customized document:
{
"description": "Creates an AMI image from an EC2 instance",
"schemaVersion": "2.2",
"assumeRole": "{{ AutomationAssumeRole }}",
"parameters": {
"InstanceId": {
"type": "String",
"description": "(Required) The ID of the Amazon EC2 instance."
},
"NoReboot": {
"type": "Boolean",
"description": "(Optional) Do not reboot the instance before creating the image.",
"default": true
},
"AutomationAssumeRole": {
"type": "String",
"description": "(Optional) The ARN of the role that allows Automation to perform the actions on your behalf. ",
"default": ""
}
},
"mainSteps": [
{
"name": "createImage",
"action": "aws:createImage",
"onFailure": "Abort",
"inputs": {
"InstanceId": "{{ InstanceId }}",
"ImageName": "VoIP-Weekly-Backup-AMI-{{ 'now' | date('YYYYMMdd-HHmmss') }}",
"NoReboot": "{{ NoReboot }}"
}
}
],
"outputs": [
"createImage.ImageId"
]
}
I have checked the official documents about actions, and it looks like aws:createImage
indeed exists, so I wonder what is wrong with my settings or syntax? What am I missing? What can I do to fix this issue? I would really appreciate any help.
Based on the comments.
The solution was to use Schema version 0.3 instead of newer 2.2
. It seems that new schema does not support all actions.