Skip to content

Commit e380b04

Browse files
authored
Merge pull request #8 from gammarers/feature/change-provider-type-to-enum
feat: change provider type to enum
2 parents 23063ec + 0017a61 commit e380b04

13 files changed

+737
-28
lines changed

API.md

Lines changed: 43 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ yarn add @gammarers/aws-codeconnections-host-custom-resource
2828
## Example
2929

3030
```typescript
31-
import { RDSDatabaseAutoRunningStopStack } from '@gammarers/aws-codeconnections-host-custom-resource';
31+
import { RDSDatabaseAutoRunningStopStack, CodeConnectionsHostProviderType } from '@gammarers/aws-codeconnections-host-custom-resource';
3232

3333
const codeConnectionsHostCustomResource = new CodeConnectionsHostCustomResource(this, 'CodeConnectionsHost', {
3434
name: 'gitlab.example.com', // required, connection host name (Minimum length of 1. Maximum length of 64.)
3535
providerEndpoint: 'https://gitlab.example.com', // required, your provider endpoint (Minimum length of 1. Maximum length of 512.)
36-
providerType: 'GitLabSelfManaged', // required, Bitbucket | GitHub | GitHubEnterpriseServer | GitLab | GitLabSelfManaged
36+
providerType: CodeConnectionsHostProviderType.GIT_LAB_SELF_MANAGED,
3737
});
3838

3939
// get host arn

src/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,19 @@ import * as iam from 'aws-cdk-lib/aws-iam';
44
import * as cr from 'aws-cdk-lib/custom-resources';
55
import { Construct } from 'constructs';
66

7+
// Bitbucket | GitHub | GitHubEnterpriseServer | GitLab | GitLabSelfManaged
8+
export enum CodeConnectionsHostProviderType {
9+
BIT_BUCKET = 'Bitbucket',
10+
GIT_HUB = 'GitHub',
11+
GIT_HUB_ENTERPRISE_SERVER = 'GitHubEnterpriseServer',
12+
GIT_LAB = 'GitLab',
13+
GIT_LAB_SELF_MANAGED = 'GitLabSelfManaged',
14+
}
15+
716
export interface CodeConnectionsHostCustomResourceProps {
817
readonly name: string;
918
readonly providerEndpoint: string;
10-
readonly providerType: string;
19+
readonly providerType: CodeConnectionsHostProviderType;
1120
}
1221

1322
export class CodeConnectionsHostCustomResource extends cr.AwsCustomResource {

test/__snapshots__/custom-resource.bitbucket.test.ts.snap

Lines changed: 133 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/__snapshots__/custom-resource.github-enterprise.test.ts.snap

Lines changed: 133 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)