@Internal public static interface IProject.Jsii$Default extends IProject, IResource.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 BatchBuildConfig |
enableBatchBuilds()
(experimental) Enable batch builds.
|
default Connections |
getConnections() |
default ResourceEnvironment |
getEnv()
(experimental) The environment this resource belongs to.
|
default IPrincipal |
getGrantPrincipal()
(experimental) The principal to grant permissions to.
|
default software.constructs.Node |
getNode()
The tree node.
|
default String |
getProjectArn()
(experimental) The ARN of this Project.
|
default String |
getProjectName()
(experimental) The human-visible name of this Project.
|
default IRole |
getRole()
(experimental) The IAM service Role of this Project.
|
default Stack |
getStack()
(experimental) The stack in which this resource is defined.
|
default Metric |
metric(String metricName,
MetricOptions props) |
default Metric |
metricBuilds(MetricOptions props)
(experimental) Measures the number of builds triggered.
|
default Metric |
metricDuration(MetricOptions props)
(experimental) Measures the duration of all builds over time.
|
default Metric |
metricFailedBuilds(MetricOptions props)
(experimental) Measures the number of builds that failed because of client error or because of a timeout.
|
default Metric |
metricSucceededBuilds(MetricOptions props)
(experimental) Measures the number of successful builds.
|
default Rule |
onBuildFailed(String id,
OnEventOptions options)
(experimental) Defines an event rule which triggers when a build fails.
|
default Rule |
onBuildStarted(String id,
OnEventOptions options)
(experimental) Defines an event rule which triggers when a build starts.
|
default Rule |
onBuildSucceeded(String id,
OnEventOptions options)
(experimental) Defines an event rule which triggers when a build completes successfully.
|
default Rule |
onEvent(String id,
OnEventOptions options)
(experimental) Defines a CloudWatch event rule triggered when something happens with this project.
|
default Rule |
onPhaseChange(String id,
OnEventOptions options)
(experimental) Defines a CloudWatch event rule that triggers upon phase change of this build project.
|
default Rule |
onStateChange(String id,
OnEventOptions options)
(experimental) Defines a CloudWatch event rule triggered when the build project state changes.
|
metric, metricBuilds, metricDuration, metricFailedBuilds, metricSucceededBuilds, 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=Experimental) @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=Experimental) @NotNull default Stack getStack()
getStack in interface IResourcegetStack in interface IResource.Jsii$Default@Stability(value=Experimental) @NotNull default IPrincipal getGrantPrincipal()
getGrantPrincipal in interface IGrantablegetGrantPrincipal in interface IGrantable.Jsii$Default@Stability(value=Experimental) @NotNull default Connections getConnections()
getConnections in interface IConnectablegetConnections in interface IConnectable.Jsii$Default@Stability(value=Experimental) @NotNull default String getProjectArn()
getProjectArn in interface IProject@Stability(value=Experimental) @NotNull default String getProjectName()
getProjectName in interface IProject@Stability(value=Experimental) @Nullable default IRole getRole()
Undefined for imported Projects.
@Stability(value=Experimental)
default void addToRolePolicy(@NotNull
PolicyStatement policyStatement)
addToRolePolicy in interface IProjectpolicyStatement - This parameter is required.@Stability(value=Experimental) @Nullable default BatchBuildConfig enableBatchBuilds()
Returns an object contining the batch service role if batch builds could be enabled.
enableBatchBuilds in interface IProject@Stability(value=Experimental) @NotNull default Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
@Stability(value=Experimental) @NotNull default Metric metricBuilds(@Nullable MetricOptions props)
Units: Count
Valid CloudWatch statistics: Sum
Default: sum over 5 minutes
metricBuilds in interface IProjectprops - @Stability(value=Experimental) @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=Experimental) @NotNull default Metric metricFailedBuilds(@Nullable MetricOptions props)
Units: Count
Valid CloudWatch statistics: Sum
Default: sum over 5 minutes
metricFailedBuilds in interface IProjectprops - @Stability(value=Experimental) @NotNull default Metric metricSucceededBuilds(@Nullable MetricOptions props)
Units: Count
Valid CloudWatch statistics: Sum
Default: sum over 5 minutes
metricSucceededBuilds in interface IProjectprops - @Stability(value=Experimental) @NotNull default Rule onBuildFailed(@NotNull String id, @Nullable OnEventOptions options)
onBuildFailed in interface IProjectid - This parameter is required.options - @Stability(value=Experimental) @NotNull default Rule onBuildStarted(@NotNull String id, @Nullable OnEventOptions options)
onBuildStarted in interface IProjectid - This parameter is required.options - @Stability(value=Experimental) @NotNull default Rule onBuildSucceeded(@NotNull String id, @Nullable OnEventOptions options)
onBuildSucceeded in interface IProjectid - This parameter is required.options - @Stability(value=Experimental) @NotNull default Rule onEvent(@NotNull String id, @Nullable OnEventOptions options)
@Stability(value=Experimental) @NotNull default Rule onPhaseChange(@NotNull String id, @Nullable OnEventOptions options)
onPhaseChange in interface IProjectid - This parameter is required.options - https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html@Stability(value=Experimental) @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 - https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.htmlCopyright © 2021. All rights reserved.