io.github.cdklabs.cdk.ecs.codedeploy.ApplicationLoadBalancedCodeDeployedFargateService Maven / Gradle / Ivy
Show all versions of cdk-ecs-codedeploy Show documentation
package io.github.cdklabs.cdk.ecs.codedeploy;
/**
* (experimental) A Fargate service running on an ECS cluster fronted by an application load balancer and deployed by CodeDeploy.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-10-08T18:15:42.226Z")
@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.ApplicationLoadBalancedCodeDeployedFargateService")
public class ApplicationLoadBalancedCodeDeployedFargateService extends software.amazon.awscdk.services.ecs.patterns.ApplicationLoadBalancedFargateService {
protected ApplicationLoadBalancedCodeDeployedFargateService(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected ApplicationLoadBalancedCodeDeployedFargateService(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* (experimental) Constructs a new instance of the ApplicationLoadBalancedCodeDeployedFargateService class.
*
* @param scope This parameter is required.
* @param id This parameter is required.
* @param props This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public ApplicationLoadBalancedCodeDeployedFargateService(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.ecs.codedeploy.ApplicationLoadBalancedCodeDeployedFargateServiceProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* (experimental) Adds service as a target of the target group.
*
* @param service This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
protected void addServiceAsTarget(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ecs.BaseService service) {
software.amazon.jsii.Kernel.call(this, "addServiceAsTarget", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(service, "service is required") });
}
/**
* (experimental) S3 Bucket used for access logs.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.s3.IBucket getAccessLogBucket() {
return software.amazon.jsii.Kernel.get(this, "accessLogBucket", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.s3.IBucket.class));
}
/**
* (experimental) S3 Bucket used for access logs.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void setAccessLogBucket(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.s3.IBucket value) {
software.amazon.jsii.Kernel.set(this, "accessLogBucket", java.util.Objects.requireNonNull(value, "accessLogBucket is required"));
}
/**
* (experimental) CodeDeploy application for this service.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.codedeploy.EcsApplication getApplication() {
return software.amazon.jsii.Kernel.get(this, "application", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.codedeploy.EcsApplication.class));
}
/**
* (experimental) CodeDeploy application for this service.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void setApplication(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.codedeploy.EcsApplication value) {
software.amazon.jsii.Kernel.set(this, "application", java.util.Objects.requireNonNull(value, "application is required"));
}
/**
* (experimental) CodeDeploy deployment for this service.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.ecs.codedeploy.EcsDeployment getDeployment() {
return software.amazon.jsii.Kernel.get(this, "deployment", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.ecs.codedeploy.EcsDeployment.class));
}
/**
* (experimental) CodeDeploy deployment for this service.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void setDeployment(final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.ecs.codedeploy.EcsDeployment value) {
software.amazon.jsii.Kernel.set(this, "deployment", java.util.Objects.requireNonNull(value, "deployment is required"));
}
/**
* (experimental) CodeDeploy deployment group for this service.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.codedeploy.EcsDeploymentGroup getDeploymentGroup() {
return software.amazon.jsii.Kernel.get(this, "deploymentGroup", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.codedeploy.EcsDeploymentGroup.class));
}
/**
* (experimental) CodeDeploy deployment group for this service.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void setDeploymentGroup(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.codedeploy.EcsDeploymentGroup value) {
software.amazon.jsii.Kernel.set(this, "deploymentGroup", java.util.Objects.requireNonNull(value, "deploymentGroup is required"));
}
/**
* (experimental) Test target group to use for CodeDeploy deployments.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.elasticloadbalancingv2.ApplicationTargetGroup getGreenTargetGroup() {
return software.amazon.jsii.Kernel.get(this, "greenTargetGroup", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.elasticloadbalancingv2.ApplicationTargetGroup.class));
}
/**
* (experimental) Test target group to use for CodeDeploy deployments.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void setGreenTargetGroup(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.elasticloadbalancingv2.ApplicationTargetGroup value) {
software.amazon.jsii.Kernel.set(this, "greenTargetGroup", java.util.Objects.requireNonNull(value, "greenTargetGroup is required"));
}
/**
* (experimental) Test listener to use for CodeDeploy deployments.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.elasticloadbalancingv2.ApplicationListener getTestListener() {
return software.amazon.jsii.Kernel.get(this, "testListener", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.elasticloadbalancingv2.ApplicationListener.class));
}
/**
* (experimental) Test listener to use for CodeDeploy deployments.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void setTestListener(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.elasticloadbalancingv2.ApplicationListener value) {
software.amazon.jsii.Kernel.set(this, "testListener", java.util.Objects.requireNonNull(value, "testListener is required"));
}
/**
* (experimental) API Canary for the service.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.Nullable io.github.cdklabs.cdk.ecs.codedeploy.ApiCanary getApiCanary() {
return software.amazon.jsii.Kernel.get(this, "apiCanary", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.ecs.codedeploy.ApiCanary.class));
}
/**
* (experimental) API Canary for the service.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void setApiCanary(final @org.jetbrains.annotations.Nullable io.github.cdklabs.cdk.ecs.codedeploy.ApiCanary value) {
software.amazon.jsii.Kernel.set(this, "apiCanary", value);
}
/**
* (experimental) Composite alarm for monitoring health of service.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.cloudwatch.IAlarm getHealthAlarm() {
return software.amazon.jsii.Kernel.get(this, "healthAlarm", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.cloudwatch.IAlarm.class));
}
/**
* (experimental) Composite alarm for monitoring health of service.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void setHealthAlarm(final @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.cloudwatch.IAlarm value) {
software.amazon.jsii.Kernel.set(this, "healthAlarm", value);
}
/**
* (experimental) A fluent builder for {@link io.github.cdklabs.cdk.ecs.codedeploy.ApplicationLoadBalancedCodeDeployedFargateService}.
*/
@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 scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private final io.github.cdklabs.cdk.ecs.codedeploy.ApplicationLoadBalancedCodeDeployedFargateServiceProps.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
this.props = new io.github.cdklabs.cdk.ecs.codedeploy.ApplicationLoadBalancedCodeDeployedFargateServiceProps.Builder();
}
/**
* A list of Capacity Provider strategies used to place a service.
*
* Default: - undefined
*
* @return {@code this}
* @param capacityProviderStrategies A list of Capacity Provider strategies used to place a service. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder capacityProviderStrategies(final java.util.List extends software.amazon.awscdk.services.ecs.CapacityProviderStrategy> capacityProviderStrategies) {
this.props.capacityProviderStrategies(capacityProviderStrategies);
return this;
}
/**
* Certificate Manager certificate to associate with the load balancer.
*
* Setting this option will set the load balancer protocol to HTTPS.
*
* Default: - No certificate associated with the load balancer, if using
* the HTTP protocol. For HTTPS, a DNS-validated certificate will be
* created for the load balancer's specified domain name if a domain name
* and domain zone are specified.
*
* @return {@code this}
* @param certificate Certificate Manager certificate to associate with the load balancer. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder certificate(final software.amazon.awscdk.services.certificatemanager.ICertificate certificate) {
this.props.certificate(certificate);
return this;
}
/**
* Whether to enable the deployment circuit breaker.
*
* If this property is defined, circuit breaker will be implicitly
* enabled.
*
* Default: - disabled
*
* @return {@code this}
* @param circuitBreaker Whether to enable the deployment circuit breaker. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder circuitBreaker(final software.amazon.awscdk.services.ecs.DeploymentCircuitBreaker circuitBreaker) {
this.props.circuitBreaker(circuitBreaker);
return this;
}
/**
* The options for configuring an Amazon ECS service to use service discovery.
*
* Default: - AWS Cloud Map service discovery is not enabled.
*
* @return {@code this}
* @param cloudMapOptions The options for configuring an Amazon ECS service to use service discovery. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder cloudMapOptions(final software.amazon.awscdk.services.ecs.CloudMapOptions cloudMapOptions) {
this.props.cloudMapOptions(cloudMapOptions);
return this;
}
/**
* The name of the cluster that hosts the service.
*
* If a cluster is specified, the vpc construct should be omitted. Alternatively, you can omit both cluster and vpc.
*
* Default: - create a new cluster; if both cluster and vpc are omitted, a new VPC will be created for you.
*
* @return {@code this}
* @param cluster The name of the cluster that hosts the service. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder cluster(final software.amazon.awscdk.services.ecs.ICluster cluster) {
this.props.cluster(cluster);
return this;
}
/**
* Specifies which deployment controller to use for the service.
*
* For more information, see
* Amazon ECS Deployment Types
*
* Default: - Rolling update (ECS)
*
* @return {@code this}
* @param deploymentController Specifies which deployment controller to use for the service. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder deploymentController(final software.amazon.awscdk.services.ecs.DeploymentController deploymentController) {
this.props.deploymentController(deploymentController);
return this;
}
/**
* The desired number of instantiations of the task definition to keep running on the service.
*
* The minimum value is 1
*
* Default: - The default is 1 for all new services and uses the existing service's desired count
* when updating an existing service.
*
* @return {@code this}
* @param desiredCount The desired number of instantiations of the task definition to keep running on the service. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder desiredCount(final java.lang.Number desiredCount) {
this.props.desiredCount(desiredCount);
return this;
}
/**
* The domain name for the service, e.g. "api.example.com.".
*
* Default: - No domain name.
*
* @return {@code this}
* @param domainName The domain name for the service, e.g. "api.example.com.". This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder domainName(final java.lang.String domainName) {
this.props.domainName(domainName);
return this;
}
/**
* The Route53 hosted zone for the domain, e.g. "example.com.".
*
* Default: - No Route53 hosted domain zone.
*
* @return {@code this}
* @param domainZone The Route53 hosted zone for the domain, e.g. "example.com.". This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder domainZone(final software.amazon.awscdk.services.route53.IHostedZone domainZone) {
this.props.domainZone(domainZone);
return this;
}
/**
* Specifies whether to enable Amazon ECS managed tags for the tasks within the service.
*
* For more information, see
* Tagging Your Amazon ECS Resources
*
* Default: false
*
* @return {@code this}
* @param enableEcsManagedTags Specifies whether to enable Amazon ECS managed tags for the tasks within the service. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder enableEcsManagedTags(final java.lang.Boolean enableEcsManagedTags) {
this.props.enableEcsManagedTags(enableEcsManagedTags);
return this;
}
/**
* Whether ECS Exec should be enabled.
*
* Default: - false
*
* @return {@code this}
* @param enableExecuteCommand Whether ECS Exec should be enabled. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder enableExecuteCommand(final java.lang.Boolean enableExecuteCommand) {
this.props.enableExecuteCommand(enableExecuteCommand);
return this;
}
/**
* The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started.
*
* Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already set
*
* @return {@code this}
* @param healthCheckGracePeriod The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder healthCheckGracePeriod(final software.amazon.awscdk.Duration healthCheckGracePeriod) {
this.props.healthCheckGracePeriod(healthCheckGracePeriod);
return this;
}
/**
* The load balancer idle timeout, in seconds.
*
* Can be between 1 and 4000 seconds
*
* Default: - CloudFormation sets idle timeout to 60 seconds
*
* @return {@code this}
* @param idleTimeout The load balancer idle timeout, in seconds. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder idleTimeout(final software.amazon.awscdk.Duration idleTimeout) {
this.props.idleTimeout(idleTimeout);
return this;
}
/**
* Listener port of the application load balancer that will serve traffic to the service.
*
* Default: - The default listener port is determined from the protocol (port 80 for HTTP,
* port 443 for HTTPS). A domain name and zone must be also be specified if using HTTPS.
*
* @return {@code this}
* @param listenerPort Listener port of the application load balancer that will serve traffic to the service. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder listenerPort(final java.lang.Number listenerPort) {
this.props.listenerPort(listenerPort);
return this;
}
/**
* The application load balancer that will serve traffic to the service.
*
* The VPC attribute of a load balancer must be specified for it to be used
* to create a new service with this pattern.
*
* [disable-awslint:ref-via-interface]
*
* Default: - a new load balancer will be created.
*
* @return {@code this}
* @param loadBalancer The application load balancer that will serve traffic to the service. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder loadBalancer(final software.amazon.awscdk.services.elasticloadbalancingv2.IApplicationLoadBalancer loadBalancer) {
this.props.loadBalancer(loadBalancer);
return this;
}
/**
* Name of the load balancer.
*
* Default: - Automatically generated name.
*
* @return {@code this}
* @param loadBalancerName Name of the load balancer. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder loadBalancerName(final java.lang.String loadBalancerName) {
this.props.loadBalancerName(loadBalancerName);
return this;
}
/**
* The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment.
*
* Default: - 100 if daemon, otherwise 200
*
* @return {@code this}
* @param maxHealthyPercent The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder maxHealthyPercent(final java.lang.Number maxHealthyPercent) {
this.props.maxHealthyPercent(maxHealthyPercent);
return this;
}
/**
* The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment.
*
* Default: - 0 if daemon, otherwise 50
*
* @return {@code this}
* @param minHealthyPercent The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder minHealthyPercent(final java.lang.Number minHealthyPercent) {
this.props.minHealthyPercent(minHealthyPercent);
return this;
}
/**
* Determines whether or not the Security Group for the Load Balancer's Listener will be open to all traffic by default.
*
* Default: true -- The security group allows ingress from all IP addresses.
*
* @return {@code this}
* @param openListener Determines whether or not the Security Group for the Load Balancer's Listener will be open to all traffic by default. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder openListener(final java.lang.Boolean openListener) {
this.props.openListener(openListener);
return this;
}
/**
* Specifies whether to propagate the tags from the task definition or the service to the tasks in the service.
*
* Tags can only be propagated to the tasks within the service during service creation.
*
* Default: - none
*
* @return {@code this}
* @param propagateTags Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder propagateTags(final software.amazon.awscdk.services.ecs.PropagatedTagSource propagateTags) {
this.props.propagateTags(propagateTags);
return this;
}
/**
* The protocol for connections from clients to the load balancer.
*
* The load balancer port is determined from the protocol (port 80 for
* HTTP, port 443 for HTTPS). If HTTPS, either a certificate or domain
* name and domain zone must also be specified.
*
* Default: HTTP. If a certificate is specified, the protocol will be
* set by default to HTTPS.
*
* @return {@code this}
* @param protocol The protocol for connections from clients to the load balancer. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder protocol(final software.amazon.awscdk.services.elasticloadbalancingv2.ApplicationProtocol protocol) {
this.props.protocol(protocol);
return this;
}
/**
* The protocol version to use.
*
* Default: ApplicationProtocolVersion.HTTP1
*
* @return {@code this}
* @param protocolVersion The protocol version to use. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder protocolVersion(final software.amazon.awscdk.services.elasticloadbalancingv2.ApplicationProtocolVersion protocolVersion) {
this.props.protocolVersion(protocolVersion);
return this;
}
/**
* Determines whether the Load Balancer will be internet-facing.
*
* Default: true
*
* @return {@code this}
* @param publicLoadBalancer Determines whether the Load Balancer will be internet-facing. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder publicLoadBalancer(final java.lang.Boolean publicLoadBalancer) {
this.props.publicLoadBalancer(publicLoadBalancer);
return this;
}
/**
* Specifies whether the Route53 record should be a CNAME, an A record using the Alias feature or no record at all.
*
* This is useful if you need to work with DNS systems that do not support alias records.
*
* Default: ApplicationLoadBalancedServiceRecordType.ALIAS
*
* @return {@code this}
* @param recordType Specifies whether the Route53 record should be a CNAME, an A record using the Alias feature or no record at all. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder recordType(final software.amazon.awscdk.services.ecs.patterns.ApplicationLoadBalancedServiceRecordType recordType) {
this.props.recordType(recordType);
return this;
}
/**
* Specifies whether the load balancer should redirect traffic on port 80 to port 443 to support HTTP->HTTPS redirects This is only valid if the protocol of the ALB is HTTPS.
*
* Default: false
*
* @return {@code this}
* @param redirectHttp Specifies whether the load balancer should redirect traffic on port 80 to port 443 to support HTTP->HTTPS redirects This is only valid if the protocol of the ALB is HTTPS. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder redirectHttp(final java.lang.Boolean redirectHttp) {
this.props.redirectHttp(redirectHttp);
return this;
}
/**
* The name of the service.
*
* Default: - CloudFormation-generated name.
*
* @return {@code this}
* @param serviceName The name of the service. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder serviceName(final java.lang.String serviceName) {
this.props.serviceName(serviceName);
return this;
}
/**
* The security policy that defines which ciphers and protocols are supported by the ALB Listener.
*
* Default: - The recommended elastic load balancing security policy
*
* @return {@code this}
* @param sslPolicy The security policy that defines which ciphers and protocols are supported by the ALB Listener. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder sslPolicy(final software.amazon.awscdk.services.elasticloadbalancingv2.SslPolicy sslPolicy) {
this.props.sslPolicy(sslPolicy);
return this;
}
/**
* The protocol for connections from the load balancer to the ECS tasks.
*
* The default target port is determined from the protocol (port 80 for
* HTTP, port 443 for HTTPS).
*
* Default: HTTP.
*
* @return {@code this}
* @param targetProtocol The protocol for connections from the load balancer to the ECS tasks. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder targetProtocol(final software.amazon.awscdk.services.elasticloadbalancingv2.ApplicationProtocol targetProtocol) {
this.props.targetProtocol(targetProtocol);
return this;
}
/**
* The properties required to create a new task definition.
*
* TaskDefinition or TaskImageOptions must be specified, but not both.
*
* Default: none
*
* @return {@code this}
* @param taskImageOptions The properties required to create a new task definition. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder taskImageOptions(final software.amazon.awscdk.services.ecs.patterns.ApplicationLoadBalancedTaskImageOptions taskImageOptions) {
this.props.taskImageOptions(taskImageOptions);
return this;
}
/**
* The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed.
*
* If a vpc is specified, the cluster construct should be omitted. Alternatively, you can omit both vpc and cluster.
*
* Default: - uses the VPC defined in the cluster or creates a new VPC.
*
* @return {@code this}
* @param vpc The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder vpc(final software.amazon.awscdk.services.ec2.IVpc vpc) {
this.props.vpc(vpc);
return this;
}
/**
* The number of cpu units used by the task.
*
* Valid values, which determines your range of valid values for the memory parameter:
*
* 256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB
*
* 512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB
*
* 1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB
*
* 2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments
*
* 4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments
*
* 8192 (8 vCPU) - Available memory values: Between 16GB and 60GB in 4GB increments
*
* 16384 (16 vCPU) - Available memory values: Between 32GB and 120GB in 8GB increments
*
* This default is set in the underlying FargateTaskDefinition construct.
*
* Default: 256
*
* @return {@code this}
* @param cpu The number of cpu units used by the task. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder cpu(final java.lang.Number cpu) {
this.props.cpu(cpu);
return this;
}
/**
* The amount (in GiB) of ephemeral storage to be allocated to the task.
*
* The minimum supported value is 21
GiB and the maximum supported value is 200
GiB.
*
* Only supported in Fargate platform version 1.4.0 or later.
*
* Default: Undefined, in which case, the task will receive 20GiB ephemeral storage.
*
* @return {@code this}
* @param ephemeralStorageGiB The amount (in GiB) of ephemeral storage to be allocated to the task. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder ephemeralStorageGiB(final java.lang.Number ephemeralStorageGiB) {
this.props.ephemeralStorageGiB(ephemeralStorageGiB);
return this;
}
/**
* The amount (in MiB) of memory used by the task.
*
* This field is required and you must use one of the following values, which determines your range of valid values
* for the cpu parameter:
*
* 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 vCPU)
*
* 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: 512 (.5 vCPU)
*
* 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - Available cpu values: 1024 (1 vCPU)
*
* Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - Available cpu values: 2048 (2 vCPU)
*
* Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available cpu values: 4096 (4 vCPU)
*
* Between 16384 (16 GB) and 61440 (60 GB) in increments of 4096 (4 GB) - Available cpu values: 8192 (8 vCPU)
*
* Between 32768 (32 GB) and 122880 (120 GB) in increments of 8192 (8 GB) - Available cpu values: 16384 (16 vCPU)
*
* This default is set in the underlying FargateTaskDefinition construct.
*
* Default: 512
*
* @return {@code this}
* @param memoryLimitMiB The amount (in MiB) of memory used by the task. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder memoryLimitMiB(final java.lang.Number memoryLimitMiB) {
this.props.memoryLimitMiB(memoryLimitMiB);
return this;
}
/**
* The platform version on which to run your service.
*
* If one is not specified, the LATEST platform version is used by default. For more information, see
* AWS Fargate Platform Versions
* in the Amazon Elastic Container Service Developer Guide.
*
* Default: Latest
*
* @return {@code this}
* @param platformVersion The platform version on which to run your service. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder platformVersion(final software.amazon.awscdk.services.ecs.FargatePlatformVersion platformVersion) {
this.props.platformVersion(platformVersion);
return this;
}
/**
* The runtime platform of the task definition.
*
* Default: - If the property is undefined, `operatingSystemFamily` is LINUX and `cpuArchitecture` is X86_64
*
* @return {@code this}
* @param runtimePlatform The runtime platform of the task definition. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder runtimePlatform(final software.amazon.awscdk.services.ecs.RuntimePlatform runtimePlatform) {
this.props.runtimePlatform(runtimePlatform);
return this;
}
/**
* The task definition to use for tasks in the service. TaskDefinition or TaskImageOptions must be specified, but not both.
*
* [disable-awslint:ref-via-interface]
*
* Default: - none
*
* @return {@code this}
* @param taskDefinition The task definition to use for tasks in the service. TaskDefinition or TaskImageOptions must be specified, but not both. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder taskDefinition(final software.amazon.awscdk.services.ecs.FargateTaskDefinition taskDefinition) {
this.props.taskDefinition(taskDefinition);
return this;
}
/**
* Determines whether the service will be assigned a public IP address.
*
* Default: false
*
* @return {@code this}
* @param assignPublicIp Determines whether the service will be assigned a public IP address. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder assignPublicIp(final java.lang.Boolean assignPublicIp) {
this.props.assignPublicIp(assignPublicIp);
return this;
}
/**
* The health check command and associated configuration parameters for the container.
*
* Default: - Health check configuration from container.
*
* @return {@code this}
* @param healthCheck The health check command and associated configuration parameters for the container. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder healthCheck(final software.amazon.awscdk.services.ecs.HealthCheck healthCheck) {
this.props.healthCheck(healthCheck);
return this;
}
/**
* The security groups to associate with the service.
*
* If you do not specify a security group, a new security group is created.
*
* Default: - A new security group is created.
*
* @return {@code this}
* @param securityGroups The security groups to associate with the service. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder securityGroups(final java.util.List extends software.amazon.awscdk.services.ec2.ISecurityGroup> securityGroups) {
this.props.securityGroups(securityGroups);
return this;
}
/**
* The subnets to associate with the service.
*
* Default: - Public subnets if `assignPublicIp` is set, otherwise the first available one of Private, Isolated, Public, in that order.
*
* @return {@code this}
* @param taskSubnets The subnets to associate with the service. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder taskSubnets(final software.amazon.awscdk.services.ec2.SubnetSelection taskSubnets) {
this.props.taskSubnets(taskSubnets);
return this;
}
/**
* (experimental) The bucket to use for access logs from the Application Load Balancer.
*
* Default: - a new S3 bucket will be created
*
* @return {@code this}
* @param accessLogBucket The bucket to use for access logs from the Application Load Balancer. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder accessLogBucket(final software.amazon.awscdk.services.s3.IBucket accessLogBucket) {
this.props.accessLogBucket(accessLogBucket);
return this;
}
/**
* (experimental) The prefix to use for access logs from the Application Load Balancer.
*
* Default: - none
*
* @return {@code this}
* @param accessLogPrefix The prefix to use for access logs from the Application Load Balancer. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder accessLogPrefix(final java.lang.String accessLogPrefix) {
this.props.accessLogPrefix(accessLogPrefix);
return this;
}
/**
* (experimental) The frequency for running the api canaries.
*
* Default: - 5 minutes
*
* @return {@code this}
* @param apiCanarySchedule The frequency for running the api canaries. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder apiCanarySchedule(final software.amazon.awscdk.Duration apiCanarySchedule) {
this.props.apiCanarySchedule(apiCanarySchedule);
return this;
}
/**
* (experimental) The number of threads to run concurrently for the synthetic test.
*
* Default: - 20
*
* @return {@code this}
* @param apiCanaryThreadCount The number of threads to run concurrently for the synthetic test. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder apiCanaryThreadCount(final java.lang.Number apiCanaryThreadCount) {
this.props.apiCanaryThreadCount(apiCanaryThreadCount);
return this;
}
/**
* (experimental) The threshold for how long a api canary can take to run.
*
* Default: - no alarm is created for test duration
*
* @return {@code this}
* @param apiCanaryTimeout The threshold for how long a api canary can take to run. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder apiCanaryTimeout(final software.amazon.awscdk.Duration apiCanaryTimeout) {
this.props.apiCanaryTimeout(apiCanaryTimeout);
return this;
}
/**
* (experimental) The steps to run in the canary.
*
* Default: - no synthetic test will be created
*
* @return {@code this}
* @param apiTestSteps The steps to run in the canary. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder apiTestSteps(final java.util.List extends io.github.cdklabs.cdk.ecs.codedeploy.ApiTestStep> apiTestSteps) {
this.props.apiTestSteps(apiTestSteps);
return this;
}
/**
* (experimental) The physical, human-readable name of the CodeDeploy Application.
*
* Default: an auto-generated name will be used
*
* @return {@code this}
* @param applicationName The physical, human-readable name of the CodeDeploy Application. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder applicationName(final java.lang.String applicationName) {
this.props.applicationName(applicationName);
return this;
}
/**
* (experimental) The deployment configuration to use for the deployment group.
*
* Default: - EcsDeploymentConfig.ALL_AT_ONCE
*
* @return {@code this}
* @param deploymentConfig The deployment configuration to use for the deployment group. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder deploymentConfig(final software.amazon.awscdk.services.codedeploy.IEcsDeploymentConfig deploymentConfig) {
this.props.deploymentConfig(deploymentConfig);
return this;
}
/**
* (experimental) The physical, human-readable name of the CodeDeploy Deployment Group.
*
* Default: An auto-generated name will be used.
*
* @return {@code this}
* @param deploymentGroupName The physical, human-readable name of the CodeDeploy Deployment Group. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder deploymentGroupName(final java.lang.String deploymentGroupName) {
this.props.deploymentGroupName(deploymentGroupName);
return this;
}
/**
* (experimental) The timeout for a CodeDeploy deployment.
*
* Default: - 60 minutes
*
* @return {@code this}
* @param deploymentTimeout The timeout for a CodeDeploy deployment. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder deploymentTimeout(final software.amazon.awscdk.Duration deploymentTimeout) {
this.props.deploymentTimeout(deploymentTimeout);
return this;
}
/**
* (experimental) The amount of time for ELB to wait before changing the state of a deregistering target from 'draining' to 'unused'.
*
* Default: - 300 seconds
*
* @return {@code this}
* @param deregistrationDelay The amount of time for ELB to wait before changing the state of a deregistering target from 'draining' to 'unused'. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder deregistrationDelay(final software.amazon.awscdk.Duration deregistrationDelay) {
this.props.deregistrationDelay(deregistrationDelay);
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 threshold for response time alarm.
*
* Default: - no alarm will be created
*
* @return {@code this}
* @param responseTimeAlarmThreshold The threshold for response time alarm. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder responseTimeAlarmThreshold(final software.amazon.awscdk.Duration responseTimeAlarmThreshold) {
this.props.responseTimeAlarmThreshold(responseTimeAlarmThreshold);
return this;
}
/**
* (experimental) The healthcheck to configure on the Application Load Balancer target groups.
*
* Default: - no health check is configured
*
* @return {@code this}
* @param targetHealthCheck The healthcheck to configure on the Application Load Balancer target groups. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder targetHealthCheck(final software.amazon.awscdk.services.elasticloadbalancingv2.HealthCheck targetHealthCheck) {
this.props.targetHealthCheck(targetHealthCheck);
return this;
}
/**
* (experimental) The time to wait before terminating the original (blue) task set.
*
* Default: - 10 minutes
*
* @return {@code this}
* @param terminationWaitTime The time to wait before terminating the original (blue) task set. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder terminationWaitTime(final software.amazon.awscdk.Duration terminationWaitTime) {
this.props.terminationWaitTime(terminationWaitTime);
return this;
}
/**
* (experimental) The port to use for test traffic on the listener.
*
* Default: - listenerPort + 1
*
* @return {@code this}
* @param testPort The port to use for test traffic on the listener. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder testPort(final java.lang.Number testPort) {
this.props.testPort(testPort);
return this;
}
/**
* @return a newly built instance of {@link io.github.cdklabs.cdk.ecs.codedeploy.ApplicationLoadBalancedCodeDeployedFargateService}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public io.github.cdklabs.cdk.ecs.codedeploy.ApplicationLoadBalancedCodeDeployedFargateService build() {
return new io.github.cdklabs.cdk.ecs.codedeploy.ApplicationLoadBalancedCodeDeployedFargateService(
this.scope,
this.id,
this.props.build()
);
}
}
}