Class Connections
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ec2.Connections
- All Implemented Interfaces:
IConnectable
,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)",
date="2024-10-11T15:55:56.884Z")
@Stability(Stable)
public class Connections
extends software.amazon.jsii.JsiiObject
implements IConnectable
Manage the allowed network connections for constructs with Security Groups.
Security Groups can be thought of as a firewall for network-connected devices. This class makes it easy to allow network connections to and from security groups, and between security groups individually. When establishing connectivity between security groups, it will automatically add rules in both security groups
This object can manage one or more security groups.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.ec2.*; IPeer peer; Port port; SecurityGroup securityGroup; Connections connections = Connections.Builder.create() .defaultPort(port) .peer(peer) .securityGroups(List.of(securityGroup)) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.IConnectable
IConnectable.Jsii$Default, IConnectable.Jsii$Proxy
-
Constructor Summary
ModifierConstructorDescriptionConnections
(ConnectionsProps props) protected
Connections
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
Connections
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSecurityGroup
(@NotNull ISecurityGroup... securityGroups) Add a security group to the list of security groups managed by this object.void
allowDefaultPortFrom
(IConnectable other) Allow connections from the peer on our default port.void
allowDefaultPortFrom
(IConnectable other, String description) Allow connections from the peer on our default port.void
Allow default connections from all IPv4 ranges.void
allowDefaultPortFromAnyIpv4
(String description) Allow default connections from all IPv4 ranges.void
Allow hosts inside the security group to connect to each other.void
allowDefaultPortInternally
(String description) Allow hosts inside the security group to connect to each other.void
allowDefaultPortTo
(IConnectable other) Allow connections from the peer on our default port.void
allowDefaultPortTo
(IConnectable other, String description) Allow connections from the peer on our default port.void
allowFrom
(IConnectable other, Port portRange) Allow connections from the peer on the given port.void
allowFrom
(IConnectable other, Port portRange, String description) Allow connections from the peer on the given port.void
allowFromAnyIpv4
(Port portRange) Allow from any IPv4 ranges.void
allowFromAnyIpv4
(Port portRange, String description) Allow from any IPv4 ranges.void
allowInternally
(Port portRange) Allow hosts inside the security group to connect to each other on the given port.void
allowInternally
(Port portRange, String description) Allow hosts inside the security group to connect to each other on the given port.void
allowTo
(IConnectable other, Port portRange) Allow connections to the peer on the given port.void
allowTo
(IConnectable other, Port portRange, String description) Allow connections to the peer on the given port.void
allowToAnyIpv4
(Port portRange) Allow to all IPv4 ranges.void
allowToAnyIpv4
(Port portRange, String description) Allow to all IPv4 ranges.void
allowToDefaultPort
(IConnectable other) Allow connections to the security group on their default port.void
allowToDefaultPort
(IConnectable other, String description) Allow connections to the security group on their default port.The network connections associated with this resource.The default port configured for this connection peer, if available.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
Connections
protected Connections(software.amazon.jsii.JsiiObjectRef objRef) -
Connections
protected Connections(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Connections
- Parameters:
props
-
-
Connections
@Stability(Stable) public Connections()
-
-
Method Details
-
addSecurityGroup
Add a security group to the list of security groups managed by this object.- Parameters:
securityGroups
- This parameter is required.
-
allowDefaultPortFrom
@Stability(Stable) public void allowDefaultPortFrom(@NotNull IConnectable other, @Nullable String description) Allow connections from the peer on our default port.Even if the peer has a default port, we will always use our default port.
- Parameters:
other
- This parameter is required.description
-
-
allowDefaultPortFrom
Allow connections from the peer on our default port.Even if the peer has a default port, we will always use our default port.
- Parameters:
other
- This parameter is required.
-
allowDefaultPortFromAnyIpv4
Allow default connections from all IPv4 ranges.- Parameters:
description
-
-
allowDefaultPortFromAnyIpv4
@Stability(Stable) public void allowDefaultPortFromAnyIpv4()Allow default connections from all IPv4 ranges. -
allowDefaultPortInternally
Allow hosts inside the security group to connect to each other.- Parameters:
description
-
-
allowDefaultPortInternally
@Stability(Stable) public void allowDefaultPortInternally()Allow hosts inside the security group to connect to each other. -
allowDefaultPortTo
@Stability(Stable) public void allowDefaultPortTo(@NotNull IConnectable other, @Nullable String description) Allow connections from the peer on our default port.Even if the peer has a default port, we will always use our default port.
- Parameters:
other
- This parameter is required.description
-
-
allowDefaultPortTo
Allow connections from the peer on our default port.Even if the peer has a default port, we will always use our default port.
- Parameters:
other
- This parameter is required.
-
allowFrom
@Stability(Stable) public void allowFrom(@NotNull IConnectable other, @NotNull Port portRange, @Nullable String description) Allow connections from the peer on the given port.- Parameters:
other
- This parameter is required.portRange
- This parameter is required.description
-
-
allowFrom
Allow connections from the peer on the given port.- Parameters:
other
- This parameter is required.portRange
- This parameter is required.
-
allowFromAnyIpv4
@Stability(Stable) public void allowFromAnyIpv4(@NotNull Port portRange, @Nullable String description) Allow from any IPv4 ranges.- Parameters:
portRange
- This parameter is required.description
-
-
allowFromAnyIpv4
Allow from any IPv4 ranges.- Parameters:
portRange
- This parameter is required.
-
allowInternally
@Stability(Stable) public void allowInternally(@NotNull Port portRange, @Nullable String description) Allow hosts inside the security group to connect to each other on the given port.- Parameters:
portRange
- This parameter is required.description
-
-
allowInternally
Allow hosts inside the security group to connect to each other on the given port.- Parameters:
portRange
- This parameter is required.
-
allowTo
@Stability(Stable) public void allowTo(@NotNull IConnectable other, @NotNull Port portRange, @Nullable String description) Allow connections to the peer on the given port.- Parameters:
other
- This parameter is required.portRange
- This parameter is required.description
-
-
allowTo
Allow connections to the peer on the given port.- Parameters:
other
- This parameter is required.portRange
- This parameter is required.
-
allowToAnyIpv4
@Stability(Stable) public void allowToAnyIpv4(@NotNull Port portRange, @Nullable String description) Allow to all IPv4 ranges.- Parameters:
portRange
- This parameter is required.description
-
-
allowToAnyIpv4
Allow to all IPv4 ranges.- Parameters:
portRange
- This parameter is required.
-
allowToDefaultPort
@Stability(Stable) public void allowToDefaultPort(@NotNull IConnectable other, @Nullable String description) Allow connections to the security group on their default port.- Parameters:
other
- This parameter is required.description
-
-
allowToDefaultPort
Allow connections to the security group on their default port.- Parameters:
other
- This parameter is required.
-
getConnections
The network connections associated with this resource.- Specified by:
getConnections
in interfaceIConnectable
-
getSecurityGroups
-
getDefaultPort
The default port configured for this connection peer, if available.
-