io.github.cdklabs.cdk.ecs.codedeploy.EcsDeployment Maven / Gradle / Ivy
Show all versions of cdk-ecs-codedeploy Show documentation
package io.github.cdklabs.cdk.ecs.codedeploy;
/**
* (experimental) A CodeDeploy Deployment for a Amazon ECS service DeploymentGroup.
*
* An EcsDeploymentGroup
* must only have 1 EcsDeployment. This limit is enforced by removing the scope and id
* from the constructor. The scope will always be set to the EcsDeploymentGroup
* and the id will always be set to the string 'Deployment' to force an error if mulitiple
* EcsDeployment constructs are created for a single EcsDeploymentGroup.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-13T18:16:05.259Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdk.ecs.codedeploy.$Module.class, fqn = "@cdklabs/cdk-ecs-codedeploy.EcsDeployment")
public class EcsDeployment extends software.constructs.Construct {
protected EcsDeployment(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected EcsDeployment(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param props This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public EcsDeployment(final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.ecs.codedeploy.EcsDeploymentProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* (experimental) The id of the deployment that was created.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getDeploymentId() {
return software.amazon.jsii.Kernel.get(this, "deploymentId", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) The id of the deployment that was created.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void setDeploymentId(final @org.jetbrains.annotations.NotNull java.lang.String value) {
software.amazon.jsii.Kernel.set(this, "deploymentId", java.util.Objects.requireNonNull(value, "deploymentId is required"));
}
/**
* (experimental) A fluent builder for {@link io.github.cdklabs.cdk.ecs.codedeploy.EcsDeployment}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create() {
return new Builder();
}
private final io.github.cdklabs.cdk.ecs.codedeploy.EcsDeploymentProps.Builder props;
private Builder() {
this.props = new io.github.cdklabs.cdk.ecs.codedeploy.EcsDeploymentProps.Builder();
}
/**
* (experimental) The deployment group to target for this deployment.
*
* @return {@code this}
* @param deploymentGroup The deployment group to target for this deployment. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder deploymentGroup(final software.amazon.awscdk.services.codedeploy.IEcsDeploymentGroup deploymentGroup) {
this.props.deploymentGroup(deploymentGroup);
return this;
}
/**
* (experimental) The ECS service to target for the deployment.
*
* see: https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-resources.html#reference-appspec-file-structure-resources-ecs
*
* @return {@code this}
* @param targetService The ECS service to target for the deployment. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder targetService(final io.github.cdklabs.cdk.ecs.codedeploy.TargetService targetService) {
this.props.targetService(targetService);
return this;
}
/**
* (experimental) The configuration for rollback in the event that a deployment fails.
*
* Default: : no automatic rollback triggered
*
* @return {@code this}
* @param autoRollback The configuration for rollback in the event that a deployment fails. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder autoRollback(final software.amazon.awscdk.services.codedeploy.AutoRollbackConfig autoRollback) {
this.props.autoRollback(autoRollback);
return this;
}
/**
* (experimental) The description for the deployment.
*
* Default: no description
*
* @return {@code this}
* @param description The description for the deployment. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder description(final java.lang.String description) {
this.props.description(description);
return this;
}
/**
* (experimental) Optional lifecycle hooks.
*
* Default: - no lifecycle hooks
*
* @return {@code this}
* @param hooks Optional lifecycle hooks. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder hooks(final io.github.cdklabs.cdk.ecs.codedeploy.AppSpecHooks hooks) {
this.props.hooks(hooks);
return this;
}
/**
* (experimental) The timeout for the deployment.
*
* If the timeout is reached, it will trigger a rollback of the stack.
*
* Default: 30 minutes
*
* @return {@code this}
* @param timeout The timeout for the deployment. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder timeout(final software.amazon.awscdk.Duration timeout) {
this.props.timeout(timeout);
return this;
}
/**
* @return a newly built instance of {@link io.github.cdklabs.cdk.ecs.codedeploy.EcsDeployment}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public io.github.cdklabs.cdk.ecs.codedeploy.EcsDeployment build() {
return new io.github.cdklabs.cdk.ecs.codedeploy.EcsDeployment(
this.props.build()
);
}
}
}