io.github.cdklabs.cdk.ecs.codedeploy.EcsAppSpec Maven / Gradle / Ivy
Show all versions of cdk-ecs-codedeploy Show documentation
package io.github.cdklabs.cdk.ecs.codedeploy;
/**
* (experimental) Represents an AppSpec to be used for ECS services.
*
* see: https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-resources.html#reference-appspec-file-structure-resources-ecs
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-20T18:15:39.062Z")
@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.EcsAppSpec")
public class EcsAppSpec extends software.amazon.jsii.JsiiObject {
protected EcsAppSpec(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected EcsAppSpec(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param targetService This parameter is required.
* @param hooks
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public EcsAppSpec(final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.ecs.codedeploy.TargetService targetService, final @org.jetbrains.annotations.Nullable io.github.cdklabs.cdk.ecs.codedeploy.AppSpecHooks hooks) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(targetService, "targetService is required"), hooks });
}
/**
* @param targetService This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public EcsAppSpec(final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.ecs.codedeploy.TargetService targetService) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(targetService, "targetService is required") });
}
/**
* (experimental) Render JSON string for this AppSpec to be used.
*
* @return string representation of this AppSpec
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String toString() {
return software.amazon.jsii.Kernel.call(this, "toString", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) A fluent builder for {@link io.github.cdklabs.cdk.ecs.codedeploy.EcsAppSpec}.
*/
@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}.
* @param hooks
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final io.github.cdklabs.cdk.ecs.codedeploy.AppSpecHooks hooks) {
return new Builder(hooks);
}
/**
* @return a new instance of {@link Builder}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create() {
return new Builder(null);
}
private final io.github.cdklabs.cdk.ecs.codedeploy.AppSpecHooks hooks;
private final io.github.cdklabs.cdk.ecs.codedeploy.TargetService.Builder targetService;
private Builder(final io.github.cdklabs.cdk.ecs.codedeploy.AppSpecHooks hooks) {
this.hooks = hooks;
this.targetService = new io.github.cdklabs.cdk.ecs.codedeploy.TargetService.Builder();
}
/**
* (experimental) The name of the Amazon ECS container that contains your Amazon ECS application.
*
* It must be a container specified in your Amazon ECS task definition.
*
* @return {@code this}
* @param containerName The name of the Amazon ECS container that contains your Amazon ECS application. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder containerName(final java.lang.String containerName) {
this.targetService.containerName(containerName);
return this;
}
/**
* (experimental) The port on the container where traffic will be routed to.
*
* @return {@code this}
* @param containerPort The port on the container where traffic will be routed to. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder containerPort(final java.lang.Number containerPort) {
this.targetService.containerPort(containerPort);
return this;
}
/**
* (experimental) The TaskDefintion to deploy to the target services.
*
* @return {@code this}
* @param taskDefinition The TaskDefintion to deploy to the target services. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder taskDefinition(final software.amazon.awscdk.services.ecs.ITaskDefinition taskDefinition) {
this.targetService.taskDefinition(taskDefinition);
return this;
}
/**
* (experimental) Network configuration for ECS services that have a network type of awsvpc
.
*
* Default: reuse current network settings for ECS service.
*
* @return {@code this}
* @param awsvpcConfiguration Network configuration for ECS services that have a network type of awsvpc
. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder awsvpcConfiguration(final io.github.cdklabs.cdk.ecs.codedeploy.AwsvpcConfiguration awsvpcConfiguration) {
this.targetService.awsvpcConfiguration(awsvpcConfiguration);
return this;
}
/**
* (experimental) A list of Amazon ECS capacity providers to use for the deployment.
*
* Default: reuse current capcity provider strategy for ECS service.
*
* @return {@code this}
* @param capacityProviderStrategy A list of Amazon ECS capacity providers to use for the deployment. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder capacityProviderStrategy(final java.util.List extends software.amazon.awscdk.services.ecs.CapacityProviderStrategy> capacityProviderStrategy) {
this.targetService.capacityProviderStrategy(capacityProviderStrategy);
return this;
}
/**
* (experimental) The platform version of the Fargate tasks in the deployed Amazon ECS service.
*
* see: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html
*
* Default: LATEST
*
* @return {@code this}
* @param platformVersion The platform version of the Fargate tasks in the deployed Amazon ECS service. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder platformVersion(final software.amazon.awscdk.services.ecs.FargatePlatformVersion platformVersion) {
this.targetService.platformVersion(platformVersion);
return this;
}
/**
* @return a newly built instance of {@link io.github.cdklabs.cdk.ecs.codedeploy.EcsAppSpec}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public io.github.cdklabs.cdk.ecs.codedeploy.EcsAppSpec build() {
return new io.github.cdklabs.cdk.ecs.codedeploy.EcsAppSpec(
this.targetService.build(),
this.hooks
);
}
}
}