Skip to content
v2.277.0

Experimental

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

GitHubRepositoryProps Struct ​

Construction properties of GitHubRepository.

Example ​

ts
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', 'amzn-s3-demo-bucket'),
  contentsKey: 'import.zip',
});
python
import aws_cdk.aws_codestar_alpha as codestar
import aws_cdk.aws_s3 as s3


codestar.GitHubRepository(self, "GitHubRepo",
    owner="aws",
    repository_name="aws-cdk",
    access_token=SecretValue.secrets_manager("my-github-token",
        json_field="token"
    ),
    contents_bucket=s3.Bucket.from_bucket_name(self, "Bucket", "amzn-s3-demo-bucket"),
    contents_key="import.zip"
)
java
import software.amazon.awscdk.services.codestar.alpha.*;
import software.amazon.awscdk.services.s3.*;


GitHubRepository.Builder.create(this, "GitHubRepo")
        .owner("aws")
        .repositoryName("aws-cdk")
        .accessToken(SecretValue.secretsManager("my-github-token", SecretsManagerSecretOptions.builder()
                .jsonField("token")
                .build()))
        .contentsBucket(Bucket.fromBucketName(this, "Bucket", "amzn-s3-demo-bucket"))
        .contentsKey("import.zip")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.CodeStar.Alpha
using Amazon.CDK.AWS.Codestar.Alpha;
using Amazon.CDK.AWS.S3;


new GitHubRepository(this, "GitHubRepo", new GitHubRepositoryProps {
    Owner = "aws",
    RepositoryName = "aws-cdk",
    AccessToken = SecretValue.SecretsManager("my-github-token", new SecretsManagerSecretOptions {
        JsonField = "token"
    }),
    ContentsBucket = Bucket.FromBucketName(this, "Bucket", "amzn-s3-demo-bucket"),
    ContentsKey = "import.zip"
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdkcodestaralpha/v2
import codestar "github.com/aws/aws-cdk-go/awscdkcodestaralpha"
import s3 "github.com/aws/aws-cdk-go/awscdk"


codestar.NewGitHubRepository(this, jsii.String("GitHubRepo"), &GitHubRepositoryProps{
	Owner: jsii.String("aws"),
	RepositoryName: jsii.String("aws-cdk"),
	AccessToken: awscdk.SecretValue_SecretsManager(jsii.String("my-github-token"), &SecretsManagerSecretOptions{
		JsonField: jsii.String("token"),
	}),
	ContentsBucket: s3.Bucket_FromBucketName(this, jsii.String("Bucket"), jsii.String("amzn-s3-demo-bucket")),
	ContentsKey: jsii.String("import.zip"),
})

Properties ​

accessTokenSecretValueaccess_tokenSecretValueaccessTokenSecretValueAccessTokenSecretValueAccessTokenSecretValue required #
The GitHub user's personal access token for the GitHub repository.
contentsBucketIBucketRefcontents_bucketIBucketRefcontentsBucketIBucketRefContentsBucketIBucketRefContentsBucketIBucketRef required #
The name of the Amazon S3 bucket that contains the ZIP file with the content to be committed to the new repository.
contentsKeystringcontents_keystrcontentsKeyStringContentsKeystringContentsKey*string required #
The S3 object key or file name for the ZIP file.
contentsS3Versionoptionalstringcontents_s3_versionoptionalstrcontentsS3VersionoptionalStringContentsS3VersionoptionalstringContentsS3Versionoptional*string #
The object version of the ZIP file, if versioning is enabled for the Amazon S3 bucket.

Default: not specified

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #
A comment or description about the new repository.

Default: no description

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

enableIssuesoptionalbooleanenable_issuesoptionalboolenableIssuesoptionalBooleanEnableIssuesoptionalboolEnableIssuesoptional*bool = true #
Indicates whether to enable issues for the GitHub repository.

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

ownerstringownerstrownerStringOwnerstringOwner*string required #
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

repositoryNamestringrepository_namestrrepositoryNameStringRepositoryNamestringRepositoryName*string required #
The name of the repository you want to create in GitHub with AWS CloudFormation stack creation.
visibilityoptionalRepositoryVisibilityvisibilityoptionalRepositoryVisibilityvisibilityoptionalRepositoryVisibilityVisibilityoptionalRepositoryVisibilityVisibilityoptionalRepositoryVisibility = RepositoryVisibility.PUBLIC #
Indicates whether the GitHub repository is a private repository.

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