Search code examples
typescriptamazon-web-servicesaws-cdkaws-amplify

Establishing AWS amplify connection with AWS-CDK


I decided to use Amplify module from aws-cdk library, when I want to connect my git repo i go through in-build methods, but I am not able to establish any connection with my Azure git.

What I have been able to find was just piece of code that leads you to the implementation of GitHub / GitLab repo only.

 const amplifyApp = new amplify.App(this, "sample-react-app ", {
  sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
    owner: "[Repository-Owner]",
    repository: "[Repository-Name]",
    oauthToken: cdk.SecretValue.secretsManager("[Secret-Name]", {
      jsonField: "[Secret-Key]",
    }),
  }),
});
const masterBranch = amplifyApp.addBranch("master");

Do you know any workarounds that can help me to connect my Azure repository through this service?

Thanks in advance!


Solution

  • Amplify in the CDK doesn't currently support Azure repos out of the box.
    You could try something like what is suggested here: https://github.com/aws/aws-cdk/issues/12955
    Or put a new feature request here: https://github.com/aws/aws-cdk/issues/new/choose
    Alternatively, you could use AWS CodeCommit for this repo. You could even try to keep your CodeCommit repo in sync with your Azure repo, like this: Mirror code from Azure repository to aws code commit