@Internal public static interface IProject.Jsii$Default extends IProject, IResource.Jsii$Default, INotificationRuleSource.Jsii$Default, IConnectable.Jsii$Default, IGrantable.Jsii$Default
IProject.IProject.Jsii$Default, IProject.Jsii$Proxy| Modifier and Type | Method and Description |
|---|---|
default void |
addToRolePolicy(PolicyStatement policyStatement) |
default void |
applyRemovalPolicy(RemovalPolicy policy)
Apply the given removal policy to this resource.
|
default NotificationRuleSourceConfig |
bindAsNotificationRuleSource(software.constructs.Construct scope)
Returns a source configuration for notification rule.
|
default BatchBuildConfig |
enableBatchBuilds()
Enable batch builds.
|
default Connections |
getConnections()
The network connections associated with this resource.
|
default ResourceEnvironment |
getEnv()
The environment this resource belongs to.
|
default IPrincipal |
getGrantPrincipal()
The principal to grant permissions to.
|
default software.constructs.Node |
getNode()
The tree node.
|
default String |
getProjectArn()
The ARN of this Project.
|
default String |
getProjectName()
The human-visible name of this Project.
|
default IRole |
getRole()
The IAM service Role of this Project.
|
default Stack |
getStack()
The stack in which this resource is defined.
|
default Metric |
metric(String metricName,
MetricOptions props) |
default Metric |
metricBuilds(MetricOptions props)
Measures the number of builds triggered.
|
default Metric |
metricDuration(MetricOptions props)
Measures the duration of all builds over time.
|
default Metric |
metricFailedBuilds(MetricOptions props)
Measures the number of builds that failed because of client error or because of a timeout.
|
default Metric |
metricSucceededBuilds(MetricOptions props)
Measures the number of successful builds.
|
default INotificationRule |
notifyOn(String id,
INotificationRuleTarget target,
ProjectNotifyOnOptions options)
Defines a CodeStar Notification rule triggered when the project events emitted by you specified, it very similar to `onEvent` API.
|
default INotificationRule |
notifyOnBuildFailed(String id,
INotificationRuleTarget target,
NotificationRuleOptions options)
Defines a CodeStar notification rule which triggers when a build fails.
|
default INotificationRule |
notifyOnBuildSucceeded(String id,
INotificationRuleTarget target,
NotificationRuleOptions options)
Defines a CodeStar notification rule which triggers when a build completes successfully.
|
default Rule |
onBuildFailed(String id,
OnEventOptions options)
Defines an event rule which triggers when a build fails.
|
default Rule |
onBuildStarted(String id,
OnEventOptions options)
Defines an event rule which triggers when a build starts.
|
default Rule |
onBuildSucceeded(String id,
OnEventOptions options)
Defines an event rule which triggers when a build completes successfully.
|
default Rule |
onEvent(String id,
OnEventOptions options)
Defines a CloudWatch event rule triggered when something happens with this project.
|
default Rule |
onPhaseChange(String id,
OnEventOptions options)
Defines a CloudWatch event rule that triggers upon phase change of this build project.
|
default Rule |
onStateChange(String id,
OnEventOptions options)
Defines a CloudWatch event rule triggered when the build project state changes.
|
metric, metricBuilds, metricDuration, metricFailedBuilds, metricSucceededBuilds, notifyOnBuildFailed, notifyOnBuildSucceeded, onBuildFailed, onBuildStarted, onBuildSucceeded, onEvent, onPhaseChange, onStateChange@Stability(value=Stable) @NotNull default software.constructs.Node getNode()
getNode in interface software.constructs.IConstructgetNode in interface software.constructs.IConstruct.Jsii$DefaultgetNode in interface IResource.Jsii$Default@Stability(value=Stable) @NotNull default ResourceEnvironment getEnv()
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.
getEnv in interface IResourcegetEnv in interface IResource.Jsii$Default@Stability(value=Stable) @NotNull default Stack getStack()
getStack in interface IResourcegetStack in interface IResource.Jsii$Default@Stability(value=Stable) @NotNull default IPrincipal getGrantPrincipal()
getGrantPrincipal in interface IGrantablegetGrantPrincipal in interface IGrantable.Jsii$Default@Stability(value=Stable) @NotNull default Connections getConnections()
getConnections in interface IConnectablegetConnections in interface IConnectable.Jsii$Default@Stability(value=Stable) @NotNull default String getProjectArn()
getProjectArn in interface IProject@Stability(value=Stable) @NotNull default String getProjectName()
getProjectName in interface IProject@Stability(value=Stable) @Nullable default IRole getRole()
Undefined for imported Projects.
@Stability(value=Stable)
default void applyRemovalPolicy(@NotNull
RemovalPolicy policy)
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).
applyRemovalPolicy in interface IResourceapplyRemovalPolicy in interface IResource.Jsii$Defaultpolicy - This parameter is required.@Stability(value=Stable) @NotNull default NotificationRuleSourceConfig bindAsNotificationRuleSource(@NotNull software.constructs.Construct scope)
bindAsNotificationRuleSource in interface INotificationRuleSourcebindAsNotificationRuleSource in interface INotificationRuleSource.Jsii$Defaultscope - This parameter is required.@Stability(value=Stable)
default void addToRolePolicy(@NotNull
PolicyStatement policyStatement)
addToRolePolicy in interface IProjectpolicyStatement - This parameter is required.@Stability(value=Stable) @Nullable default BatchBuildConfig enableBatchBuilds()
Returns an object contining the batch service role if batch builds could be enabled.
enableBatchBuilds in interface IProject@Stability(value=Stable) @NotNull default Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
@Stability(value=Stable) @NotNull default Metric metricBuilds(@Nullable MetricOptions props)
Units: Count
Valid CloudWatch statistics: Sum
Default: sum over 5 minutes
metricBuilds in interface IProjectprops - @Stability(value=Stable) @NotNull default Metric metricDuration(@Nullable MetricOptions props)
Units: Seconds
Valid CloudWatch statistics: Average (recommended), Maximum, Minimum
Default: average over 5 minutes
metricDuration in interface IProjectprops - @Stability(value=Stable) @NotNull default Metric metricFailedBuilds(@Nullable MetricOptions props)
Units: Count
Valid CloudWatch statistics: Sum
Default: sum over 5 minutes
metricFailedBuilds in interface IProjectprops - @Stability(value=Stable) @NotNull default Metric metricSucceededBuilds(@Nullable MetricOptions props)
Units: Count
Valid CloudWatch statistics: Sum
Default: sum over 5 minutes
metricSucceededBuilds in interface IProjectprops - @Stability(value=Stable) @NotNull default INotificationRule notifyOn(@NotNull String id, @NotNull INotificationRuleTarget target, @NotNull ProjectNotifyOnOptions options)
You can also use the methods notifyOnBuildSucceeded and
notifyOnBuildFailed to define rules for these specific event emitted.
notifyOn in interface IProjectid - The logical identifier of the CodeStar Notifications rule that will be created. This parameter is required.target - The target to register for the CodeStar Notifications destination. This parameter is required.options - Customization options for CodeStar Notifications rule. This parameter is required.@Stability(value=Stable) @NotNull default INotificationRule notifyOnBuildFailed(@NotNull String id, @NotNull INotificationRuleTarget target, @Nullable NotificationRuleOptions options)
notifyOnBuildFailed in interface IProjectid - This parameter is required.target - This parameter is required.options - @Stability(value=Stable) @NotNull default INotificationRule notifyOnBuildSucceeded(@NotNull String id, @NotNull INotificationRuleTarget target, @Nullable NotificationRuleOptions options)
notifyOnBuildSucceeded in interface IProjectid - This parameter is required.target - This parameter is required.options - @Stability(value=Stable) @NotNull default Rule onBuildFailed(@NotNull String id, @Nullable OnEventOptions options)
onBuildFailed in interface IProjectid - This parameter is required.options - @Stability(value=Stable) @NotNull default Rule onBuildStarted(@NotNull String id, @Nullable OnEventOptions options)
onBuildStarted in interface IProjectid - This parameter is required.options - @Stability(value=Stable) @NotNull default Rule onBuildSucceeded(@NotNull String id, @Nullable OnEventOptions options)
onBuildSucceeded in interface IProjectid - This parameter is required.options - @Stability(value=Stable) @NotNull default Rule onEvent(@NotNull String id, @Nullable OnEventOptions options)
onEvent in interface IProjectid - This parameter is required.options - @Stability(value=Stable) @NotNull default Rule onPhaseChange(@NotNull String id, @Nullable OnEventOptions options)
onPhaseChange in interface IProjectid - This parameter is required.options - @Stability(value=Stable) @NotNull default Rule onStateChange(@NotNull String id, @Nullable OnEventOptions options)
You can filter specific build status events using an event
pattern filter on the build-status detail field:
const rule = project.onStateChange('OnBuildStarted', { target });
rule.addEventPattern({
detail: {
'build-status': [
"IN_PROGRESS",
"SUCCEEDED",
"FAILED",
"STOPPED"
]
}
});
You can also use the methods onBuildFailed and onBuildSucceeded to define rules for
these specific state changes.
To access fields from the event in the event target input,
use the static fields on the StateChangeEvent class.
onStateChange in interface IProjectid - This parameter is required.options - Copyright © 2022. All rights reserved.