Search code examples
amazon-web-servicesaws-event-bridge

Customize Partner Event Source name in AWS CloudFormation script


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


Solution

  • 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
       [...]