aws / chalice

Python Serverless Microframework for AWS
Apache License 2.0
10.66k stars 1.01k forks source link

Chalice & Cognito custom scope using API Gateway generated invoke_url #1860

Open logachev opened 2 years ago

logachev commented 2 years ago

Hello,

I'm trying to create a Chalice app that supports custom scope from Cognito via Terraform.

I was looking at this example: https://aws.github.io/chalice/topics/authorizers.html It is great, but it assumes that scope name is known before the deployment.

For test/dev deployments, I would like to just use API Gateway generated uri.

API Gateway Deployment cannot be created without the swagger, but swagger needs to know API Gateway invoke url to generate proper custom scope.. Is there any way to solve this issue?

jamesls commented 2 years ago

Is terraform complaining about circular dependencies? I haven't tried to set this up myself, but can you use a terraform variable for a scope value? e.g scopes=["${aws_api_gateway_deployment.rest_api.invoke_url}/foobar.read"]

no-response[bot] commented 2 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

logachev commented 2 years ago

@jamesls sorry, I missed your question.

Yes, it does complain about circular dependency. The problem is that {aws_api_gateway_deployment.rest_api.invoke_url} is known when api_gateway is created, but it has a dependency on Chalice generated swagger. However, swagger includes all scopes, so that's where circular dep comes from

Can you reopen the issue?