SecurityGroupProps

class aws_cdk.aws_ec2.SecurityGroupProps(*, vpc, allow_all_outbound=None, description=None, security_group_name=None)

Bases: object

__init__(*, vpc, allow_all_outbound=None, description=None, security_group_name=None)
Parameters
  • vpc (IVpc) – The VPC in which to create the security group.

  • allow_all_outbound (Optional[bool]) – Whether to allow all outbound traffic by default. If this is set to true, there will only be a single egress rule which allows all outbound traffic. If this is set to false, no outbound traffic will be allowed by default and all egress traffic must be explicitly authorized. Default: true

  • description (Optional[str]) – A description of the security group. Default: The default name will be the construct’s CDK path.

  • security_group_name (Optional[str]) – The name of the security group. For valid values, see the GroupName parameter of the CreateSecurityGroup action in the Amazon EC2 API Reference. It is not recommended to use an explicit group name. Default: If you don’t specify a GroupName, AWS CloudFormation generates a unique physical ID and uses that ID for the group name.

Attributes

allow_all_outbound

Whether to allow all outbound traffic by default.

If this is set to true, there will only be a single egress rule which allows all outbound traffic. If this is set to false, no outbound traffic will be allowed by default and all egress traffic must be explicitly authorized.

default :default: true

Return type

Optional[bool]

description

A description of the security group.

default :default: The default name will be the construct’s CDK path.

Return type

Optional[str]

security_group_name

The name of the security group.

For valid values, see the GroupName parameter of the CreateSecurityGroup action in the Amazon EC2 API Reference.

It is not recommended to use an explicit group name.

default :default:

If you don’t specify a GroupName, AWS CloudFormation generates a unique physical ID and uses that ID for the group name.

Return type

Optional[str]

vpc

The VPC in which to create the security group.

Return type

IVpc