Unresolved resource dependencies [DefaultSchedule] in the Resources block of the template

3.4k Views Asked by At

I am working with the cloudformation script to create AWS Data Pipeline. I have created the script according to the documentation but I am facing 1 error i.e.

Template validation error: Template format error: Unresolved resource dependencies [DefaultSchedule] in the Resources block of the template

Here is the resources part of my script:

Resources:
DataPipelineForS3Backup:
Type: AWS::DataPipeline::Pipeline
Properties:
  Name:
    Ref: S3BackupDataPipeline
  Description:
    Ref: S3BackupDataPipeline
  Activate: 'true'
  ParameterObjects:
  - Id: myAwsCliCommand
    Attributes:
    - Key: description
      StringValue: Dp command to run
    - Key: type
      StringValue: String
  ParameterValues:
  - Id: myAwsCliCommand
    StringValue:
      Ref: AwsCliCommand
  PipelineObjects:
  - Id: DefaultSchedule
    Name: Every 1 day
    Fields:
    - Key: type
      StringValue: Schedule
    - Key: period
      StringValue: 1 Day
    - Key: startDateTime
      StringValue: 2018-08-08T19:00:00
  - Id: Default
    Name: Default
    Fields:
    - Key: failureAndRerunMode
      StringValue: CASCADE
    - Key: type
      StringValue: Default
    - Key: resourceRole
      StringValue:
        Ref: S3BackupResourceRole
    - Key: pipelineLogUri
      StringValue:
        Ref: S3BackupDpLogUri
    - Key: role
      StringValue:
        Ref: S3BackupDpRole
    - Key: scheduleType
      StringValue: cron
    - Key: schedule
      StringValue:
        Ref: DefaultSchedule

Can anyone tell me what's going on with the script? Thanks

1

There are 1 best solutions below

0
On

First, writing your script in YAML you should be very carefull to the indentation to avoid errors. It should be like :

Resources:
  DataPipelineForS3Backup:
    Type: AWS::DataPipeline::Pipeline
    Properties:
      Name:
      ...

Also, as I understand you are trying to get the reference of one of the PipelineObjects. To do so, unstead of Ref: DefaultSchedule you should use RefValue: DefaultSchedule

Please see the example in documentation : https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datapipeline-pipeline.html#w2ab2c21c10d332c13