0

I am working on a project where depending on the development environment it will show a different page in a UserPoolClient callbackURL, but I had this error:

Property validation failure: [Value of property {/CallbackURLs} does not match type {Array}]

The code I used is like the following, I'm not sure if this is the correct way to add an if condition. I tried to follow the documentation but I don't have experience on AWS.

Conditions:
  IsProd: !Equals [ !Ref EnvType, 'prod']

  UserPoolApiClient:
    Type: AWS::Cognito::UserPoolClient
    Properties:
      ClientName: !Sub '${AWS::StackName}-user-pool-client'
      UserPoolId: !Ref UserPool
      GenerateSecret: false
      SupportedIdentityProviders:
        - COGNITO
      ExplicitAuthFlows:
        - USER_PASSWORD_AUTH
      CallbackURLs:
        !If
          - IsProd
          - Fn::Sub: '{!ImportValue landing-page}'
          - Fn::Sub: '{!ImportValue landing-page}/dev_welcome.html'

1 Answers1

0

CallbackURLs should be a list:

      CallbackURLs:
        - !If
           - IsProd
           - Fn::Sub: '{!ImportValue landing-page}'
           - Fn::Sub: '{!ImportValue landing-page}/dev_welcome.html'

Marcin
  • 215,873
  • 14
  • 235
  • 294