To create the AMI using System Manager Automation, i tried with the following code:
description: Creates a new Amazon Machine Image (AMI) from an Amazon EC2 instance
schemaVersion: '0.3'
assumeRole: '{{ AutomationAssumeRole }}'
outputs:
- createImage.ImageId
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'
inputs:
InstanceId: '{{ InstanceId }}'
ImageName: '{{ InstanceId }}_BeforePatchingActivity_{{ global:DATE_TIME }}'
ImageDescription: '{{ InstanceId }}_BeforePatchingActivity_{{ global:DATE_TIME }}'
NoReboot: 'true'
But I am want the local timezone to be added for ImageName and ImageDescription, instead of using global:DATE_TIME, is there any option to achieve that?
I tried global:DATE_TIME, but this variable giving UTC time zone, and expecting for local timezone.