aws / aws/serverless-application-model

Unable to map httpapi to exisiting customdomain

Open
#2,208 6 comments 0 reactions 0 assignees View on GitHub
type/feature
Dominant language
Python
Stars
9.6k
Forks
2.5k
Avg merge
1d 11h
Merged PRs (30d)
7

Description

### Description:
I am trying to create a httpapi and map to an exisitng custom domain

### Steps to reproduce:
Sample template.yml file
```
Resources:
HttpApi:
Type: AWS::Serverless::HttpApi
Properties:
StageName: !Ref StageName
Tags:
Tag: Value
AccessLogSettings:
DestinationArn: !GetAtt AccessLogs.Arn
Format: $context.requestId
StageVariables:
StageVar: Value
FailOnWarnings: True
CorsConfiguration:
AllowOrigins:
- "*"
AllowHeaders:
- origin
- content-type
- x-amz-date
- authorization
- x-api-key
- x-amz-security-token
AllowMethods:
- GET
- POST
- OPTIONS
- PATCH
- DELETE
MaxAge: 0
Domain:
DomainName: x.x.x
CertificateArn: arn
EndpointConfiguration: REGIONAL
Route53:
HostedZoneId: XXXXXXXXXXX
BasePath:
- /banks
```

### Observed result:
```
The domain name you provided already exists.
(Service: AmazonApiGatewayV2; Status Code: 400;
Error Code: BadRequestException; Request ID:
; Proxy:
null)

```

### Expected result:
Map created httpapi to the custom domain and under paths given as per the template section BasePath

### Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

1. OS: Ubuntu
2. `sam --version`: 1.16.0
3. AWS region: eu-west-1

`Add --debug flag to command you are running`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.