Skip to content
v2.274.0

Experimental

@aws-cdk/aws-cloud9-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

CloneRepository Class ​

The class for different repository providers.

Example ​

ts
import * as codecommit from 'aws-cdk-lib/aws-codecommit';

// create a codecommit repository to clone into the cloud9 environment
const repoNew = new codecommit.Repository(this, 'RepoNew', {
  repositoryName: 'new-repo',
});

// import an existing codecommit repository to clone into the cloud9 environment
const repoExisting = codecommit.Repository.fromRepositoryName(this, 'RepoExisting', 'existing-repo');

// create a new Cloud9 environment and clone the two repositories
declare const vpc: ec2.Vpc;
new cloud9.Ec2Environment(this, 'C9Env', {
  vpc,
  clonedRepositories: [
    cloud9.CloneRepository.fromCodeCommit(repoNew, '/src/new-repo'),
    cloud9.CloneRepository.fromCodeCommit(repoExisting, '/src/existing-repo'),
  ],
  imageId: cloud9.ImageId.AMAZON_LINUX_2,
});

Properties ​

pathComponentstringpath_componentstrpathComponentStringPathComponentstringPathComponent*stringrequired#
repositoryUrlstringrepository_urlstrrepositoryUrlStringRepositoryUrlstringRepositoryUrl*stringrequired#

Methods ​

fromCodeCommit(repository: IRepository, path: string): CloneRepository // chainable@staticmethod def from_code_commit(repository: IRepository, path: str) -> CloneRepositorypublic static CloneRepository fromCodeCommit(IRepository repository, String path)public static CloneRepository FromCodeCommit(IRepository repository, string path)func FromCodeCommit(Repository IRepository, Path *string) CloneRepositorystatic#
import repository to cloud9 environment from AWS CodeCommit.
2 parameters

Parameters

  • repositoryrepositoryrepositoryrepositoryRepository — the codecommit repository to clone from.
  • pathpathpathpathPath — the target path in cloud9 environment.