Skip to content

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

Open
@QO-Development

Description

@QO-Development

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-amplifyRelated to AWS AmplifydocumentationThis is a problem with documentation.effort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.p3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions