@aws-cdk_aws-codestar-alpha.GitHubRepository

class GitHubRepository (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Codestar.Alpha.GitHubRepository
Gogithub.com/aws/aws-cdk-go/awscdkcodestaralpha/v2#GitHubRepository
Javasoftware.amazon.awscdk.services.codestar.alpha.GitHubRepository
Pythonaws_cdk.aws_codestar_alpha.GitHubRepository
TypeScript (source)@aws-cdk/aws-codestar-alpha ยป GitHubRepository

Implements IConstruct, IDependable, IResource, IGitHubRepository

The GitHubRepository resource.

Example

import * as codestar from '@aws-cdk/aws-codestar-alpha';
import * as s3 from 'aws-cdk-lib/aws-s3'

new codestar.GitHubRepository(this, 'GitHubRepo', {
  owner: 'aws',
  repositoryName: 'aws-cdk',
  accessToken: SecretValue.secretsManager('my-github-token', {
    jsonField: 'token',
  }),
  contentsBucket: s3.Bucket.fromBucketName(this, 'Bucket', 'bucket-name'),
  contentsKey: 'import.zip',
});

Initializer

new GitHubRepository(scope: Construct, id: string, props: GitHubRepositoryProps)

Parameters

  • scope Construct
  • id string
  • props GitHubRepositoryProps

Construct Props

NameTypeDescription
accessToken๐Ÿ”นSecretValueThe GitHub user's personal access token for the GitHub repository.
contentsBucket๐Ÿ”นIBucketThe name of the Amazon S3 bucket that contains the ZIP file with the content to be committed to the new repository.
contentsKey๐Ÿ”นstringThe S3 object key or file name for the ZIP file.
owner๐Ÿ”นstringThe GitHub user name for the owner of the GitHub repository to be created.
repositoryName๐Ÿ”นstringThe name of the repository you want to create in GitHub with AWS CloudFormation stack creation.
contentsS3Version?๐Ÿ”นstringThe object version of the ZIP file, if versioning is enabled for the Amazon S3 bucket.
description?๐Ÿ”นstringA comment or description about the new repository.
enableIssues?๐Ÿ”นbooleanIndicates whether to enable issues for the GitHub repository.
visibility?๐Ÿ”นRepositoryVisibilityIndicates whether the GitHub repository is a private repository.

accessToken๐Ÿ”น

Type: SecretValue

The GitHub user's personal access token for the GitHub repository.


contentsBucket๐Ÿ”น

Type: IBucket

The name of the Amazon S3 bucket that contains the ZIP file with the content to be committed to the new repository.


contentsKey๐Ÿ”น

Type: string

The S3 object key or file name for the ZIP file.


owner๐Ÿ”น

Type: string

The GitHub user name for the owner of the GitHub repository to be created.

If this repository should be owned by a GitHub organization, provide its name


repositoryName๐Ÿ”น

Type: string

The name of the repository you want to create in GitHub with AWS CloudFormation stack creation.


contentsS3Version?๐Ÿ”น

Type: string (optional, default: not specified)

The object version of the ZIP file, if versioning is enabled for the Amazon S3 bucket.


description?๐Ÿ”น

Type: string (optional, default: no description)

A comment or description about the new repository.

This description is displayed in GitHub after the repository is created.


enableIssues?๐Ÿ”น

Type: boolean (optional, default: true)

Indicates whether to enable issues for the GitHub repository.

You can use GitHub issues to track information and bugs for your repository.


visibility?๐Ÿ”น

Type: RepositoryVisibility (optional, default: RepositoryVisibility.PUBLIC)

Indicates whether the GitHub repository is a private repository.

If so, you choose who can see and commit to this repository.

Properties

NameTypeDescription
env๐Ÿ”นResourceEnvironmentThe environment this resource belongs to.
node๐Ÿ”นNodeThe tree node.
owner๐Ÿ”นstringthe repository owner.
repo๐Ÿ”นstringthe repository name.
stack๐Ÿ”นStackThe stack in which this resource is defined.

env๐Ÿ”น

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node๐Ÿ”น

Type: Node

The tree node.


owner๐Ÿ”น

Type: string

the repository owner.


repo๐Ÿ”น

Type: string

the repository name.


stack๐Ÿ”น

Type: Stack

The stack in which this resource is defined.

Methods

NameDescription
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
toString()๐Ÿ”นReturns a string representation of this construct.

applyRemovalPolicy(policy)๐Ÿ”น

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.