software.amazon.awscdk.services.ec2.alpha.EgressOnlyInternetGateway Maven / Gradle / Ivy
Show all versions of ec2-alpha Show documentation
package software.amazon.awscdk.services.ec2.alpha;
/**
* (experimental) Creates an egress-only internet gateway.
*
* Example:
*
*
* Stack stack = new Stack();
* VpcV2 myVpc = VpcV2.Builder.create(this, "Vpc")
* .primaryAddressBlock(IpAddresses.ipv4("10.1.0.0/16"))
* .secondaryAddressBlocks(List.of(IpAddresses.amazonProvidedIpv6(SecondaryAddressProps.builder()
* .cidrBlockName("AmazonProvided")
* .build())))
* .build();
* EgressOnlyInternetGateway eigw = EgressOnlyInternetGateway.Builder.create(this, "EIGW")
* .vpc(myVpc)
* .build();
* RouteTable routeTable = RouteTable.Builder.create(this, "RouteTable")
* .vpc(myVpc)
* .build();
* routeTable.addRoute("EIGW", "::/0", Map.of("gateway", eigw));
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.104.0 (build e79254c)", date = "2024-11-15T10:25:09.176Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.ec2.alpha.$Module.class, fqn = "@aws-cdk/aws-ec2-alpha.EgressOnlyInternetGateway")
public class EgressOnlyInternetGateway extends software.amazon.awscdk.Resource implements software.amazon.awscdk.services.ec2.alpha.IRouteTarget {
protected EgressOnlyInternetGateway(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected EgressOnlyInternetGateway(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @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 EgressOnlyInternetGateway(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ec2.alpha.EgressOnlyInternetGatewayProps 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) The egress-only internet gateway CFN resource.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ec2.CfnEgressOnlyInternetGateway getResource() {
return software.amazon.jsii.Kernel.get(this, "resource", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.CfnEgressOnlyInternetGateway.class));
}
/**
* (experimental) The ID of the route target.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getRouterTargetId() {
return software.amazon.jsii.Kernel.get(this, "routerTargetId", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) The type of router used in the route.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ec2.RouterType getRouterType() {
return software.amazon.jsii.Kernel.get(this, "routerType", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.RouterType.class));
}
/**
* (experimental) A fluent builder for {@link software.amazon.awscdk.services.ec2.alpha.EgressOnlyInternetGateway}.
*/
@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 software.amazon.awscdk.services.ec2.alpha.EgressOnlyInternetGatewayProps.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
this.props = new software.amazon.awscdk.services.ec2.alpha.EgressOnlyInternetGatewayProps.Builder();
}
/**
* (experimental) The ID of the VPC for which to create the egress-only internet gateway.
*
* @return {@code this}
* @param vpc The ID of the VPC for which to create the egress-only internet gateway. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder vpc(final software.amazon.awscdk.services.ec2.alpha.IVpcV2 vpc) {
this.props.vpc(vpc);
return this;
}
/**
* (experimental) The resource name of the egress-only internet gateway.
*
* Default: - provisioned without a resource name
*
* @return {@code this}
* @param egressOnlyInternetGatewayName The resource name of the egress-only internet gateway. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder egressOnlyInternetGatewayName(final java.lang.String egressOnlyInternetGatewayName) {
this.props.egressOnlyInternetGatewayName(egressOnlyInternetGatewayName);
return this;
}
/**
* @return a newly built instance of {@link software.amazon.awscdk.services.ec2.alpha.EgressOnlyInternetGateway}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public software.amazon.awscdk.services.ec2.alpha.EgressOnlyInternetGateway build() {
return new software.amazon.awscdk.services.ec2.alpha.EgressOnlyInternetGateway(
this.scope,
this.id,
this.props.build()
);
}
}
}