All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.burkard.cdk.services.ec2.Vpc.scala Maven / Gradle / Ivy

The newest version!
package io.burkard.cdk.services.ec2

import scala.collection.JavaConverters._

@scala.annotation.nowarn("cat=deprecation")
@SuppressWarnings(Array("org.wartremover.warts.DefaultArguments", "org.wartremover.warts.Null", "DisableSyntax.null"))
object Vpc {

  def apply(
    internalResourceId: String,
    enableDnsSupport: Option[Boolean] = None,
    vpcName: Option[String] = None,
    flowLogs: Option[Map[String, _ <: software.amazon.awscdk.services.ec2.FlowLogOptions]] = None,
    cidr: Option[String] = None,
    maxAzs: Option[Number] = None,
    natGateways: Option[Number] = None,
    defaultInstanceTenancy: Option[software.amazon.awscdk.services.ec2.DefaultInstanceTenancy] = None,
    enableDnsHostnames: Option[Boolean] = None,
    gatewayEndpoints: Option[Map[String, _ <: software.amazon.awscdk.services.ec2.GatewayVpcEndpointOptions]] = None,
    natGatewaySubnets: Option[software.amazon.awscdk.services.ec2.SubnetSelection] = None,
    subnetConfiguration: Option[List[_ <: software.amazon.awscdk.services.ec2.SubnetConfiguration]] = None,
    vpnConnections: Option[Map[String, _ <: software.amazon.awscdk.services.ec2.VpnConnectionOptions]] = None,
    vpnGateway: Option[Boolean] = None,
    vpnRoutePropagation: Option[List[_ <: software.amazon.awscdk.services.ec2.SubnetSelection]] = None,
    natGatewayProvider: Option[software.amazon.awscdk.services.ec2.NatProvider] = None,
    availabilityZones: Option[List[String]] = None,
    vpnGatewayAsn: Option[Number] = None
  )(implicit stackCtx: software.amazon.awscdk.Stack): software.amazon.awscdk.services.ec2.Vpc =
    software.amazon.awscdk.services.ec2.Vpc.Builder
      .create(stackCtx, internalResourceId)
      .enableDnsSupport(enableDnsSupport.map(Boolean.box).orNull)
      .vpcName(vpcName.orNull)
      .flowLogs(flowLogs.map(_.asJava).orNull)
      .cidr(cidr.orNull)
      .maxAzs(maxAzs.orNull)
      .natGateways(natGateways.orNull)
      .defaultInstanceTenancy(defaultInstanceTenancy.orNull)
      .enableDnsHostnames(enableDnsHostnames.map(Boolean.box).orNull)
      .gatewayEndpoints(gatewayEndpoints.map(_.asJava).orNull)
      .natGatewaySubnets(natGatewaySubnets.orNull)
      .subnetConfiguration(subnetConfiguration.map(_.asJava).orNull)
      .vpnConnections(vpnConnections.map(_.asJava).orNull)
      .vpnGateway(vpnGateway.map(Boolean.box).orNull)
      .vpnRoutePropagation(vpnRoutePropagation.map(_.asJava).orNull)
      .natGatewayProvider(natGatewayProvider.orNull)
      .availabilityZones(availabilityZones.map(_.asJava).orNull)
      .vpnGatewayAsn(vpnGatewayAsn.orNull)
      .build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy