Interface CfnSecurityGroup.IngressProperty

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CfnSecurityGroup.IngressProperty.Jsii$Proxy
Enclosing class:
CfnSecurityGroup

@Stability(Stable) public static interface CfnSecurityGroup.IngressProperty extends software.amazon.jsii.JsiiSerializable
Adds an inbound (ingress) rule to a security group.

An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP address ranges that are specified by a prefix list, or the instances that are associated with a source security group. For more information, see Security group rules .

You must specify exactly one of the following sources: an IPv4 address range, an IPv6 address range, a prefix list, or a security group.

You must specify a protocol for each rule (for example, TCP). If the protocol is TCP or UDP, you must also specify a port or port range. If the protocol is ICMP or ICMPv6, you must also specify the ICMP/ICMPv6 type and code.

Rule changes are propagated to instances associated with the security group as quickly as possible. However, a small delay might occur.

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.*;
 IngressProperty ingressProperty = IngressProperty.builder()
         .ipProtocol("ipProtocol")
         // the properties below are optional
         .cidrIp("cidrIp")
         .cidrIpv6("cidrIpv6")
         .description("description")
         .fromPort(123)
         .sourcePrefixListId("sourcePrefixListId")
         .sourceSecurityGroupId("sourceSecurityGroupId")
         .sourceSecurityGroupName("sourceSecurityGroupName")
         .sourceSecurityGroupOwnerId("sourceSecurityGroupOwnerId")
         .toPort(123)
         .build();
 

See Also: