io.github.cdklabs.cdk.ecr.deployment.ECRDeploymentProps Maven / Gradle / Ivy
package io.github.cdklabs.cdk.ecr.deployment;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-11T18:18:14.073Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdk.ecr.deployment.$Module.class, fqn = "cdk-ecr-deployment.ECRDeploymentProps")
@software.amazon.jsii.Jsii.Proxy(ECRDeploymentProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface ECRDeploymentProps extends software.amazon.jsii.JsiiSerializable {
/**
* The destination of the docker image.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.ecr.deployment.IImageName getDest();
/**
* The source of the docker image.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.ecr.deployment.IImageName getSrc();
/**
* Image to use to build Golang lambda for custom resource, if download fails or is not wanted.
*
* Might be needed for local build if all images need to come from own registry.
*
* Note that image should use yum as a package manager and have golang available.
*
* Default: - public.ecr.aws/sam/build-go1.x:latest
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getBuildImage() {
return null;
}
/**
* The environment variable to set.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.Map getEnvironment() {
return null;
}
/**
* The name of the lambda handler.
*
* Default: - bootstrap
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getLambdaHandler() {
return null;
}
/**
* The lambda function runtime environment.
*
* Default: - lambda.Runtime.PROVIDED_AL2023
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.lambda.Runtime getLambdaRuntime() {
return null;
}
/**
* The amount of memory (in MiB) to allocate to the AWS Lambda function which replicates the files from the CDK bucket to the destination bucket.
*
* If you are deploying large files, you will need to increase this number
* accordingly.
*
* Default: - 512
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getMemoryLimit() {
return null;
}
/**
* Execution role associated with this function.
*
* Default: - A role is automatically created
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.iam.IRole getRole() {
return null;
}
/**
* The list of security groups to associate with the Lambda's network interfaces.
*
* Only used if 'vpc' is supplied.
*
* Default: - If the function is placed within a VPC and a security group is
* not specified, either by this or securityGroup prop, a dedicated security
* group will be created for this function.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getSecurityGroups() {
return null;
}
/**
* The VPC network to place the deployment lambda handler in.
*
* Default: - None
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.IVpc getVpc() {
return null;
}
/**
* Where in the VPC to place the deployment lambda handler.
*
* Only used if 'vpc' is supplied.
*
* Default: - the Vpc default strategy if not specified
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.SubnetSelection getVpcSubnets() {
return null;
}
/**
* @return a {@link Builder} of {@link ECRDeploymentProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link ECRDeploymentProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
io.github.cdklabs.cdk.ecr.deployment.IImageName dest;
io.github.cdklabs.cdk.ecr.deployment.IImageName src;
java.lang.String buildImage;
java.util.Map environment;
java.lang.String lambdaHandler;
software.amazon.awscdk.services.lambda.Runtime lambdaRuntime;
java.lang.Number memoryLimit;
software.amazon.awscdk.services.iam.IRole role;
java.util.List securityGroups;
software.amazon.awscdk.services.ec2.IVpc vpc;
software.amazon.awscdk.services.ec2.SubnetSelection vpcSubnets;
/**
* Sets the value of {@link ECRDeploymentProps#getDest}
* @param dest The destination of the docker image. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder dest(io.github.cdklabs.cdk.ecr.deployment.IImageName dest) {
this.dest = dest;
return this;
}
/**
* Sets the value of {@link ECRDeploymentProps#getSrc}
* @param src The source of the docker image. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder src(io.github.cdklabs.cdk.ecr.deployment.IImageName src) {
this.src = src;
return this;
}
/**
* Sets the value of {@link ECRDeploymentProps#getBuildImage}
* @param buildImage Image to use to build Golang lambda for custom resource, if download fails or is not wanted.
* Might be needed for local build if all images need to come from own registry.
*
* Note that image should use yum as a package manager and have golang available.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder buildImage(java.lang.String buildImage) {
this.buildImage = buildImage;
return this;
}
/**
* Sets the value of {@link ECRDeploymentProps#getEnvironment}
* @param environment The environment variable to set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder environment(java.util.Map environment) {
this.environment = environment;
return this;
}
/**
* Sets the value of {@link ECRDeploymentProps#getLambdaHandler}
* @param lambdaHandler The name of the lambda handler.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder lambdaHandler(java.lang.String lambdaHandler) {
this.lambdaHandler = lambdaHandler;
return this;
}
/**
* Sets the value of {@link ECRDeploymentProps#getLambdaRuntime}
* @param lambdaRuntime The lambda function runtime environment.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder lambdaRuntime(software.amazon.awscdk.services.lambda.Runtime lambdaRuntime) {
this.lambdaRuntime = lambdaRuntime;
return this;
}
/**
* Sets the value of {@link ECRDeploymentProps#getMemoryLimit}
* @param memoryLimit The amount of memory (in MiB) to allocate to the AWS Lambda function which replicates the files from the CDK bucket to the destination bucket.
* If you are deploying large files, you will need to increase this number
* accordingly.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder memoryLimit(java.lang.Number memoryLimit) {
this.memoryLimit = memoryLimit;
return this;
}
/**
* Sets the value of {@link ECRDeploymentProps#getRole}
* @param role Execution role associated with this function.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder role(software.amazon.awscdk.services.iam.IRole role) {
this.role = role;
return this;
}
/**
* Sets the value of {@link ECRDeploymentProps#getSecurityGroups}
* @param securityGroups The list of security groups to associate with the Lambda's network interfaces.
* Only used if 'vpc' is supplied.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder securityGroups(java.util.List extends software.amazon.awscdk.services.ec2.SecurityGroup> securityGroups) {
this.securityGroups = (java.util.List)securityGroups;
return this;
}
/**
* Sets the value of {@link ECRDeploymentProps#getVpc}
* @param vpc The VPC network to place the deployment lambda handler in.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder vpc(software.amazon.awscdk.services.ec2.IVpc vpc) {
this.vpc = vpc;
return this;
}
/**
* Sets the value of {@link ECRDeploymentProps#getVpcSubnets}
* @param vpcSubnets Where in the VPC to place the deployment lambda handler.
* Only used if 'vpc' is supplied.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder vpcSubnets(software.amazon.awscdk.services.ec2.SubnetSelection vpcSubnets) {
this.vpcSubnets = vpcSubnets;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link ECRDeploymentProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public ECRDeploymentProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link ECRDeploymentProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements ECRDeploymentProps {
private final io.github.cdklabs.cdk.ecr.deployment.IImageName dest;
private final io.github.cdklabs.cdk.ecr.deployment.IImageName src;
private final java.lang.String buildImage;
private final java.util.Map environment;
private final java.lang.String lambdaHandler;
private final software.amazon.awscdk.services.lambda.Runtime lambdaRuntime;
private final java.lang.Number memoryLimit;
private final software.amazon.awscdk.services.iam.IRole role;
private final java.util.List securityGroups;
private final software.amazon.awscdk.services.ec2.IVpc vpc;
private final software.amazon.awscdk.services.ec2.SubnetSelection vpcSubnets;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.dest = software.amazon.jsii.Kernel.get(this, "dest", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.ecr.deployment.IImageName.class));
this.src = software.amazon.jsii.Kernel.get(this, "src", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.ecr.deployment.IImageName.class));
this.buildImage = software.amazon.jsii.Kernel.get(this, "buildImage", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.environment = software.amazon.jsii.Kernel.get(this, "environment", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.lambdaHandler = software.amazon.jsii.Kernel.get(this, "lambdaHandler", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.lambdaRuntime = software.amazon.jsii.Kernel.get(this, "lambdaRuntime", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.Runtime.class));
this.memoryLimit = software.amazon.jsii.Kernel.get(this, "memoryLimit", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.role = software.amazon.jsii.Kernel.get(this, "role", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.iam.IRole.class));
this.securityGroups = software.amazon.jsii.Kernel.get(this, "securityGroups", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.SecurityGroup.class)));
this.vpc = software.amazon.jsii.Kernel.get(this, "vpc", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.IVpc.class));
this.vpcSubnets = software.amazon.jsii.Kernel.get(this, "vpcSubnets", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.SubnetSelection.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.dest = java.util.Objects.requireNonNull(builder.dest, "dest is required");
this.src = java.util.Objects.requireNonNull(builder.src, "src is required");
this.buildImage = builder.buildImage;
this.environment = builder.environment;
this.lambdaHandler = builder.lambdaHandler;
this.lambdaRuntime = builder.lambdaRuntime;
this.memoryLimit = builder.memoryLimit;
this.role = builder.role;
this.securityGroups = (java.util.List)builder.securityGroups;
this.vpc = builder.vpc;
this.vpcSubnets = builder.vpcSubnets;
}
@Override
public final io.github.cdklabs.cdk.ecr.deployment.IImageName getDest() {
return this.dest;
}
@Override
public final io.github.cdklabs.cdk.ecr.deployment.IImageName getSrc() {
return this.src;
}
@Override
public final java.lang.String getBuildImage() {
return this.buildImage;
}
@Override
public final java.util.Map getEnvironment() {
return this.environment;
}
@Override
public final java.lang.String getLambdaHandler() {
return this.lambdaHandler;
}
@Override
public final software.amazon.awscdk.services.lambda.Runtime getLambdaRuntime() {
return this.lambdaRuntime;
}
@Override
public final java.lang.Number getMemoryLimit() {
return this.memoryLimit;
}
@Override
public final software.amazon.awscdk.services.iam.IRole getRole() {
return this.role;
}
@Override
public final java.util.List getSecurityGroups() {
return this.securityGroups;
}
@Override
public final software.amazon.awscdk.services.ec2.IVpc getVpc() {
return this.vpc;
}
@Override
public final software.amazon.awscdk.services.ec2.SubnetSelection getVpcSubnets() {
return this.vpcSubnets;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
data.set("dest", om.valueToTree(this.getDest()));
data.set("src", om.valueToTree(this.getSrc()));
if (this.getBuildImage() != null) {
data.set("buildImage", om.valueToTree(this.getBuildImage()));
}
if (this.getEnvironment() != null) {
data.set("environment", om.valueToTree(this.getEnvironment()));
}
if (this.getLambdaHandler() != null) {
data.set("lambdaHandler", om.valueToTree(this.getLambdaHandler()));
}
if (this.getLambdaRuntime() != null) {
data.set("lambdaRuntime", om.valueToTree(this.getLambdaRuntime()));
}
if (this.getMemoryLimit() != null) {
data.set("memoryLimit", om.valueToTree(this.getMemoryLimit()));
}
if (this.getRole() != null) {
data.set("role", om.valueToTree(this.getRole()));
}
if (this.getSecurityGroups() != null) {
data.set("securityGroups", om.valueToTree(this.getSecurityGroups()));
}
if (this.getVpc() != null) {
data.set("vpc", om.valueToTree(this.getVpc()));
}
if (this.getVpcSubnets() != null) {
data.set("vpcSubnets", om.valueToTree(this.getVpcSubnets()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("cdk-ecr-deployment.ECRDeploymentProps"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ECRDeploymentProps.Jsii$Proxy that = (ECRDeploymentProps.Jsii$Proxy) o;
if (!dest.equals(that.dest)) return false;
if (!src.equals(that.src)) return false;
if (this.buildImage != null ? !this.buildImage.equals(that.buildImage) : that.buildImage != null) return false;
if (this.environment != null ? !this.environment.equals(that.environment) : that.environment != null) return false;
if (this.lambdaHandler != null ? !this.lambdaHandler.equals(that.lambdaHandler) : that.lambdaHandler != null) return false;
if (this.lambdaRuntime != null ? !this.lambdaRuntime.equals(that.lambdaRuntime) : that.lambdaRuntime != null) return false;
if (this.memoryLimit != null ? !this.memoryLimit.equals(that.memoryLimit) : that.memoryLimit != null) return false;
if (this.role != null ? !this.role.equals(that.role) : that.role != null) return false;
if (this.securityGroups != null ? !this.securityGroups.equals(that.securityGroups) : that.securityGroups != null) return false;
if (this.vpc != null ? !this.vpc.equals(that.vpc) : that.vpc != null) return false;
return this.vpcSubnets != null ? this.vpcSubnets.equals(that.vpcSubnets) : that.vpcSubnets == null;
}
@Override
public final int hashCode() {
int result = this.dest.hashCode();
result = 31 * result + (this.src.hashCode());
result = 31 * result + (this.buildImage != null ? this.buildImage.hashCode() : 0);
result = 31 * result + (this.environment != null ? this.environment.hashCode() : 0);
result = 31 * result + (this.lambdaHandler != null ? this.lambdaHandler.hashCode() : 0);
result = 31 * result + (this.lambdaRuntime != null ? this.lambdaRuntime.hashCode() : 0);
result = 31 * result + (this.memoryLimit != null ? this.memoryLimit.hashCode() : 0);
result = 31 * result + (this.role != null ? this.role.hashCode() : 0);
result = 31 * result + (this.securityGroups != null ? this.securityGroups.hashCode() : 0);
result = 31 * result + (this.vpc != null ? this.vpc.hashCode() : 0);
result = 31 * result + (this.vpcSubnets != null ? this.vpcSubnets.hashCode() : 0);
return result;
}
}
}