4

I am trying to create AWS::AppFlow::ConnectorProfile for Salesforce connector app. Here is the test sample:

      Type: AWS::AppFlow::ConnectorProfile
      Properties: 
        ConnectorProfileName: my_salesforce_connection
        ConnectorType: Salesforce
        ConnectionMode: Public
        ConnectorProfileConfig:
          ConnectorProfileProperties:
            Salesforce:
              InstanceUrl: ${env:INSTANCE_URL}
              IsSandboxEnvironment: ${env:IS_TEST_ENV}
          ConnectorProfileCredentials:
            Salesforce:
              ClientCredentialsArn: ${env:SALESFORCE_CREDS_ARN}

But when running this, it is returning below error: Validation exception: AuthCode cannot be blank for connector: SALESFORCE

But as you notice I want to make creation of connector profile fully automatic with CloudFormation.

Let me know if you have any suggestions or fix. Thanks.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Daxay Makwana
  • 65
  • 1
  • 5

1 Answers1

0

I would recommend configuring salesforce using oauth and adding the ConnectorOauthRequest. For example

Type: AWS::AppFlow::ConnectorProfile
  Properties: 
    ConnectorProfileName: my_salesforce_connection
    ConnectorType: Salesforce
    ConnectionMode: Public
    ConnectorProfileConfig:
      ConnectorProfileProperties:
        Salesforce:
          InstanceUrl: ${env:INSTANCE_URL}
          IsSandboxEnvironment: ${env:IS_TEST_ENV}
      ConnectorProfileCredentials:
        Salesforce:
          ClientCredentialsArn: ${env:SALESFORCE_CREDS_ARN}
          ConnectorOAuthRequest: 
            AuthCode: !FindInMap [ EnvMap, !Ref Env, SalesForceAuthCode]
            RedirectUri: https://youcompany.my.salesforce.com