aws / aws/aws-cdk

(aws-amplify): Documentation unclear about how to define repository

Open
#25,658 5 comments 2 reactions 0 assignees View on GitHub
@aws-cdk/aws-amplify documentation effort/small feature-request p3
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

I attempt to deploy a new Amplify app via CDK and a GitHubSourceCodeProvider. However, the cdk cli tool errors out and returns an error.

### Expected Behavior

I expect the app to deploy properly.

### Current Behavior

The error log looks like this:

```
6:08:08 PM | CREATE_FAILED | AWS::Amplify::App | robotofrontendpoc2DD92C8A
Resource handler returned message: "Invalid request provided: The repository url is not valid. (Service: Amplify, Status Code: 400, Request ID: d1855b7d-af69-49cf-8a3d-d36bb9b2b
f94)" (RequestToken: ecae955c-6832-d147-8866-154359ac31d1, HandlerErrorCode: InvalidRequest)

❌ WebUiPocStack failed: Error: The stack named WebUiPocStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "Invalid request provided: The repository url is not valid. (Service: Amplify, Status Code: 400, Request ID: d1855b7d-af69-49cf-8a3d-d36bb9b2bf94)" (RequestToken: ecae955c-6832-d147-8866-154359ac31d1, HandlerErrorCode: InvalidRequest)
at FullCloudFormationDeployment.monitorDeployment (/opt/homebrew/lib/node_modules/aws-cdk/lib/index.js:397:10236)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async deployStack2 (/opt/homebrew/lib/node_modules/aws-cdk/lib/index.js:400:145739)
at async /opt/homebrew/lib/node_modules/aws-cdk/lib/index.js:400:128776
at async run (/opt/homebrew/lib/node_modules/aws-cdk/lib/index.js:400:126782)

❌ Deployment failed: Error: Stack Deployments Failed: Error: The stack named WebUiPocStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "Invalid request provided: The repository url is not valid. (Service: Amplify, Status Code: 400, Request ID: d1855b7d-af69-49cf-8a3d-d36bb9b2bf94)" (RequestToken: ecae955c-6832-d147-8866-154359ac31d1, HandlerErrorCode: InvalidRequest)
at deployStacks (/opt/homebrew/lib/node_modules/aws-cdk/lib/index.js:400:129083)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async CdkToolkit.deploy (/opt/homebrew/lib/node_modules/aws-cdk/lib/index.js:400:147788)
at async exec4 (/opt/homebrew/lib/node_modules/aws-cdk/lib/index.js:455:51984)

Stack Deployments Failed: Error: The stack named WebUiPocStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "Invalid request provided: The repository url is not valid. (Service: Amplify, Status Code: 400, Request ID: d1855b7d-af69-49cf-8a3d-d36bb9b2bf94)" (RequestToken: ecae955c-6832-d147-8866-154359ac31d1, HandlerErrorCode: InvalidRequest)
```

### Reproduction Steps

```
const amplifyApp = new amplify.App(this, "frontend-poc", {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: "my-github-username",
repository: "https://github.com/my-github-username/repoName",
oauthToken: SecretValue.unsafePlainText(
"token for testing goes here"
),
}),
});
```

### Possible Solution

This URL looks perfectly valid to me. I cannot find the proper URL format anywhere in any documentation, nor the error message.

Two possible solutions here:
1. Document the URL correct format somewhere
2. Tell me what I'm doing wrong in the error message.

Either way, I don't think I should have to guess at the correct string format.

### Additional Information/Context

_No response_

### CDK CLI Version

2.79.1

### Framework Version

_No response_

### Node.js Version

18.16.0

### OS

Ventura 13.3.1

### Language

Typescript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the GitHubSourceCodeProvider entry point and its AWS Amplify documentation. Verify the accepted repository value against the reported TypeScript example, then document the correct format or improve the invalid-URL guidance. Done means a newcomer can identify the required repository string without guessing.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, github, typescript
Domain
cloud, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.