0
votes

I am trying to create a repository in AWS Code-commit, i am able to create the repository but i am not able to clone github code into this created new repository.

This is the code i am using to create a repository

resource "aws_codecommit_repository" "test" {
  repository_name = "MyTestRepository"
  description     = "This is the Sample App Repository"
}

i also want to clone a github repo into this new code-commit repo.

Here is the terraform code-commit page link for documentation https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/codecommit_repository

1
How do you clone the repo?Marcin
yeah that is what i want to achieve how do i clone a github repo into this newly created repository .sks123245

1 Answers

0
votes

What you are trying to do is essentially "migrate" a GitHub repo to CodeCommit. This is documented in AWS docs 1 and basically involves locally cloning source git repo and pushing to CodeCommit.

To "seed" the initial code automatically, CloudFormation has a construct Code in resource AWS::CodeCommit::Repository 2 which can copy initial code from an S3 bucket, unfortunately such an option does not seem to exist in Terraform's aws_codecommit_repository resource 3.