> **Experimental**
>
> `@aws-cdk/aws-cloud9-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# CloneRepository

The class for different repository providers.

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/environment.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0-alpha.0/packages/@aws-cdk/aws-cloud9-alpha/lib/environment.ts#L243)

## 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

- `pathComponent`: string (required)

- `repositoryUrl`: string (required)

## Methods

- `fromCodeCommit(repository: IRepository, path: string): CloneRepository // chainable` (static) — import repository to cloud9 environment from AWS CodeCommit.

  **Parameters**

  - `repository` — the codecommit repository to clone from.
  - `path` — the target path in cloud9 environment.
