Class Repository
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.codecommit.Repository
- All Implemented Interfaces:
IResource,IRepository,INotificationRuleSource,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:33.567Z")
@Stability(Stable)
public class Repository
extends Resource
implements IRepository
Provides a CodeCommit Repository.
Example:
PipelineProject project;
Repository repository = Repository.Builder.create(this, "MyRepository")
.repositoryName("MyRepository")
.build();
PipelineProject project = new PipelineProject(this, "MyProject");
Artifact sourceOutput = new Artifact();
CodeCommitSourceAction sourceAction = CodeCommitSourceAction.Builder.create()
.actionName("CodeCommit")
.repository(repository)
.output(sourceOutput)
.build();
CodeBuildAction buildAction = CodeBuildAction.Builder.create()
.actionName("CodeBuild")
.project(project)
.input(sourceOutput)
.outputs(List.of(new Artifact())) // optional
.executeBatchBuild(true) // optional, defaults to false
.combineBatchBuildArtifacts(true)
.build();
Pipeline.Builder.create(this, "MyPipeline")
.stages(List.of(StageProps.builder()
.stageName("Source")
.actions(List.of(sourceAction))
.build(), StageProps.builder()
.stageName("Build")
.actions(List.of(buildAction))
.build()))
.build();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.codecommit.IRepository
IRepository.Jsii$Default, IRepository.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRepository(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedRepository(software.amazon.jsii.JsiiObjectRef objRef) Repository(software.constructs.Construct scope, String id, RepositoryProps props) -
Method Summary
Modifier and TypeMethodDescriptionbindAsNotificationRuleSource(software.constructs.Construct _scope) Returns a source configuration for notification rule.static IRepositoryfromRepositoryArn(software.constructs.Construct scope, String id, String repositoryArn) Imports a codecommit repository.static IRepositoryfromRepositoryName(software.constructs.Construct scope, String id, String repositoryName) The ARN of this Repository.The HTTPS (GRC) clone URL.The HTTP clone URL.The SSH clone URL.The human-visible name of this Repository.grant(IGrantable grantee, String... actions) Grant the given principal identity permissions to perform the actions on this repository.grantPull(IGrantable grantee) Grant the given identity permissions to pull this repository.grantPullPush(IGrantable grantee) Grant the given identity permissions to pull and push this repository.grantRead(IGrantable grantee) Grant the given identity permissions to read this repository.notifiyOnPullRequestMerged(String id, INotificationRuleTarget target) Defines a CodeStar Notification rule which triggers when a pull request is merged.notifiyOnPullRequestMerged(String id, INotificationRuleTarget target, NotificationRuleOptions options) Defines a CodeStar Notification rule which triggers when a pull request is merged.Create a trigger to notify another service to run actions on repository events.notify(String arn, RepositoryTriggerOptions options) Create a trigger to notify another service to run actions on repository events.notifyOn(String id, INotificationRuleTarget target, RepositoryNotifyOnOptions options) Defines a CodeStar Notification rule triggered when the project events specified by you are emitted.Defines a CodeStar Notification rule which triggers when an approval rule is overridden.notifyOnApprovalRuleOverridden(String id, INotificationRuleTarget target, NotificationRuleOptions options) Defines a CodeStar Notification rule which triggers when an approval rule is overridden.Defines a CodeStar Notification rule which triggers when an approval status is changed.notifyOnApprovalStatusChanged(String id, INotificationRuleTarget target, NotificationRuleOptions options) Defines a CodeStar Notification rule which triggers when an approval status is changed.notifyOnBranchOrTagCreated(String id, INotificationRuleTarget target) Defines a CodeStar Notification rule which triggers when a new branch or tag is created.notifyOnBranchOrTagCreated(String id, INotificationRuleTarget target, NotificationRuleOptions options) Defines a CodeStar Notification rule which triggers when a new branch or tag is created.notifyOnBranchOrTagDeleted(String id, INotificationRuleTarget target) Defines a CodeStar Notification rule which triggers when a branch or tag is deleted.notifyOnBranchOrTagDeleted(String id, INotificationRuleTarget target, NotificationRuleOptions options) Defines a CodeStar Notification rule which triggers when a branch or tag is deleted.notifyOnPullRequestComment(String id, INotificationRuleTarget target) Defines a CodeStar Notification rule which triggers when a comment is made on a pull request.notifyOnPullRequestComment(String id, INotificationRuleTarget target, NotificationRuleOptions options) Defines a CodeStar Notification rule which triggers when a comment is made on a pull request.notifyOnPullRequestCreated(String id, INotificationRuleTarget target) Defines a CodeStar Notification rule which triggers when a pull request is created.notifyOnPullRequestCreated(String id, INotificationRuleTarget target, NotificationRuleOptions options) Defines a CodeStar Notification rule which triggers when a pull request is created.notifyOnPullRequestMerged(String id, INotificationRuleTarget target) Defines a CodeStar Notification rule which triggers when a pull request is merged.notifyOnPullRequestMerged(String id, INotificationRuleTarget target, NotificationRuleOptions options) Defines a CodeStar Notification rule which triggers when a pull request is merged.Defines a CloudWatch event rule which triggers when a comment is made on a commit.onCommentOnCommit(String id, OnEventOptions options) Defines a CloudWatch event rule which triggers when a comment is made on a commit.Defines a CloudWatch event rule which triggers when a comment is made on a pull request.onCommentOnPullRequest(String id, OnEventOptions options) Defines a CloudWatch event rule which triggers when a comment is made on a pull request.Defines a CloudWatch event rule which triggers when a commit is pushed to a branch.onCommit(String id, OnCommitOptions options) Defines a CloudWatch event rule which triggers when a commit is pushed to a branch.Defines a CloudWatch event rule which triggers for repository events.onEvent(String id, OnEventOptions options) Defines a CloudWatch event rule which triggers for repository events.Defines a CloudWatch event rule which triggers when a pull request state is changed.onPullRequestStateChange(String id, OnEventOptions options) Defines a CloudWatch event rule which triggers when a pull request state is changed.Defines a CloudWatch event rule which triggers when a reference is created (i.e.onReferenceCreated(String id, OnEventOptions options) Defines a CloudWatch event rule which triggers when a reference is created (i.e.Defines a CloudWatch event rule which triggers when a reference is delete (i.e.onReferenceDeleted(String id, OnEventOptions options) Defines a CloudWatch event rule which triggers when a reference is delete (i.e.Defines a CloudWatch event rule which triggers when a reference is updated (i.e.onReferenceUpdated(String id, OnEventOptions options) Defines a CloudWatch event rule which triggers when a reference is updated (i.e.onStateChange(String id) Defines a CloudWatch event rule which triggers when a "CodeCommit Repository State Change" event occurs.onStateChange(String id, OnEventOptions options) Defines a CloudWatch event rule which triggers when a "CodeCommit Repository State Change" event occurs.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
Constructor Details
-
Repository
protected Repository(software.amazon.jsii.JsiiObjectRef objRef) -
Repository
protected Repository(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Repository
@Stability(Stable) public Repository(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull RepositoryProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
fromRepositoryArn
@Stability(Stable) @NotNull public static IRepository fromRepositoryArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String repositoryArn) Imports a codecommit repository.- Parameters:
scope- This parameter is required.id- This parameter is required.repositoryArn- (e.g.arn:aws:codecommit:us-east-1:123456789012:MyDemoRepo). This parameter is required.
-
fromRepositoryName
@Stability(Stable) @NotNull public static IRepository fromRepositoryName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String repositoryName) - Parameters:
scope- This parameter is required.id- This parameter is required.repositoryName- This parameter is required.
-
bindAsNotificationRuleSource
@Stability(Stable) @NotNull public NotificationRuleSourceConfig bindAsNotificationRuleSource(@NotNull software.constructs.Construct _scope) Returns a source configuration for notification rule.- Specified by:
bindAsNotificationRuleSourcein interfaceINotificationRuleSource- Parameters:
_scope- This parameter is required.
-
grant
@Stability(Stable) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull String... actions) Grant the given principal identity permissions to perform the actions on this repository.- Specified by:
grantin interfaceIRepository- Parameters:
grantee- This parameter is required.actions- This parameter is required.
-
grantPull
Grant the given identity permissions to pull this repository.- Specified by:
grantPullin interfaceIRepository- Parameters:
grantee- This parameter is required.
-
grantPullPush
Grant the given identity permissions to pull and push this repository.- Specified by:
grantPullPushin interfaceIRepository- Parameters:
grantee- This parameter is required.
-
grantRead
Grant the given identity permissions to read this repository.- Specified by:
grantReadin interfaceIRepository- Parameters:
grantee- This parameter is required.
-
notifiyOnPullRequestMerged
@Stability(Stable) @NotNull public INotificationRule notifiyOnPullRequestMerged(@NotNull String id, @NotNull INotificationRuleTarget target, @Nullable NotificationRuleOptions options) Defines a CodeStar Notification rule which triggers when a pull request is merged.- Parameters:
id- This parameter is required.target- This parameter is required.options-
-
notifiyOnPullRequestMerged
@Stability(Stable) @NotNull public INotificationRule notifiyOnPullRequestMerged(@NotNull String id, @NotNull INotificationRuleTarget target) Defines a CodeStar Notification rule which triggers when a pull request is merged.- Parameters:
id- This parameter is required.target- This parameter is required.
-
notify
@Stability(Stable) @NotNull public Repository notify(@NotNull String arn, @Nullable RepositoryTriggerOptions options) Create a trigger to notify another service to run actions on repository events.- Parameters:
arn- Arn of the resource that repository events will notify. This parameter is required.options- Trigger options to run actions.
-
notify
Create a trigger to notify another service to run actions on repository events.- Parameters:
arn- Arn of the resource that repository events will notify. This parameter is required.
-
notifyOn
@Stability(Stable) @NotNull public INotificationRule notifyOn(@NotNull String id, @NotNull INotificationRuleTarget target, @NotNull RepositoryNotifyOnOptions options) Defines a CodeStar Notification rule triggered when the project events specified by you are emitted. Similar toonEventAPI.You can also use the methods to define rules for the specific event emitted. eg:
notifyOnPullRequstCreated.- Specified by:
notifyOnin interfaceIRepository- Parameters:
id- This parameter is required.target- This parameter is required.options- This parameter is required.- Returns:
- CodeStar Notifications rule associated with this repository.
-
notifyOnApprovalRuleOverridden
@Stability(Stable) @NotNull public INotificationRule notifyOnApprovalRuleOverridden(@NotNull String id, @NotNull INotificationRuleTarget target, @Nullable NotificationRuleOptions options) Defines a CodeStar Notification rule which triggers when an approval rule is overridden.- Specified by:
notifyOnApprovalRuleOverriddenin interfaceIRepository- Parameters:
id- This parameter is required.target- This parameter is required.options-
-
notifyOnApprovalRuleOverridden
@Stability(Stable) @NotNull public INotificationRule notifyOnApprovalRuleOverridden(@NotNull String id, @NotNull INotificationRuleTarget target) Defines a CodeStar Notification rule which triggers when an approval rule is overridden.- Specified by:
notifyOnApprovalRuleOverriddenin interfaceIRepository- Parameters:
id- This parameter is required.target- This parameter is required.
-
notifyOnApprovalStatusChanged
@Stability(Stable) @NotNull public INotificationRule notifyOnApprovalStatusChanged(@NotNull String id, @NotNull INotificationRuleTarget target, @Nullable NotificationRuleOptions options) Defines a CodeStar Notification rule which triggers when an approval status is changed.- Specified by:
notifyOnApprovalStatusChangedin interfaceIRepository- Parameters:
id- This parameter is required.target- This parameter is required.options-
-
notifyOnApprovalStatusChanged
@Stability(Stable) @NotNull public INotificationRule notifyOnApprovalStatusChanged(@NotNull String id, @NotNull INotificationRuleTarget target) Defines a CodeStar Notification rule which triggers when an approval status is changed.- Specified by:
notifyOnApprovalStatusChangedin interfaceIRepository- Parameters:
id- This parameter is required.target- This parameter is required.
-
notifyOnBranchOrTagCreated
@Stability(Stable) @NotNull public INotificationRule notifyOnBranchOrTagCreated(@NotNull String id, @NotNull INotificationRuleTarget target, @Nullable NotificationRuleOptions options) Defines a CodeStar Notification rule which triggers when a new branch or tag is created.- Specified by:
notifyOnBranchOrTagCreatedin interfaceIRepository- Parameters:
id- This parameter is required.target- This parameter is required.options-
-
notifyOnBranchOrTagCreated
@Stability(Stable) @NotNull public INotificationRule notifyOnBranchOrTagCreated(@NotNull String id, @NotNull INotificationRuleTarget target) Defines a CodeStar Notification rule which triggers when a new branch or tag is created.- Specified by:
notifyOnBranchOrTagCreatedin interfaceIRepository- Parameters:
id- This parameter is required.target- This parameter is required.
-
notifyOnBranchOrTagDeleted
@Stability(Stable) @NotNull public INotificationRule notifyOnBranchOrTagDeleted(@NotNull String id, @NotNull INotificationRuleTarget target, @Nullable NotificationRuleOptions options) Defines a CodeStar Notification rule which triggers when a branch or tag is deleted.- Specified by:
notifyOnBranchOrTagDeletedin interfaceIRepository- Parameters:
id- This parameter is required.target- This parameter is required.options-
-
notifyOnBranchOrTagDeleted
@Stability(Stable) @NotNull public INotificationRule notifyOnBranchOrTagDeleted(@NotNull String id, @NotNull INotificationRuleTarget target) Defines a CodeStar Notification rule which triggers when a branch or tag is deleted.- Specified by:
notifyOnBranchOrTagDeletedin interfaceIRepository- Parameters:
id- This parameter is required.target- This parameter is required.
-
notifyOnPullRequestComment
@Stability(Stable) @NotNull public INotificationRule notifyOnPullRequestComment(@NotNull String id, @NotNull INotificationRuleTarget target, @Nullable NotificationRuleOptions options) Defines a CodeStar Notification rule which triggers when a comment is made on a pull request.- Specified by:
notifyOnPullRequestCommentin interfaceIRepository- Parameters:
id- This parameter is required.target- This parameter is required.options-
-
notifyOnPullRequestComment
@Stability(Stable) @NotNull public INotificationRule notifyOnPullRequestComment(@NotNull String id, @NotNull INotificationRuleTarget target) Defines a CodeStar Notification rule which triggers when a comment is made on a pull request.- Specified by:
notifyOnPullRequestCommentin interfaceIRepository- Parameters:
id- This parameter is required.target- This parameter is required.
-
notifyOnPullRequestCreated
@Stability(Stable) @NotNull public INotificationRule notifyOnPullRequestCreated(@NotNull String id, @NotNull INotificationRuleTarget target, @Nullable NotificationRuleOptions options) Defines a CodeStar Notification rule which triggers when a pull request is created.- Specified by:
notifyOnPullRequestCreatedin interfaceIRepository- Parameters:
id- This parameter is required.target- This parameter is required.options-
-
notifyOnPullRequestCreated
@Stability(Stable) @NotNull public INotificationRule notifyOnPullRequestCreated(@NotNull String id, @NotNull INotificationRuleTarget target) Defines a CodeStar Notification rule which triggers when a pull request is created.- Specified by:
notifyOnPullRequestCreatedin interfaceIRepository- Parameters:
id- This parameter is required.target- This parameter is required.
-
notifyOnPullRequestMerged
@Stability(Stable) @NotNull public INotificationRule notifyOnPullRequestMerged(@NotNull String id, @NotNull INotificationRuleTarget target, @Nullable NotificationRuleOptions options) Defines a CodeStar Notification rule which triggers when a pull request is merged.- Specified by:
notifyOnPullRequestMergedin interfaceIRepository- Parameters:
id- This parameter is required.target- This parameter is required.options-
-
notifyOnPullRequestMerged
@Stability(Stable) @NotNull public INotificationRule notifyOnPullRequestMerged(@NotNull String id, @NotNull INotificationRuleTarget target) Defines a CodeStar Notification rule which triggers when a pull request is merged.- Specified by:
notifyOnPullRequestMergedin interfaceIRepository- Parameters:
id- This parameter is required.target- This parameter is required.
-
onCommentOnCommit
@Stability(Stable) @NotNull public Rule onCommentOnCommit(@NotNull String id, @Nullable OnEventOptions options) Defines a CloudWatch event rule which triggers when a comment is made on a commit.- Specified by:
onCommentOnCommitin interfaceIRepository- Parameters:
id- This parameter is required.options-
-
onCommentOnCommit
Defines a CloudWatch event rule which triggers when a comment is made on a commit.- Specified by:
onCommentOnCommitin interfaceIRepository- Parameters:
id- This parameter is required.
-
onCommentOnPullRequest
@Stability(Stable) @NotNull public Rule onCommentOnPullRequest(@NotNull String id, @Nullable OnEventOptions options) Defines a CloudWatch event rule which triggers when a comment is made on a pull request.- Specified by:
onCommentOnPullRequestin interfaceIRepository- Parameters:
id- This parameter is required.options-
-
onCommentOnPullRequest
Defines a CloudWatch event rule which triggers when a comment is made on a pull request.- Specified by:
onCommentOnPullRequestin interfaceIRepository- Parameters:
id- This parameter is required.
-
onCommit
@Stability(Stable) @NotNull public Rule onCommit(@NotNull String id, @Nullable OnCommitOptions options) Defines a CloudWatch event rule which triggers when a commit is pushed to a branch.- Specified by:
onCommitin interfaceIRepository- Parameters:
id- This parameter is required.options-
-
onCommit
Defines a CloudWatch event rule which triggers when a commit is pushed to a branch.- Specified by:
onCommitin interfaceIRepository- Parameters:
id- This parameter is required.
-
onEvent
@Stability(Stable) @NotNull public Rule onEvent(@NotNull String id, @Nullable OnEventOptions options) Defines a CloudWatch event rule which triggers for repository events.Use
rule.addEventPattern(pattern)to specify a filter.- Specified by:
onEventin interfaceIRepository- Parameters:
id- This parameter is required.options-
-
onEvent
Defines a CloudWatch event rule which triggers for repository events.Use
rule.addEventPattern(pattern)to specify a filter.- Specified by:
onEventin interfaceIRepository- Parameters:
id- This parameter is required.
-
onPullRequestStateChange
@Stability(Stable) @NotNull public Rule onPullRequestStateChange(@NotNull String id, @Nullable OnEventOptions options) Defines a CloudWatch event rule which triggers when a pull request state is changed.- Specified by:
onPullRequestStateChangein interfaceIRepository- Parameters:
id- This parameter is required.options-
-
onPullRequestStateChange
Defines a CloudWatch event rule which triggers when a pull request state is changed.- Specified by:
onPullRequestStateChangein interfaceIRepository- Parameters:
id- This parameter is required.
-
onReferenceCreated
@Stability(Stable) @NotNull public Rule onReferenceCreated(@NotNull String id, @Nullable OnEventOptions options) Defines a CloudWatch event rule which triggers when a reference is created (i.e. a new branch/tag is created) to the repository.- Specified by:
onReferenceCreatedin interfaceIRepository- Parameters:
id- This parameter is required.options-
-
onReferenceCreated
Defines a CloudWatch event rule which triggers when a reference is created (i.e. a new branch/tag is created) to the repository.- Specified by:
onReferenceCreatedin interfaceIRepository- Parameters:
id- This parameter is required.
-
onReferenceDeleted
@Stability(Stable) @NotNull public Rule onReferenceDeleted(@NotNull String id, @Nullable OnEventOptions options) Defines a CloudWatch event rule which triggers when a reference is delete (i.e. a branch/tag is deleted) from the repository.- Specified by:
onReferenceDeletedin interfaceIRepository- Parameters:
id- This parameter is required.options-
-
onReferenceDeleted
Defines a CloudWatch event rule which triggers when a reference is delete (i.e. a branch/tag is deleted) from the repository.- Specified by:
onReferenceDeletedin interfaceIRepository- Parameters:
id- This parameter is required.
-
onReferenceUpdated
@Stability(Stable) @NotNull public Rule onReferenceUpdated(@NotNull String id, @Nullable OnEventOptions options) Defines a CloudWatch event rule which triggers when a reference is updated (i.e. a commit is pushed to an existing or new branch) from the repository.- Specified by:
onReferenceUpdatedin interfaceIRepository- Parameters:
id- This parameter is required.options-
-
onReferenceUpdated
Defines a CloudWatch event rule which triggers when a reference is updated (i.e. a commit is pushed to an existing or new branch) from the repository.- Specified by:
onReferenceUpdatedin interfaceIRepository- Parameters:
id- This parameter is required.
-
onStateChange
@Stability(Stable) @NotNull public Rule onStateChange(@NotNull String id, @Nullable OnEventOptions options) Defines a CloudWatch event rule which triggers when a "CodeCommit Repository State Change" event occurs.- Specified by:
onStateChangein interfaceIRepository- Parameters:
id- This parameter is required.options-
-
onStateChange
Defines a CloudWatch event rule which triggers when a "CodeCommit Repository State Change" event occurs.- Specified by:
onStateChangein interfaceIRepository- Parameters:
id- This parameter is required.
-
getRepositoryArn
The ARN of this Repository.- Specified by:
getRepositoryArnin interfaceIRepository
-
getRepositoryCloneUrlGrc
The HTTPS (GRC) clone URL.HTTPS (GRC) is the protocol to use with git-remote-codecommit (GRC).
It is the recommended method for supporting connections made with federated access, identity providers, and temporary credentials.
- Specified by:
getRepositoryCloneUrlGrcin interfaceIRepository- See Also:
-
getRepositoryCloneUrlHttp
The HTTP clone URL.- Specified by:
getRepositoryCloneUrlHttpin interfaceIRepository
-
getRepositoryCloneUrlSsh
The SSH clone URL.- Specified by:
getRepositoryCloneUrlSshin interfaceIRepository
-
getRepositoryName
The human-visible name of this Repository.- Specified by:
getRepositoryNamein interfaceIRepository
-