2

I want to define the AppFlow configuration in a SAM template.

I don't want to let AWS automatically generate a Partner Event Source name like aws.partner/appflow/salesforce.com/${AWS::AccountId}/resource

It is possible to specify a custom name when setting up AppFlow manually via console (see step 4 in Amazon EventBridge.

I cannot find the right keyword to specify the name in CloudFormation (I guess it should go somewhere under AWS::AppFlow::Flow but the solution eludes me.)

TIA

Eddy
  • 1,662
  • 2
  • 21
  • 36
  • Might be `DestinationFlowConfig > ConnectorProfileName` ? https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appflow-flow-destinationflowconfig.html – Meir Gabay Apr 20 '21 at 21:33
  • Makes sense, but the stack deployment still fails when the Event Bus cannot find the name I've given... – Eddy Apr 26 '21 at 07:16
  • Sounds like you need to create a support ticket in AWS. I Googled about it, and I assume you did too, seems like there are no docs about this specific topic (CloudFormation) – Meir Gabay Apr 26 '21 at 09:37

1 Answers1

3

The solution is to set AppFlow::Flow:DestinationFlowConfigList::DestinationConnectorProperties:EventBridge:Object to the suffix you want the source to have!

E.g.:

  SalesforceAppFlow:
    [...]
    Type: AWS::AppFlow::Flow
    Properties:
      [...]
      DestinationFlowConfigList:
        - ConnectorType: "EventBridge"
          DestinationConnectorProperties:
            EventBridge:
              Object: THIS_SUFFIX
    [...]

  PartnerEventBus:
    Type: AWS::Events::EventBus
    Properties:
      Name: !Sub "aws.partner/appflow/salesforce.com/${AWS::AccountId}/THIS_SUFFIX"
      EventSourceName: !Sub "aws.partner/appflow/salesforce.com/${AWS::AccountId}/THIS_SUFFIX"
    DependsOn: SalesforceAppFlow
   [...]
Eddy
  • 1,662
  • 2
  • 21
  • 36
  • Will this also create the partner event source? From my understanding it will create the flow and eventbus, but the partner event source you still need to create manually – Ajvo Nov 30 '21 at 10:08