io.github.cdklabs.cdkecsserviceextensions.ServiceExtension Maven / Gradle / Ivy
Show all versions of cdk-ecs-service-extensions Show documentation
package io.github.cdklabs.cdkecsserviceextensions;
/**
* (experimental) The shape of a service extension.
*
* This abstract class is implemented
* by other extensions that extend the hooks to implement any custom
* logic that they want to run during each step of preparing the service.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-26T00:28:54.222Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdkecsserviceextensions.$Module.class, fqn = "@aws-cdk-containers/ecs-service-extensions.ServiceExtension")
public abstract class ServiceExtension extends software.amazon.jsii.JsiiObject {
protected ServiceExtension(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected ServiceExtension(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param name This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
protected ServiceExtension(final @org.jetbrains.annotations.NotNull java.lang.String name) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(name, "name is required") });
}
/**
* (experimental) This hook allows another service extension to register a mutating hook for changing the primary container of this extension.
*
* This is primarily used
* for the application extension. For example, the Firelens extension wants to
* be able to modify the settings of the application container to
* route logs through Firelens.
*
* @param hook This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void addContainerMutatingHook(final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdkecsserviceextensions.ContainerMutatingHook hook) {
software.amazon.jsii.Kernel.call(this, "addContainerMutatingHook", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(hook, "hook is required") });
}
/**
* (experimental) A hook that allows the extension to add hooks to other extensions that are registered.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void addHooks() {
software.amazon.jsii.Kernel.call(this, "addHooks", software.amazon.jsii.NativeType.VOID);
}
/**
* (experimental) This hook allows the extension to establish a connection to extensions from another service.
*
* Usually used for things like
* allowing one service to talk to the load balancer or service mesh
* proxy for another service.
*
* @param service
- The other service to connect to.
This parameter is required.
* @param connectToProps
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void connectToService(final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdkecsserviceextensions.Service service, final @org.jetbrains.annotations.Nullable io.github.cdklabs.cdkecsserviceextensions.ConnectToProps connectToProps) {
software.amazon.jsii.Kernel.call(this, "connectToService", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(service, "service is required"), connectToProps });
}
/**
* (experimental) This hook allows the extension to establish a connection to extensions from another service.
*
* Usually used for things like
* allowing one service to talk to the load balancer or service mesh
* proxy for another service.
*
* @param service
- The other service to connect to.
This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void connectToService(final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdkecsserviceextensions.Service service) {
software.amazon.jsii.Kernel.call(this, "connectToService", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(service, "service is required") });
}
/**
* (experimental) Prior to launching the task definition as a service, this hook is called on each extension to give it a chance to mutate the properties of the service to be created.
*
* @param props
- The service properties to mutate.
This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull io.github.cdklabs.cdkecsserviceextensions.ServiceBuild modifyServiceProps(final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdkecsserviceextensions.ServiceBuild props) {
return software.amazon.jsii.Kernel.call(this, "modifyServiceProps", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkecsserviceextensions.ServiceBuild.class), new Object[] { java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* (experimental) This is a hook which allows extensions to modify the settings of the task definition prior to it being created.
*
* For example, the App Mesh
* extension needs to configure an Envoy proxy in the task definition,
* or the Application extension wants to set the overall resource for
* the task.
*
* @param props
- Properties of the task definition to be created.
This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ecs.TaskDefinitionProps modifyTaskDefinitionProps(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ecs.TaskDefinitionProps props) {
return software.amazon.jsii.Kernel.call(this, "modifyTaskDefinitionProps", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ecs.TaskDefinitionProps.class), new Object[] { java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* (experimental) A hook that is called for each extension ahead of time to allow for any initial setup, such as creating resources in advance.
*
* @param parent
- The parent service which this extension has been added to.
This parameter is required.
* @param scope - The scope that this extension should create resources in.
This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void prehook(final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdkecsserviceextensions.Service parent, final @org.jetbrains.annotations.NotNull software.constructs.Construct scope) {
software.amazon.jsii.Kernel.call(this, "prehook", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(parent, "parent is required"), java.util.Objects.requireNonNull(scope, "scope is required") });
}
/**
* (experimental) Once all containers are added to the task definition, this hook is called for each extension to give it a chance to resolve its dependency graph so that its container starts in the right order based on the other extensions that were enabled.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void resolveContainerDependencies() {
software.amazon.jsii.Kernel.call(this, "resolveContainerDependencies", software.amazon.jsii.NativeType.VOID);
}
/**
* (experimental) When this hook is implemented by extension, it allows the extension to use the service which has been created.
*
* It is generally used to
* create any final resources which might depend on the service itself.
*
* @param service
- The generated service.
This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void useService(final @org.jetbrains.annotations.NotNull java.lang.Object service) {
if (software.amazon.jsii.Configuration.getRuntimeTypeChecking()) {
if (
!(service instanceof software.amazon.awscdk.services.ecs.Ec2Service)
&& !(service instanceof software.amazon.awscdk.services.ecs.FargateService)
) {
throw new IllegalArgumentException(
new java.lang.StringBuilder("Expected ")
.append("service")
.append(" to be one of: software.amazon.awscdk.services.ecs.Ec2Service, software.amazon.awscdk.services.ecs.FargateService; received ")
.append(service.getClass()).toString());
}
}
software.amazon.jsii.Kernel.call(this, "useService", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(service, "service is required") });
}
/**
* (experimental) Once the task definition is created, this hook is called for each extension to give it a chance to add containers to the task definition, change the task definition's role to add permissions, etc.
*
* @param taskDefinition
- The created task definition to add containers to.
This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void useTaskDefinition(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ecs.TaskDefinition taskDefinition) {
software.amazon.jsii.Kernel.call(this, "useTaskDefinition", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(taskDefinition, "taskDefinition is required") });
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
protected @org.jetbrains.annotations.NotNull java.util.List getContainerMutatingHooks() {
return java.util.Collections.unmodifiableList(software.amazon.jsii.Kernel.get(this, "containerMutatingHooks", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkecsserviceextensions.ContainerMutatingHook.class))));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
protected void setContainerMutatingHooks(final @org.jetbrains.annotations.NotNull java.util.List value) {
software.amazon.jsii.Kernel.set(this, "containerMutatingHooks", java.util.Objects.requireNonNull(value, "containerMutatingHooks is required"));
}
/**
* (experimental) The name of the extension.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getName() {
return software.amazon.jsii.Kernel.get(this, "name", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) The name of the extension.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void setName(final @org.jetbrains.annotations.NotNull java.lang.String value) {
software.amazon.jsii.Kernel.set(this, "name", java.util.Objects.requireNonNull(value, "name is required"));
}
/**
* (experimental) The service which this extension is being added to.
*
* Initially, extensions are collected into a ServiceDescription, but no service
* exists yet. Later, when the ServiceDescription is used to create a service,
* the extension is told what Service it is now working on.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
protected @org.jetbrains.annotations.NotNull io.github.cdklabs.cdkecsserviceextensions.Service getParentService() {
return software.amazon.jsii.Kernel.get(this, "parentService", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkecsserviceextensions.Service.class));
}
/**
* (experimental) The service which this extension is being added to.
*
* Initially, extensions are collected into a ServiceDescription, but no service
* exists yet. Later, when the ServiceDescription is used to create a service,
* the extension is told what Service it is now working on.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
protected void setParentService(final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdkecsserviceextensions.Service value) {
software.amazon.jsii.Kernel.set(this, "parentService", java.util.Objects.requireNonNull(value, "parentService is required"));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
protected @org.jetbrains.annotations.NotNull software.constructs.Construct getScope() {
return software.amazon.jsii.Kernel.get(this, "scope", software.amazon.jsii.NativeType.forClass(software.constructs.Construct.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
protected void setScope(final @org.jetbrains.annotations.NotNull software.constructs.Construct value) {
software.amazon.jsii.Kernel.set(this, "scope", java.util.Objects.requireNonNull(value, "scope is required"));
}
/**
* (experimental) The container for this extension.
*
* Most extensions have a container, but not
* every extension is required to have a container. Some extensions may just
* modify the properties of the service, or create external resources
* connected to the service.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ecs.ContainerDefinition getContainer() {
return software.amazon.jsii.Kernel.get(this, "container", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ecs.ContainerDefinition.class));
}
/**
* (experimental) The container for this extension.
*
* Most extensions have a container, but not
* every extension is required to have a container. Some extensions may just
* modify the properties of the service, or create external resources
* connected to the service.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void setContainer(final @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ecs.ContainerDefinition value) {
software.amazon.jsii.Kernel.set(this, "container", value);
}
/**
* A proxy class which represents a concrete javascript instance of this type.
*/
@software.amazon.jsii.Internal
private static final class Jsii$Proxy extends io.github.cdklabs.cdkecsserviceextensions.ServiceExtension {
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
}
}