aws-amplify / aws-amplify/amplify-cli

Auto-generated domain label is too long

Open
#9,604 2 comments 0 reactions 0 assignees View on GitHub
bug containers p3
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Before opening, please confirm:

- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/master/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

### How did you install the Amplify CLI?

npm

### If applicable, what version of Node.js are you using?

16.4.0

### Amplify CLI Version

7.6.12

### What operating system are you using?

Arch

### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No manual changes

### Amplify Categories

api

### Amplify Commands

push

### Describe the bug

I am attempting to add a containerized API to an existing project, following [this blog post](https://aws.amazon.com/blogs/mobile/zero-effort-container-deployment-for-graphql-and-rest-apis-and-web-hosting-with-amplify-cli/). At the point where I do my first push, the auto-generated domain label is over the accepted Route53 limit of 63 characters and the push fails:

`FATAL problem: DomainLabelTooLong (Domain label is too long) encountered with 'amplify-amplify655641f4e14f4-staging-213820-vpc-0ba53bc887a43c94' `

### Expected behavior

Amplify should not generate domain labels that are outside of the restrictions imposed by Route53.

### Reproduction steps

1. init a new project named `mylongnamedamplifyte`
2. use an environment named `stagingaaa`
3. enable containerized deployments via `amplify configure project`
4. add a containerized api
5. `amplify push`

```
Following resources failed

Resource Name: ns-kk6i2x47cgl4izvx (AWS::ServiceDiscovery::PrivateDnsNamespace)
Event Type: create
Reason: FATAL problem: DomainLabelTooLong (Domain label is too long) encountered with 'amplify-mylongnamedamplifyte-stagingaaa-92442-vpc-0ba53bc887a43c' (Service: AmazonRoute53; Status Code: 400; Error Code: InvalidDomainName; Request ID: 75e942ac-cc51-480c-a68b-acb5df3f9ac7; Proxy: null)

```

### GraphQL schema(s)

```graphql
# Put schemas below this line

```

### Log output

```
# Put your logs below this line

```

### Additional information

_No response_

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.