How to Schedule a start of DMS task by AWS EventBridge via CloudFormation template?

0

Hello , I am creting a cloudformation template. it is creating Database Migration Service Task. I need to do a scheduling of this DMS taks via EventBridge. I've created following resource in CloudFormation:-

DMSStartTaskScheduler:
      Type: AWS::Scheduler::Schedule
      Properties: 
        FlexibleTimeWindow: 
          MaximumWindowInMinutes: 300
          Mode: FLEXIBLE
        Name: DMSStartTaskRule-dev
        ScheduleExpression: cron(30 17 * * ? *)
        State: ENABLED
        Target: 
          Arn: "DMS task ARN"
          RoleArn: !GetAtt EventBridgeIAMrole.Arn

But Getting below error:-

Invalid request provided: dms is not a supported service for a target. (Service: Scheduler, Status Code: 400,

I tried to create the same Scheduler from Console, there it was working but from Cloudformation template it is giving errors. Can anyone suggest solution of it?

2 Antworten
0
Akzeptierte Antwort

Hi.

You need to use a Universal Target. So the ARN need to be a ARN pointing to the DMS api action, in the following format arn:aws:scheduler:::aws-sdk:databasemigration:[apiAction]

DMS is not supported as a Templated Target that you are trying to use in the CloudFormation template, you need to change the ARN to a Universal Target.

profile picture
EXPERTE
beantwortet vor 10 Monaten
  • Thank you, I tried with this approach and now it is working fine.

0

Perhaps the target ARN is in the wrong format.
Create a scheduler once from the management console and then check the scheduler with the following command to see if the target ARN format is correct.

aws scheduler get-schedule --name schedule_name
profile picture
EXPERTE
beantwortet vor 10 Monaten
  • Okay, Thank you, Let me check that.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen