Package com.cloudforge.core.enums
Enum Class NetworkMode
- All Implemented Interfaces:
Serializable,Comparable<NetworkMode>,Constable
Network topology mode for VPC configuration.
Configuration
Set via deployment context (case-insensitive):
cfc.put("networkMode", "private-with-nat"); // Private subnets with NAT Gateway
cfc.put("networkMode", "public"); // Public subnets only
cfc.put("networkMode", "isolated"); // No internet access
Modes
- PRIVATE_WITH_NAT - Services in private subnets, outbound via NAT Gateway (recommended for production)
- PUBLIC - Services in public subnets with public IPs (cost-effective for dev/testing)
- ISOLATED - No internet access, requires VPC endpoints for AWS services
Compliance Impact
- PCI-DSS: Requires PRIVATE_WITH_NAT for cardholder data environments
- HIPAA: PRIVATE_WITH_NAT recommended for PHI protection
- SOC2: PRIVATE_WITH_NAT provides better boundary protection (CC6.1)
Cost Considerations
- PRIVATE_WITH_NAT: ~$45/month per NAT Gateway + data processing charges
- PUBLIC: No NAT costs, minimal additional charges
- ISOLATED: No NAT costs, but VPC endpoint costs if needed
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIsolated subnets with no internet access.Private subnets with NAT Gateway for outbound internet access.Public subnets with direct internet access. -
Method Summary
Modifier and TypeMethodDescriptionstatic NetworkModedefaultForProfile(SecurityProfile profile) Get default network mode for a security profile.static NetworkModefromString(String value) Parse network mode from string (case-insensitive).getValue()Returns the JSON/string value for this network mode.booleanCheck if this mode has outbound internet access.booleanCheck if this mode uses private subnets (no public IPs on instances).booleanCheck if this mode requires NAT Gateway.toString()Returns the string representation (same as getValue for consistency).static NetworkModeReturns the enum constant of this class with the specified name.static NetworkMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PRIVATE_WITH_NAT
Private subnets with NAT Gateway for outbound internet access. Recommended for production workloads requiring compliance. Serializes as "private-with-nat". -
PUBLIC
Public subnets with direct internet access. Cost-effective for development and testing. Legacy alias "public-no-nat" also supported. Serializes as "public". -
ISOLATED
Isolated subnets with no internet access. Requires VPC endpoints for AWS service access. Serializes as "isolated".
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getValue
Returns the JSON/string value for this network mode. -
toString
Returns the string representation (same as getValue for consistency).- Overrides:
toStringin classEnum<NetworkMode>
-
fromString
Parse network mode from string (case-insensitive). Supports both enum names and JSON values.- Parameters:
value- String value from deployment context- Returns:
- NetworkMode enum value
- Throws:
IllegalArgumentException- if value is not recognized
-
defaultForProfile
Get default network mode for a security profile. PRODUCTION defaults to PRIVATE_WITH_NAT, others default to PUBLIC.- Parameters:
profile- Security profile- Returns:
- Default network mode for the profile
-
isPrivate
public boolean isPrivate()Check if this mode uses private subnets (no public IPs on instances). -
hasInternetAccess
public boolean hasInternetAccess()Check if this mode has outbound internet access. -
requiresNat
public boolean requiresNat()Check if this mode requires NAT Gateway.
-