Class CfnSecurityGroupIngress
Adds an inbound (ingress) rule to a security group.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnSecurityGroupIngress : CfnResource, IInspectable
Syntax (vb)
Public Class CfnSecurityGroupIngress
Inherits CfnResource
Implements IInspectable
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(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnSecurityGroupIngress(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnSecurityGroupIngress(Construct, String, ICfnSecurityGroupIngressProps) |
Properties
AttrId | The Security Group Rule Id. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
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 ( |
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. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnSecurityGroupIngress(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnSecurityGroupIngress(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnSecurityGroupIngress(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnSecurityGroupIngress(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnSecurityGroupIngress(Construct, String, ICfnSecurityGroupIngressProps)
public CfnSecurityGroupIngress(Construct scope, string id, ICfnSecurityGroupIngressProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnSecurityGroupIngressProps
Resource properties.
Properties
AttrId
The Security Group Rule Id.
public virtual string AttrId { get; }
Property Value
System.String
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
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
CidrIp
The IPv4 address range, in CIDR format.
public virtual string CidrIp { get; set; }
Property Value
System.String
CidrIpv6
The IPv6 address range, in CIDR format.
public virtual string CidrIpv6 { get; set; }
Property Value
System.String
Description
Updates the description of an ingress (inbound) security group rule.
public virtual string Description { get; set; }
Property Value
System.String
FromPort
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number.
public virtual Nullable<double> FromPort { get; set; }
Property Value
System.Nullable<System.Double>
GroupId
The ID of the security group.
public virtual string GroupId { get; set; }
Property Value
System.String
GroupName
[Default VPC] The name of the security group.
public virtual string GroupName { get; set; }
Property Value
System.String
IpProtocol
The IP protocol name ( tcp
, udp
, icmp
, icmpv6
) or number (see Protocol Numbers ).
public virtual string IpProtocol { get; set; }
Property Value
System.String
SourcePrefixListId
The ID of a prefix list.
public virtual string SourcePrefixListId { get; set; }
Property Value
System.String
SourceSecurityGroupId
The ID of the security group.
public virtual string SourceSecurityGroupId { get; set; }
Property Value
System.String
SourceSecurityGroupName
[Default VPC] The name of the source security group.
public virtual string SourceSecurityGroupName { get; set; }
Property Value
System.String
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
System.String
ToPort
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
public virtual Nullable<double> ToPort { get; set; }
Property Value
System.Nullable<System.Double>
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.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>