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개 답변
0
수락된 답변

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
전문가
답변함 10달 전
  • 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
전문가
답변함 10달 전
  • Okay, Thank you, Let me check that.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠