- Newest
- Most votes
- Most comments
Hi There,
Can you confirm if you are able to get a response from your lambda when hitting the apigateway directly ?
**Please ensure to add API mappings for the Custom domain names to associate the API , Stage & Path.
You can click on 'Configure API mappings' under the path : 'API Gateway' > ' Custom domain name' > 'API mappings'**
Most probably you are missing this mapping due to which you are getting {"message":"Forbidden"}
Thanks
Resolution for me was that I had forgotten the A record in the hosted zone pointing from the generated "API Gateway domain name" to your domain name.
Ferom the console the generated domain name can be found in API gateway -> Custom domain names -> <YOUR DOMAIN> -> Configurations -> API Gateway domain name
In Python CDK this looked something like:
api_domain_name = <YOUR DOMAIN NAME> api_domain = cdk.aws_apigateway.DomainName( self, "ApiDomainName", domain_name=api_domain_name, certificate=cert, ) cdk.aws_route53.ARecord( self, "ApiGWARecord", zone=hostzone, record_name=api_domain_name, target=cdk.aws_route53.RecordTarget.from_alias( cdk.aws_route53_targets.ApiGatewayDomain( api_domain, ) ), )
Relevant content
- asked 4 years ago
- Accepted Answerasked a year ago
- Accepted Answerasked 5 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated a year ago
Hei, I found the solution later. I did few things. One of them is that I had to remove the "stage" from the link.