CfnSecurityGroupProps

class aws_cdk.aws_ec2.CfnSecurityGroupProps(*, group_description, group_name=None, security_group_egress=None, security_group_ingress=None, tags=None, vpc_id=None)

Bases: object

Properties for defining a CfnSecurityGroup.

Parameters
  • group_description (str) – A description for the security group. This is informational only. Constraints: Up to 255 characters in length Constraints for EC2-Classic: ASCII characters Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

  • group_name (Optional[str]) – The name of the security group. Constraints: Up to 255 characters in length. Cannot start with sg- . Constraints for EC2-Classic: ASCII characters Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

  • security_group_egress (Union[IResolvable, Sequence[Union[IResolvable, EgressProperty, Dict[str, Any]]], None]) – [VPC only] The outbound rules associated with the security group. There is a short interruption during which you cannot connect to the security group.

  • security_group_ingress (Union[IResolvable, Sequence[Union[IResolvable, IngressProperty, Dict[str, Any]]], None]) – The inbound rules associated with the security group. There is a short interruption during which you cannot connect to the security group.

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – Any tags assigned to the security group.

  • vpc_id (Optional[str]) – [VPC only] The ID of the VPC for the security group.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ec2 as ec2

cfn_security_group_props = ec2.CfnSecurityGroupProps(
    group_description="groupDescription",

    # the properties below are optional
    group_name="groupName",
    security_group_egress=[ec2.CfnSecurityGroup.EgressProperty(
        ip_protocol="ipProtocol",

        # the properties below are optional
        cidr_ip="cidrIp",
        cidr_ipv6="cidrIpv6",
        description="description",
        destination_prefix_list_id="destinationPrefixListId",
        destination_security_group_id="destinationSecurityGroupId",
        from_port=123,
        to_port=123
    )],
    security_group_ingress=[ec2.CfnSecurityGroup.IngressProperty(
        ip_protocol="ipProtocol",

        # the properties below are optional
        cidr_ip="cidrIp",
        cidr_ipv6="cidrIpv6",
        description="description",
        from_port=123,
        source_prefix_list_id="sourcePrefixListId",
        source_security_group_id="sourceSecurityGroupId",
        source_security_group_name="sourceSecurityGroupName",
        source_security_group_owner_id="sourceSecurityGroupOwnerId",
        to_port=123
    )],
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    vpc_id="vpcId"
)

Attributes

group_description

A description for the security group. This is informational only.

Constraints: Up to 255 characters in length

Constraints for EC2-Classic: ASCII characters

Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group.html#cfn-ec2-securitygroup-groupdescription

Return type

str

group_name

The name of the security group.

Constraints: Up to 255 characters in length. Cannot start with sg- .

Constraints for EC2-Classic: ASCII characters

Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group.html#cfn-ec2-securitygroup-groupname

Return type

Optional[str]

security_group_egress

[VPC only] The outbound rules associated with the security group.

There is a short interruption during which you cannot connect to the security group.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group.html#cfn-ec2-securitygroup-securitygroupegress

Return type

Union[IResolvable, List[Union[IResolvable, EgressProperty]], None]

security_group_ingress

The inbound rules associated with the security group.

There is a short interruption during which you cannot connect to the security group.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group.html#cfn-ec2-securitygroup-securitygroupingress

Return type

Union[IResolvable, List[Union[IResolvable, IngressProperty]], None]

tags

Any tags assigned to the security group.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group.html#cfn-ec2-securitygroup-tags

Return type

Optional[List[CfnTag]]

vpc_id

[VPC only] The ID of the VPC for the security group.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group.html#cfn-ec2-securitygroup-vpcid

Return type

Optional[str]