0

I am trying to create Appflow through CFT where TriggerType is Scheduled and i am getting the following error for ScheduleStartTime: Resource handler returned message: "Invalid request provided: AWS::AppFlow::FlowUpdate Flow request failed due to:[Schedule start time cannot be in the past. Please update the schedule start time to a value in future.]

This is the part of Appflow in CFT :

rVeevaCrmLly1SentEmailAppflow1:
    Type: AWS::AppFlow::Flow
    Condition: CreateDev
    Properties:
        Description: edb-commercial-veeva-crm-lly1-sent-email update from S3 to Salesforce
        DestinationFlowConfigList:
          - ConnectorType: Salesforce
            ConnectorProfileName: !Ref pConnectorProfileLLY1
            DestinationConnectorProperties:
              Salesforce:
                ErrorHandlingConfig:
                  BucketName: !Ref pBucketName
                  BucketPrefix: Write-back-2/error/
                  FailOnFirstError: TRUE
                Object: Sent_Email_vod__c
                IdFieldNames: [Id]
                WriteOperationType: UPDATE
        FlowName: edb-commercial-veeva-crm-lly1-sent-email-update
        KMSArn: !Ref pKMSArn
        SourceFlowConfig:
          ConnectorType: S3
          SourceConnectorProperties:
            S3:
              BucketName: !Ref pBucketName
              BucketPrefix: !Ref pBucketPrefixCRM
        Tags:
          - Key: pApplicationCi
            Value: !Ref pApplicationCi
          - Key: pCostCenter
            Value: !Ref pCostCenter
          - Key: pCostCenterApprover
            Value: !Ref pCostCenterApprover
          - Key: pDataClassification
            Value: !Ref pDataClassification
          - Key: pHipaa
            Value: !Ref pHipaa
          - Key: pLevel1BusinessArea
            Value: !Ref pLevel1BusinessArea
          - Key: pOrg
            Value: LLY1
          - Key: pPrimaryItContact
            Value: !Ref pPrimaryItContact
          - Key: pSystemCustodian
            Value: !Ref pSystemCustodian
          - Key: pSystemOwner
            Value: !Ref pSystemOwner
        Tasks:
          - ConnectorOperator:
              S3: PROJECTION
            SourceFields:
              - Status_vod__c
              - Lilly_Reason_1__c
              - Lilly_Reason_2__c
              - Lilly_Reason_3__c
              - Lilly_Reason_4__c
              - Lilly_Reason_5__c
              - Lilly_Reason_6__c
              - Lilly_Reason_7__c
              - Lilly_Reason_8__c
              - Lilly_Reason_9__c
              - Lilly_Reason_10__c
              - Lilly_Rejected_Text_1__c
              - Lilly_Rejected_Text_2__c
              - Lilly_Rejected_Text_3__c
              - Lilly_Rejected_Text_4__c
              - Lilly_Rejected_Text_5__c
              - Lilly_Rejected_Text_6__c
              - Lilly_Rejected_Text_7__c
              - Lilly_Rejected_Text_8__c
              - Lilly_Rejected_Text_9__c
              - Lilly_Rejected_Text_10__c
              - Id
            TaskType: Filter
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Status_vod__c
            SourceFields:
              - Status_vod__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: picklist
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Reason_1__c
            SourceFields:
              - Lilly_Reason_1__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: picklist
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Reason_2__c
            SourceFields:
              - Lilly_Reason_2__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: picklist
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Reason_3__c
            SourceFields:
              - Lilly_Reason_3__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: picklist
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Reason_4__c
            SourceFields:
              - Lilly_Reason_4__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: picklist
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Reason_5__c
            SourceFields:
              - Lilly_Reason_5__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: picklist
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Reason_6__c
            SourceFields:
              - Lilly_Reason_6__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: picklist
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Reason_7__c
            SourceFields:
              - Lilly_Reason_7__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: picklist
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Reason_8__c
            SourceFields:
              - Lilly_Reason_8__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: picklist
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Reason_9__c
            SourceFields:
              - Lilly_Reason_9__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: picklist
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Reason_10__c
            SourceFields:
              - Lilly_Reason_10__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: picklist
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Rejected_Text_1__c
            SourceFields:
              - Lilly_Rejected_Text_1__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: textarea
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Rejected_Text_2__c
            SourceFields:
              - Lilly_Rejected_Text_2__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: textarea
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Rejected_Text_3__c
            SourceFields:
              - Lilly_Rejected_Text_3__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: textarea
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Rejected_Text_4__c
            SourceFields:
              - Lilly_Rejected_Text_4__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: textarea
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Rejected_Text_5__c
            SourceFields:
              - Lilly_Rejected_Text_5__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: textarea
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Rejected_Text_6__c
            SourceFields:
              - Lilly_Rejected_Text_6__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: textarea
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Rejected_Text_7__c
            SourceFields:
              - Lilly_Rejected_Text_7__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: textarea
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Rejected_Text_8__c
            SourceFields:
              - Lilly_Rejected_Text_8__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: textarea
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Rejected_Text_9__c
            SourceFields:
              - Lilly_Rejected_Text_9__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: textarea
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Lilly_Rejected_Text_10__c
            SourceFields:
              - Lilly_Rejected_Text_10__c
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: textarea
            TaskType: Map
          - ConnectorOperator:
              S3: NO_OP
            DestinationField: Id
            SourceFields:
              - Id
            TaskProperties:
              - Key: DESTINATION_DATA_TYPE
                Value: picklist
            TaskType: Map
        TriggerConfig:
          TriggerProperties:
                    DataPullMode: Incremental
                    #ScheduleEndTime: Double
                    ScheduleExpression: "rate(1days)"
                    #ScheduleOffset: Double
                    ScheduleStartTime: 12.30
                    #TimeZone: "America/New_York"
          TriggerType: Scheduled
Iram
  • 21
  • 6

4 Answers4

0

give date and time format like(DDMMYYYYHHSS). example you want to start on jan15 2022, give a scheduled start time as eg:(150120221300).

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 10 '22 at 12:11
0

The ScheduleStartTime expects a Unix timestamp. For example, 2022-01-19 01:00:00 would be 1642575600. Make sure your time is in the future.

ejunker
  • 10,816
  • 11
  • 41
  • 41
0

Passing a Unix timestamp to ScheduleStartTime is the appropriate method.

To expand, to get the Unix timestamp via command line for say, 15 minutes ahead of now run: date --date='now + 15 minutes' +%s

In doing that, for my project, I was able to pass that value in my Makefile to sam deploy --parameter-overrides "AppFlowStart=$$(date --date='now + 15 minutes' +%s)" This parameter is in my template.yaml as type Number and then referenced in my AppFlow resource's ScheduleStartTime.

I tested this with the latest version of AWS SAM on the latest version Ubuntu Desktop at the time of writing this answer with a work project.

0
TriggerConfig:
         TriggerType: Scheduled
         TriggerProperties:
              DataPullMode: Incremental
              ScheduleExpression: rate(1days)
              ScheduleStartTime: 1653230423
              ScheduleEndTime: 1653241223
  

Use Unix timestamp for start and end time. Please refer to the below link for conversion. https://www.unixtimestamp.com/