software.amazon.awscdk.services.apprunner.alpha.VpcIngressConnectionProps Maven / Gradle / Ivy
Show all versions of apprunner-alpha Show documentation
package software.amazon.awscdk.services.apprunner.alpha;
/**
* (experimental) Properties of the AppRunner VPC Ingress Connection.
*
* Example:
*
*
* import software.amazon.awscdk.services.ec2.*;
* Vpc vpc;
* InterfaceVpcEndpoint interfaceVpcEndpoint = InterfaceVpcEndpoint.Builder.create(this, "MyVpcEndpoint")
* .vpc(vpc)
* .service(InterfaceVpcEndpointAwsService.APP_RUNNER_REQUESTS)
* .privateDnsEnabled(false)
* .build();
* Service service = Service.Builder.create(this, "Service")
* .source(Source.fromEcrPublic(EcrPublicProps.builder()
* .imageConfiguration(ImageConfiguration.builder()
* .port(8000)
* .build())
* .imageIdentifier("public.ecr.aws/aws-containers/hello-app-runner:latest")
* .build()))
* .isPubliclyAccessible(false)
* .build();
* VpcIngressConnection.Builder.create(this, "VpcIngressConnection")
* .vpc(vpc)
* .interfaceVpcEndpoint(interfaceVpcEndpoint)
* .service(service)
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.104.0 (build e79254c)", date = "2024-12-17T21:37:41.249Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.apprunner.alpha.$Module.class, fqn = "@aws-cdk/aws-apprunner-alpha.VpcIngressConnectionProps")
@software.amazon.jsii.Jsii.Proxy(VpcIngressConnectionProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface VpcIngressConnectionProps extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The VPC Interface Endpoint for the VPC Ingress Connection.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ec2.IInterfaceVpcEndpoint getInterfaceVpcEndpoint();
/**
* (experimental) The service to connect.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.apprunner.alpha.IService getService();
/**
* (experimental) The VPC for the VPC Ingress Connection.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ec2.IVpc getVpc();
/**
* (experimental) The name for the VPC Ingress Connection.
*
* Default: - a name generated by CloudFormation
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getVpcIngressConnectionName() {
return null;
}
/**
* @return a {@link Builder} of {@link VpcIngressConnectionProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link VpcIngressConnectionProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.ec2.IInterfaceVpcEndpoint interfaceVpcEndpoint;
software.amazon.awscdk.services.apprunner.alpha.IService service;
software.amazon.awscdk.services.ec2.IVpc vpc;
java.lang.String vpcIngressConnectionName;
/**
* Sets the value of {@link VpcIngressConnectionProps#getInterfaceVpcEndpoint}
* @param interfaceVpcEndpoint The VPC Interface Endpoint for the VPC Ingress Connection. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder interfaceVpcEndpoint(software.amazon.awscdk.services.ec2.IInterfaceVpcEndpoint interfaceVpcEndpoint) {
this.interfaceVpcEndpoint = interfaceVpcEndpoint;
return this;
}
/**
* Sets the value of {@link VpcIngressConnectionProps#getService}
* @param service The service to connect. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder service(software.amazon.awscdk.services.apprunner.alpha.IService service) {
this.service = service;
return this;
}
/**
* Sets the value of {@link VpcIngressConnectionProps#getVpc}
* @param vpc The VPC for the VPC Ingress Connection. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder vpc(software.amazon.awscdk.services.ec2.IVpc vpc) {
this.vpc = vpc;
return this;
}
/**
* Sets the value of {@link VpcIngressConnectionProps#getVpcIngressConnectionName}
* @param vpcIngressConnectionName The name for the VPC Ingress Connection.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder vpcIngressConnectionName(java.lang.String vpcIngressConnectionName) {
this.vpcIngressConnectionName = vpcIngressConnectionName;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link VpcIngressConnectionProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public VpcIngressConnectionProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link VpcIngressConnectionProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements VpcIngressConnectionProps {
private final software.amazon.awscdk.services.ec2.IInterfaceVpcEndpoint interfaceVpcEndpoint;
private final software.amazon.awscdk.services.apprunner.alpha.IService service;
private final software.amazon.awscdk.services.ec2.IVpc vpc;
private final java.lang.String vpcIngressConnectionName;
/**
* 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.interfaceVpcEndpoint = software.amazon.jsii.Kernel.get(this, "interfaceVpcEndpoint", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.IInterfaceVpcEndpoint.class));
this.service = software.amazon.jsii.Kernel.get(this, "service", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.apprunner.alpha.IService.class));
this.vpc = software.amazon.jsii.Kernel.get(this, "vpc", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.IVpc.class));
this.vpcIngressConnectionName = software.amazon.jsii.Kernel.get(this, "vpcIngressConnectionName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.interfaceVpcEndpoint = java.util.Objects.requireNonNull(builder.interfaceVpcEndpoint, "interfaceVpcEndpoint is required");
this.service = java.util.Objects.requireNonNull(builder.service, "service is required");
this.vpc = java.util.Objects.requireNonNull(builder.vpc, "vpc is required");
this.vpcIngressConnectionName = builder.vpcIngressConnectionName;
}
@Override
public final software.amazon.awscdk.services.ec2.IInterfaceVpcEndpoint getInterfaceVpcEndpoint() {
return this.interfaceVpcEndpoint;
}
@Override
public final software.amazon.awscdk.services.apprunner.alpha.IService getService() {
return this.service;
}
@Override
public final software.amazon.awscdk.services.ec2.IVpc getVpc() {
return this.vpc;
}
@Override
public final java.lang.String getVpcIngressConnectionName() {
return this.vpcIngressConnectionName;
}
@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("interfaceVpcEndpoint", om.valueToTree(this.getInterfaceVpcEndpoint()));
data.set("service", om.valueToTree(this.getService()));
data.set("vpc", om.valueToTree(this.getVpc()));
if (this.getVpcIngressConnectionName() != null) {
data.set("vpcIngressConnectionName", om.valueToTree(this.getVpcIngressConnectionName()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-apprunner-alpha.VpcIngressConnectionProps"));
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;
VpcIngressConnectionProps.Jsii$Proxy that = (VpcIngressConnectionProps.Jsii$Proxy) o;
if (!interfaceVpcEndpoint.equals(that.interfaceVpcEndpoint)) return false;
if (!service.equals(that.service)) return false;
if (!vpc.equals(that.vpc)) return false;
return this.vpcIngressConnectionName != null ? this.vpcIngressConnectionName.equals(that.vpcIngressConnectionName) : that.vpcIngressConnectionName == null;
}
@Override
public final int hashCode() {
int result = this.interfaceVpcEndpoint.hashCode();
result = 31 * result + (this.service.hashCode());
result = 31 * result + (this.vpc.hashCode());
result = 31 * result + (this.vpcIngressConnectionName != null ? this.vpcIngressConnectionName.hashCode() : 0);
return result;
}
}
}