Class CfnSecurityGroupIngress
Adds an inbound (ingress) rule to a security group.
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnSecurityGroupIngress : CfnResource, IInspectable, ISecurityGroupIngressRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class CfnSecurityGroupIngress Inherits CfnResource Implements IInspectable, ISecurityGroupIngressRef, IConstruct, IDependable, IEnvironmentAware
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
var cfnSecurityGroupIngress = new CfnSecurityGroupIngress(this, "MyCfnSecurityGroupIngress", new CfnSecurityGroupIngressProps {
IpProtocol = "ipProtocol",
// the properties below are optional
CidrIp = "cidrIp",
CidrIpv6 = "cidrIpv6",
Description = "description",
FromPort = 123,
GroupId = "groupId",
GroupName = "groupName",
SourcePrefixListId = "sourcePrefixListId",
SourceSecurityGroupId = "sourceSecurityGroupId",
SourceSecurityGroupName = "sourceSecurityGroupName",
SourceSecurityGroupOwnerId = "sourceSecurityGroupOwnerId",
ToPort = 123
});
Synopsis
Constructors
| CfnSecurityGroupIngress(Construct, string, ICfnSecurityGroupIngressProps) | Create a new |
Properties
| AttrId | The Security Group Rule Id. |
| CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
| CfnProperties | Adds an inbound (ingress) rule to a security group. |
| CidrIp | The IPv4 address range, in CIDR format. |
| CidrIpv6 | The IPv6 address range, in CIDR format. |
| Description | Updates the description of an ingress (inbound) security group rule. |
| FromPort | The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. |
| GroupId | The ID of the security group. |
| GroupName | [Default VPC] The name of the security group. |
| IpProtocol | The IP protocol name ( |
| SecurityGroupIngressRef | A reference to a SecurityGroupIngress resource. |
| SourcePrefixListId | The ID of a prefix list. |
| SourceSecurityGroupId | The ID of the security group. |
| SourceSecurityGroupName | [Default VPC] The name of the source security group. |
| SourceSecurityGroupOwnerId | [nondefault VPC] The AWS account ID for the source security group, if the source security group is in a different account. |
| ToPort | The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. |
Methods
| Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
| IsCfnSecurityGroupIngress(object) | Checks whether the given object is a CfnSecurityGroupIngress. |
| RenderProperties(IDictionary<string, object>) | Adds an inbound (ingress) rule to a security group. |
Constructors
CfnSecurityGroupIngress(Construct, string, ICfnSecurityGroupIngressProps)
Create a new AWS::EC2::SecurityGroupIngress.
public CfnSecurityGroupIngress(Construct scope, string id, ICfnSecurityGroupIngressProps props)
Parameters
- scope Construct
Scope in which this resource is defined.
- id string
Construct identifier for this resource (unique in its scope).
- props ICfnSecurityGroupIngressProps
Resource properties.
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
Properties
AttrId
The Security Group Rule Id.
public virtual string AttrId { get; }
Property Value
Remarks
CloudformationAttribute: Id
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
CfnProperties
Adds an inbound (ingress) rule to a security group.
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
Overrides
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
CidrIp
The IPv4 address range, in CIDR format.
public virtual string? CidrIp { get; set; }
Property Value
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
CidrIpv6
The IPv6 address range, in CIDR format.
public virtual string? CidrIpv6 { get; set; }
Property Value
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
Description
Updates the description of an ingress (inbound) security group rule.
public virtual string? Description { get; set; }
Property Value
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
FromPort
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number.
public virtual double? FromPort { get; set; }
Property Value
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
GroupId
The ID of the security group.
public virtual string? GroupId { get; set; }
Property Value
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
GroupName
[Default VPC] The name of the security group.
public virtual string? GroupName { get; set; }
Property Value
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
IpProtocol
The IP protocol name ( tcp , udp , icmp , icmpv6 ) or number (see Protocol Numbers ).
public virtual string IpProtocol { get; set; }
Property Value
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
SecurityGroupIngressRef
A reference to a SecurityGroupIngress resource.
public virtual ISecurityGroupIngressReference SecurityGroupIngressRef { get; }
Property Value
ISecurityGroupIngressReference
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
SourcePrefixListId
The ID of a prefix list.
public virtual string? SourcePrefixListId { get; set; }
Property Value
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
SourceSecurityGroupId
The ID of the security group.
public virtual string? SourceSecurityGroupId { get; set; }
Property Value
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
SourceSecurityGroupName
[Default VPC] The name of the source security group.
public virtual string? SourceSecurityGroupName { get; set; }
Property Value
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
SourceSecurityGroupOwnerId
[nondefault VPC] The AWS account ID for the source security group, if the source security group is in a different account.
public virtual string? SourceSecurityGroupOwnerId { get; set; }
Property Value
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
ToPort
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
public virtual double? ToPort { get; set; }
Property Value
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
IsCfnSecurityGroupIngress(object)
Checks whether the given object is a CfnSecurityGroupIngress.
public static bool IsCfnSecurityGroupIngress(object x)
Parameters
- x object
Returns
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated
RenderProperties(IDictionary<string, object>)
Adds an inbound (ingress) rule to a security group.
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props IDictionary<string, object>
Returns
Overrides
Remarks
An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 address range, the IP addresses 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.
CloudformationResource: AWS::EC2::SecurityGroupIngress
ExampleMetadata: fixture=_generated