aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.5k stars 3.85k forks source link

(amplify-alpha): Add support for CodeStarSourceCodeProvider similar to CodePipeline's #30883

Open syunta opened 1 month ago

syunta commented 1 month ago

Describe the feature

https://docs.aws.amazon.com/amplify/latest/userguide/setting-up-GitHub-access.html#setting-up-github-app-cloudformation

Existing Amplify apps that you previously connected from GitHub repositories use OAuth for repo access. This can include apps that you deployed using the Amplify Command Line Interface (CLI), AWS CloudFormation, or the SDKs. We strongly recommend that you migrate these apps to use the new Amplify GitHub App. Migration must be performed in the Amplify console in the AWS Management Console. For instructions, see Migrating an existing OAuth app to the Amplify GitHub App.

As stated above, there is no method to build Amplify using GitHub App. I hope for the support of CodeStarSourceCodeProvider similar to aws-cdk-lib/aws-codepipeline-actions.

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline_actions.CodeStarConnectionsSourceAction.html

Use Case

Migrating an existing OAuth app to the Amplify GitHub App.

Proposed Solution

    const amplifyApp = new amplify.App(this, 'Amplify', {
      appName: 'app',
      buildSpec: { ... },
      sourceCodeProvider: new amplify.CodeStarSourceCodeProvider({
        owner: 'owner',
        repository: 'repo',
        connectionArn: 'arn string'
      }),
    });

Other Information

No response

Acknowledgements

CDK version used

aws-cdk-lib: 2.142.1, @aws-cdk/aws-amplify-alpha: 2.149.0-alpha.0

Environment details (OS name and version, etc.)

macOS 14.2

khushail commented 1 month ago

Hi @syunta , Checking this doc, seems like CodeStarSourceCodeProvider is missing. Thanks for requesting this feature. Submissions from the community are welcome in this regard.