How to create iCalendar String with AWS CLI for creating Resource Scheduler in AWS System Manager Quick Setup

0

I am looking to develop functionality to automate the creation of Resource Scheduler in the AWS Systems Manager Quick Setup, which was released in August.

I plan to use AWS CLI, but how can I include the required parameter, the iCalendar String? Is there a CLI command in AWS to create an iCalendar String, or if not, what are the alternative solutions?

AWS CLI Reference

wynter
質問済み 2ヶ月前123ビュー
1回答
0

Hello.

Is there a CLI command in AWS to create an iCalendar String, or if not, what are the alternative solutions?

As far as I know, I don't think there is an AWS CLI command to create an iCalendar.
When created from the management console, CloudFormation is created and the following parameters are passed as "ICalendarString".
So, how about formatting it using a bash shell etc. based on this and then passing it as a parameter to AWS CLI?

BEGIN:VCALENDAR
X-CALENDAR-TYPE:DEFAULT_CLOSED
VERSION:2.0
PRODID:-//AWS//Change Calendar 1.0//EN
BEGIN:VEVENT
UID:3e118aac-05c7-4c5d-a07d-a9a46a10451a
SEQUENCE:0
DTSTAMP:20240812T022515Z
DTSTART;TZID=Asia/Tokyo:20240812T090000
DTEND;TZID=Asia/Tokyo:20240812T170000
RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR
SUMMARY:Custom start-stop schedules
END:VEVENT
END:VCALENDAR

With AWS CLI, you can execute commands in the following format.
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ssm-quicksetup/create-configuration-manager.html

aws ssm-quicksetup create-configuration-manager --configuration-definitions \
'[{"LocalDeploymentAdministrationRoleArn": "arn:aws:iam::111111111111:role/AWS-QuickSetup-LocalAdministrationRole","LocalDeploymentExecutionRoleName": "AWS-QuickSetup-LocalExecutionRole","Parameters": {"ICalendarString": "BEGIN:VCALENDAR\nX-CALENDAR-TYPE:DEFAULT_CLOSED\r\nVERSION:2.0\r\nPRODID:-//AWS//Change Calendar 1.0//EN\r\nBEGIN:VEVENT\r\nUID:3e118aac-05c7-4c5d-a07d-a9a46a10451a\r\nSEQUENCE:0\r\nDTSTAMP:20240812T024926Z\r\nDTSTART;TZID=Asia/Tokyo:20240812T090000\r\nDTEND;TZID=Asia/Tokyo:20240812T170000\r\nRRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR\r\nSUMMARY:Custom start-stop schedules\r\nEND:VEVENT\r\nEND:VCALENDAR","TargetAccounts": "111111111111","TargetRegions": "ap-northeast-1","TargetTagKey": "Name","TargetTagValue": "test"},"Type": "AWSQuickSetupType-Scheduler","TypeVersion": "3.0"}]' \
--name "test"
profile picture
エキスパート
回答済み 2ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ