Class CfnSecurityGroupIngress
- All Implemented Interfaces:
IInspectable,ISecurityGroupIngressRef,IEnvironmentAware,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
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.
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.*;
CfnSecurityGroupIngress cfnSecurityGroupIngress = CfnSecurityGroupIngress.Builder.create(this, "MyCfnSecurityGroupIngress")
.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)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnSecurityGroupIngress.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.ec2.ISecurityGroupIngressRef
ISecurityGroupIngressRef.Jsii$Default, ISecurityGroupIngressRef.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnSecurityGroupIngress(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnSecurityGroupIngress(software.amazon.jsii.JsiiObjectRef objRef) CfnSecurityGroupIngress(software.constructs.Construct scope, String id, CfnSecurityGroupIngressProps props) Create a newAWS::EC2::SecurityGroupIngress. -
Method Summary
Modifier and TypeMethodDescriptionThe Security Group Rule Id.The IPv4 address range, in CIDR format.The IPv6 address range, in CIDR format.Updates the description of an ingress (inbound) security group rule.The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number.The ID of the security group.[Default VPC] The name of the security group.A reference to a SecurityGroupIngress resource.The ID of a prefix list.The ID of the security group.[Default VPC] The name of the source security group.[nondefault VPC] The AWS account ID for the source security group, if the source security group is in a different account.The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnSecurityGroupIngress.renderProperties(Map<String, Object> props) voidThe IPv4 address range, in CIDR format.voidsetCidrIpv6(String value) The IPv6 address range, in CIDR format.voidsetDescription(String value) Updates the description of an ingress (inbound) security group rule.voidsetFromPort(Number value) The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number.voidsetGroupId(String value) The ID of the security group.voidsetGroupName(String value) [Default VPC] The name of the security group.voidsetIpProtocol(String value) voidsetSourcePrefixListId(String value) The ID of a prefix list.voidsetSourceSecurityGroupId(String value) The ID of the security group.voidsetSourceSecurityGroupName(String value) [Default VPC] The name of the source security group.void[nondefault VPC] The AWS account ID for the source security group, if the source security group is in a different account.voidThe end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnSecurityGroupIngress
protected CfnSecurityGroupIngress(software.amazon.jsii.JsiiObjectRef objRef) -
CfnSecurityGroupIngress
protected CfnSecurityGroupIngress(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnSecurityGroupIngress
@Stability(Stable) public CfnSecurityGroupIngress(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnSecurityGroupIngressProps props) Create a newAWS::EC2::SecurityGroupIngress.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
isCfnSecurityGroupIngress
Checks whether the given object is a CfnSecurityGroupIngress.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrId
The Security Group Rule Id. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getSecurityGroupIngressRef
A reference to a SecurityGroupIngress resource.- Specified by:
getSecurityGroupIngressRefin interfaceISecurityGroupIngressRef
-
getIpProtocol
-
setIpProtocol
-
getCidrIp
The IPv4 address range, in CIDR format. -
setCidrIp
The IPv4 address range, in CIDR format. -
getCidrIpv6
The IPv6 address range, in CIDR format. -
setCidrIpv6
The IPv6 address range, in CIDR format. -
getDescription
Updates the description of an ingress (inbound) security group rule. -
setDescription
Updates the description of an ingress (inbound) security group rule. -
getFromPort
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. -
setFromPort
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. -
getGroupId
The ID of the security group. -
setGroupId
The ID of the security group. -
getGroupName
[Default VPC] The name of the security group. -
setGroupName
[Default VPC] The name of the security group. -
getSourcePrefixListId
The ID of a prefix list. -
setSourcePrefixListId
The ID of a prefix list. -
getSourceSecurityGroupId
The ID of the security group. -
setSourceSecurityGroupId
The ID of the security group. -
getSourceSecurityGroupName
[Default VPC] The name of the source security group. -
setSourceSecurityGroupName
[Default VPC] The name of the source security group. -
getSourceSecurityGroupOwnerId
[nondefault VPC] The AWS account ID for the source security group, if the source security group is in a different account. -
setSourceSecurityGroupOwnerId
[nondefault VPC] The AWS account ID for the source security group, if the source security group is in a different account. -
getToPort
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. -
setToPort
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
-