LInk to a just created appsyncAPI

In my situation I need to create few rules with different policies to access appsync API.

something like this

- PolicyName: superAdminActions
      - Effect: Allow
        Action: "appsync:GraphQL"
        Resource: [

the problem here is that I set appSyncAPIId from environment which is incorrect because I should somehow point to appsyncAPI in this serverless file. How can I do this?

Currently I need to deploy so that appsync API would be created, copypaste apiID to my env config and then redeploy so that link to appsync endpoint would be updated.

You can use Fn::GetAtt to retrieve the Arn property if you know the name of the AppSync object in the CloudFormation config. See the CloudFormation docs.