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

AppSync Arn reference error #600

Open
FAR5HID opened this issue May 12, 2023 · 1 comment
Open

AppSync Arn reference error #600

FAR5HID opened this issue May 12, 2023 · 1 comment

Comments

@FAR5HID
Copy link

FAR5HID commented May 12, 2023

Trying to create an IAM role for lambda to call AppSync API from the lambda function. But having trouble with referencing the Appsync resource.

The serverless.yml (truncated):

provider:
  iam:
    role:
      statements:
        - Effect: 'Allow'
          Action:
            - 'appsync:GraphQL'
          Resource: !Sub ${appsync:arn}/types/Mutation/fields/*
resources:
  Outputs:
    apiArn:
      Value: ${appsync:arn}
appSync:
  name: AppSync-api
  ...

Used the reference variable ${appsync:arn} as mentioned in the Serverless AppSync Plugin. But running this giving me an error:

Cannot resolve serverless.yml: Variables resolution errored with:

  • Cannot resolve variable at "provider.iam.role.statements.6.Resource.Fn::Sub": String value consist of variable which resolve with non-string value

If I hardcode the arn with currently deployed API arn in Resource, I get the expected arn in Outputs after successful deployment. So, how can I dynamically reference the AppSync Api Arn in IAM role statement?

@PatrykMilewski
Copy link

Duplicate off #569

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

No branches or pull requests

2 participants