Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2 upgrade] Can't use any longer intrinsic functions for config fields like openIdConnectConfig #638

Open
ronnyroeller opened this issue Aug 15, 2024 · 0 comments · May be fixed by #640
Open

Comments

@ronnyroeller
Copy link

We're trying to upgrade serverless-appsync-plugin from v1 to v2.

We're using CF functions for some of the values like composing the issuer URL of the OpenID provider:

additionalAuthenticationProviders: [
  { authenticationType: 'API_KEY' },
  {
    authenticationType: 'OPENID_CONNECT',
    openIdConnectConfig: {
      issuer: {
        'Fn::Join': [
         '',
         [ 'https://', { "Fn::ImportValue": "IssuerDomain" } ]
        ]
      }
    }	
  }
]

The serverless-appsync-plugin v1 correctly resovles the issuer URL.

Yet, serverless-appsync-plugin v2 creates below errors:

Cannot resolve serverless.ts: Variables resolution errored with:
  - Cannot resolve variable at "resources.Resources.AppSyncApiKeyParameter.Properties.Value": Invalid AppSync Configuration:
     at appSync/additionalAuthentications/1/config/issuer: must be string
  - Cannot resolve variable at "resources.Outputs.GraphQLAppConfigApiKey.Value": Invalid AppSync Configuration:
     at appSync/additionalAuthentications/1/config/issuer: must be string

We encounter the same issue also with other config fields:

Cannot resolve serverless.ts: Variables resolution errored with:
  - Cannot resolve variable at "resources.Resources.AppSyncApiKeyParameter.Properties.Value": Invalid AppSync Configuration:
     at appSync/xrayEnabled: must be boolean
     at appSync/waf/enabled: must be boolean
     at appSync/logging/excludeVerboseContent: must be boolean,

Looking through the validation code, this seems to be an intensional limitation:

issuer: { type: 'string' },

Is there a new way to inject computed values into the appsync configuration? Or was this feature removed on purpose?

Happy to contribute PR.

@eacet eacet linked a pull request Sep 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant