@Generated(value="jsii-pacmak/1.30.0 (build adae23f)", date="2021-06-30T10:00:56.549Z") @Stability(value=Experimental) public class Project extends Resource implements IProject
| Modifier and Type | Class and Description |
|---|---|
static class |
Project.Builder
(experimental) A fluent builder for
Project. |
software.amazon.jsii.JsiiObject.InitializationModeIProject.Jsii$Default, IProject.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
Project(software.constructs.Construct scope,
String id,
ProjectProps props) |
protected |
Project(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Project(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
void |
addFileSystemLocation(IFileSystemLocation fileSystemLocation)
(experimental) Adds a fileSystemLocation to the Project.
|
void |
addSecondaryArtifact(IArtifacts secondaryArtifact)
(experimental) Adds a secondary artifact to the Project.
|
void |
addSecondarySource(ISource secondarySource)
(experimental) Adds a secondary source to the Project.
|
void |
addToRolePolicy(PolicyStatement statement)
(experimental) Add a permission only if there's a policy attached.
|
void |
bindToCodePipeline(software.constructs.Construct _scope,
BindToCodePipelineOptions options)
(experimental) A callback invoked when the given project is added to a CodePipeline.
|
BatchBuildConfig |
enableBatchBuilds()
(experimental) Enable batch builds.
|
static IProject |
fromProjectArn(software.constructs.Construct scope,
String id,
String projectArn) |
static IProject |
fromProjectName(software.constructs.Construct scope,
String id,
String projectName)
(experimental) Import a Project defined either outside the CDK, or in a different CDK Stack (and exported using the
export method). |
Connections |
getConnections()
(experimental) Access the Connections object.
|
IPrincipal |
getGrantPrincipal()
(experimental) The principal to grant permissions to.
|
String |
getProjectArn()
(experimental) The ARN of the project.
|
String |
getProjectName()
(experimental) The name of the project.
|
IRole |
getRole()
(experimental) The IAM role for this project.
|
Metric |
metric(String metricName) |
Metric |
metric(String metricName,
MetricOptions props) |
Metric |
metricBuilds()
(experimental) Measures the number of builds triggered.
|
Metric |
metricBuilds(MetricOptions props)
(experimental) Measures the number of builds triggered.
|
Metric |
metricDuration()
(experimental) Measures the duration of all builds over time.
|
Metric |
metricDuration(MetricOptions props)
(experimental) Measures the duration of all builds over time.
|
Metric |
metricFailedBuilds()
(experimental) Measures the number of builds that failed because of client error or because of a timeout.
|
Metric |
metricFailedBuilds(MetricOptions props)
(experimental) Measures the number of builds that failed because of client error or because of a timeout.
|
Metric |
metricSucceededBuilds()
(experimental) Measures the number of successful builds.
|
Metric |
metricSucceededBuilds(MetricOptions props)
(experimental) Measures the number of successful builds.
|
Rule |
onBuildFailed(String id)
(experimental) Defines an event rule which triggers when a build fails.
|
Rule |
onBuildFailed(String id,
OnEventOptions options)
(experimental) Defines an event rule which triggers when a build fails.
|
Rule |
onBuildStarted(String id)
(experimental) Defines an event rule which triggers when a build starts.
|
Rule |
onBuildStarted(String id,
OnEventOptions options)
(experimental) Defines an event rule which triggers when a build starts.
|
Rule |
onBuildSucceeded(String id)
(experimental) Defines an event rule which triggers when a build completes successfully.
|
Rule |
onBuildSucceeded(String id,
OnEventOptions options)
(experimental) Defines an event rule which triggers when a build completes successfully.
|
Rule |
onEvent(String id)
(experimental) Defines a CloudWatch event rule triggered when something happens with this project.
|
Rule |
onEvent(String id,
OnEventOptions options)
(experimental) Defines a CloudWatch event rule triggered when something happens with this project.
|
Rule |
onPhaseChange(String id)
(experimental) Defines a CloudWatch event rule that triggers upon phase change of this build project.
|
Rule |
onPhaseChange(String id,
OnEventOptions options)
(experimental) Defines a CloudWatch event rule that triggers upon phase change of this build project.
|
Rule |
onStateChange(String id)
(experimental) Defines a CloudWatch event rule triggered when the build project state changes.
|
Rule |
onStateChange(String id,
OnEventOptions options)
(experimental) Defines a CloudWatch event rule triggered when the build project state changes.
|
static List<CfnProject.EnvironmentVariableProperty> |
serializeEnvVariables(Map<String,? extends BuildEnvironmentVariable> environmentVariables)
(experimental) Convert the environment variables map of string to
BuildEnvironmentVariable, which is the customer-facing type, to a list of CfnProject.EnvironmentVariableProperty, which is the representation of environment variables in CloudFormation. |
static List<CfnProject.EnvironmentVariableProperty> |
serializeEnvVariables(Map<String,? extends BuildEnvironmentVariable> environmentVariables,
Boolean validateNoPlainTextSecrets)
(experimental) Convert the environment variables map of string to
BuildEnvironmentVariable, which is the customer-facing type, to a list of CfnProject.EnvironmentVariableProperty, which is the representation of environment variables in CloudFormation. |
static List<CfnProject.EnvironmentVariableProperty> |
serializeEnvVariables(Map<String,? extends BuildEnvironmentVariable> environmentVariables,
Boolean validateNoPlainTextSecrets,
IGrantable principal)
(experimental) Convert the environment variables map of string to
BuildEnvironmentVariable, which is the customer-facing type, to a list of CfnProject.EnvironmentVariableProperty, which is the representation of environment variables in CloudFormation. |
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected Project(software.amazon.jsii.JsiiObjectRef objRef)
protected Project(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public Project(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
ProjectProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Experimental) @NotNull public static IProject fromProjectArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String projectArn)
scope - This parameter is required.id - This parameter is required.projectArn - This parameter is required.@Stability(value=Experimental) @NotNull public static IProject fromProjectName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String projectName)
export method).
scope - the parent Construct for this Construct. This parameter is required.id - the logical name of this Construct. This parameter is required.projectName - the name of the project to import. This parameter is required.@Stability(value=Experimental) @NotNull public static List<CfnProject.EnvironmentVariableProperty> serializeEnvVariables(@NotNull Map<String,? extends BuildEnvironmentVariable> environmentVariables, @Nullable Boolean validateNoPlainTextSecrets, @Nullable IGrantable principal)
BuildEnvironmentVariable, which is the customer-facing type, to a list of CfnProject.EnvironmentVariableProperty, which is the representation of environment variables in CloudFormation.
environmentVariables - the map of string to environment variables. This parameter is required.validateNoPlainTextSecrets - whether to throw an exception if any of the plain text environment variables contain secrets, defaults to 'false'.principal - CfnProject.EnvironmentVariableProperty instances@Stability(value=Experimental) @NotNull public static List<CfnProject.EnvironmentVariableProperty> serializeEnvVariables(@NotNull Map<String,? extends BuildEnvironmentVariable> environmentVariables, @Nullable Boolean validateNoPlainTextSecrets)
BuildEnvironmentVariable, which is the customer-facing type, to a list of CfnProject.EnvironmentVariableProperty, which is the representation of environment variables in CloudFormation.
environmentVariables - the map of string to environment variables. This parameter is required.validateNoPlainTextSecrets - whether to throw an exception if any of the plain text environment variables contain secrets, defaults to 'false'.CfnProject.EnvironmentVariableProperty instances@Stability(value=Experimental) @NotNull public static List<CfnProject.EnvironmentVariableProperty> serializeEnvVariables(@NotNull Map<String,? extends BuildEnvironmentVariable> environmentVariables)
BuildEnvironmentVariable, which is the customer-facing type, to a list of CfnProject.EnvironmentVariableProperty, which is the representation of environment variables in CloudFormation.
environmentVariables - the map of string to environment variables. This parameter is required.CfnProject.EnvironmentVariableProperty instances@Stability(value=Experimental)
public void addFileSystemLocation(@NotNull
IFileSystemLocation fileSystemLocation)
fileSystemLocation - the fileSystemLocation to add. This parameter is required.@Stability(value=Experimental)
public void addSecondaryArtifact(@NotNull
IArtifacts secondaryArtifact)
secondaryArtifact - the artifact to add as a secondary artifact. This parameter is required.https://docs.aws.amazon.com/codebuild/latest/userguide/sample-multi-in-out.html@Stability(value=Experimental)
public void addSecondarySource(@NotNull
ISource secondarySource)
secondarySource - the source to add as a secondary source. This parameter is required.https://docs.aws.amazon.com/codebuild/latest/userguide/sample-multi-in-out.html@Stability(value=Experimental)
public void addToRolePolicy(@NotNull
PolicyStatement statement)
addToRolePolicy in interface IProjectstatement - The permissions statement to add. This parameter is required.@Stability(value=Experimental)
public void bindToCodePipeline(@NotNull
software.constructs.Construct _scope,
@NotNull
BindToCodePipelineOptions options)
_scope - the construct the binding is taking place in. This parameter is required.options - additional options for the binding. This parameter is required.@Stability(value=Experimental) @Nullable public BatchBuildConfig enableBatchBuilds()
Returns an object contining the batch service role if batch builds could be enabled.
enableBatchBuilds in interface IProject@Stability(value=Experimental) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
@Stability(value=Experimental) @NotNull public Metric metricBuilds(@Nullable MetricOptions props)
Units: Count
Valid CloudWatch statistics: Sum
Default: sum over 5 minutes
metricBuilds in interface IProjectprops - @Stability(value=Experimental) @NotNull public Metric metricBuilds()
Units: Count
Valid CloudWatch statistics: Sum
Default: sum over 5 minutes
metricBuilds in interface IProject@Stability(value=Experimental) @NotNull public 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 public Metric metricDuration()
Units: Seconds
Valid CloudWatch statistics: Average (recommended), Maximum, Minimum
Default: average over 5 minutes
metricDuration in interface IProject@Stability(value=Experimental) @NotNull public Metric metricFailedBuilds(@Nullable MetricOptions props)
Units: Count
Valid CloudWatch statistics: Sum
Default: sum over 5 minutes
metricFailedBuilds in interface IProjectprops - @Stability(value=Experimental) @NotNull public Metric metricFailedBuilds()
Units: Count
Valid CloudWatch statistics: Sum
Default: sum over 5 minutes
metricFailedBuilds in interface IProject@Stability(value=Experimental) @NotNull public Metric metricSucceededBuilds(@Nullable MetricOptions props)
Units: Count
Valid CloudWatch statistics: Sum
Default: sum over 5 minutes
metricSucceededBuilds in interface IProjectprops - @Stability(value=Experimental) @NotNull public Metric metricSucceededBuilds()
Units: Count
Valid CloudWatch statistics: Sum
Default: sum over 5 minutes
metricSucceededBuilds in interface IProject@Stability(value=Experimental) @NotNull public Rule onBuildFailed(@NotNull String id, @Nullable OnEventOptions options)
To access fields from the event in the event target input,
use the static fields on the StateChangeEvent class.
onBuildFailed in interface IProjectid - This parameter is required.options - @Stability(value=Experimental) @NotNull public Rule onBuildFailed(@NotNull String id)
To access fields from the event in the event target input,
use the static fields on the StateChangeEvent class.
onBuildFailed in interface IProjectid - This parameter is required.@Stability(value=Experimental) @NotNull public Rule onBuildStarted(@NotNull String id, @Nullable OnEventOptions options)
To access fields from the event in the event target input,
use the static fields on the StateChangeEvent class.
onBuildStarted in interface IProjectid - This parameter is required.options - @Stability(value=Experimental) @NotNull public Rule onBuildStarted(@NotNull String id)
To access fields from the event in the event target input,
use the static fields on the StateChangeEvent class.
onBuildStarted in interface IProjectid - This parameter is required.@Stability(value=Experimental) @NotNull public Rule onBuildSucceeded(@NotNull String id, @Nullable OnEventOptions options)
To access fields from the event in the event target input,
use the static fields on the StateChangeEvent class.
onBuildSucceeded in interface IProjectid - This parameter is required.options - @Stability(value=Experimental) @NotNull public Rule onBuildSucceeded(@NotNull String id)
To access fields from the event in the event target input,
use the static fields on the StateChangeEvent class.
onBuildSucceeded in interface IProjectid - This parameter is required.@Stability(value=Experimental) @NotNull public Rule onEvent(@NotNull String id, @Nullable OnEventOptions options)
@Stability(value=Experimental) @NotNull public Rule onEvent(@NotNull String id)
@Stability(value=Experimental) @NotNull public 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 public Rule onPhaseChange(@NotNull String id)
onPhaseChange in interface IProjectid - This parameter is required.https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html@Stability(value=Experimental) @NotNull public 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.html@Stability(value=Experimental) @NotNull public Rule onStateChange(@NotNull String id)
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.https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html@Stability(value=Experimental) @NotNull public Connections getConnections()
Will fail if this Project does not have a VPC set.
getConnections in interface IConnectable@Stability(value=Experimental) @NotNull public IPrincipal getGrantPrincipal()
getGrantPrincipal in interface IGrantable@Stability(value=Experimental) @NotNull public String getProjectArn()
getProjectArn in interface IProject@Stability(value=Experimental) @NotNull public String getProjectName()
getProjectName in interface IProjectCopyright © 2021. All rights reserved.