aws / aws/chalice

how can I configure and use a CNAME for my chalice app on a private VPC?

Open
#1,679 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
11.1k
Forks
1k
Avg merge
1d 22h
Merged PRs (30d)
2

Description

My chalice app runs inside a private VPC.

I want users inside my VPC to visit the CNAME, which maps `myapp.example.com` to my app's API gateway endpoint, which is `123456xyz.execute-api.us-east-1.amazonaws.com`.

My route53 config looks something like this:
```python
resource "aws_route53_record" "myapp" {
zone_id = aws_route53_zone.example_com.zone_id
name = "myapp"
type = "CNAME"
ttl = 300
records = ["123456xyz.execute-api.us-east-1.amazonaws.com"]
}
```

Excerpt from `config.json`, following advice on [custom domain configuration](https://aws.github.io/chalice/tutorials/customdomain.html#chalice-app-configuration):
```json
"stages": {
"dev": {
"api_gateway_stage": "dev",
"api_gateway_endpoint_type": "PRIVATE",
"api_gateway_custom_domain": {
"domain_name": "myapp.example.com",
"certificate_arn": "arn:aws:acm:us-east-1:11223344:certificate/certid123456789"
},
"subnet_ids": ["subnet-id111", "subnet-id222", "subnet-id333"],
"security_group_ids": ["sg-id444"]
},
```
I'm unable to deploy my chalice app:
```bash
$ chalice deploy
An error occurred (BadRequestException) when calling the CreateDomainName
operation: Endpoint Configuration type PRIVATE is not supported in this
region: us-east-1
```
Is this failing because `*.example.com` is a public hosted zone? Should this work if I use a private hosted zone instead?

Contributor guide

Open the contributing guide

Research direction

Start with the custom domain configuration linked in the issue and the config.json stage settings, then reproduce the failure with the chalice deploy entry point. Check whether the reported private endpoint configuration is supported in us-east-1 and determine whether the issue needs a documentation clarification or a code change.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python, terraform
Domain
api, cloud, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.