Class SecurityGroup.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<SecurityGroup>
- Enclosing class:
SecurityGroup
SecurityGroup
.-
Method Summary
Modifier and TypeMethodDescriptionallowAllIpv6Outbound
(Boolean allowAllIpv6Outbound) Whether to allow all outbound ipv6 traffic by default.allowAllOutbound
(Boolean allowAllOutbound) Whether to allow all outbound traffic by default.build()
static SecurityGroup.Builder
description
(String description) A description of the security group.disableInlineRules
(Boolean disableInlineRules) Whether to disable inline ingress and egress rule optimization.securityGroupName
(String securityGroupName) The name of the security group.The VPC in which to create the security group.
-
Method Details
-
create
@Stability(Stable) public static SecurityGroup.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
SecurityGroup.Builder
.
-
vpc
The VPC in which to create the security group.- Parameters:
vpc
- The VPC in which to create the security group. This parameter is required.- Returns:
this
-
allowAllIpv6Outbound
Whether to allow all outbound ipv6 traffic by default.If this is set to true, there will only be a single egress rule which allows all outbound ipv6 traffic. If this is set to false, no outbound traffic will be allowed by default and all egress ipv6 traffic must be explicitly authorized.
To allow all ipv4 traffic use allowAllOutbound
Default: false
- Parameters:
allowAllIpv6Outbound
- Whether to allow all outbound ipv6 traffic by default. This parameter is required.- Returns:
this
-
allowAllOutbound
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.
To allow all ipv6 traffic use allowAllIpv6Outbound
Default: true
- Parameters:
allowAllOutbound
- Whether to allow all outbound traffic by default. This parameter is required.- Returns:
this
-
description
A description of the security group.Default: The default name will be the construct's CDK path.
- Parameters:
description
- A description of the security group. This parameter is required.- Returns:
this
-
disableInlineRules
Whether to disable inline ingress and egress rule optimization.If this is set to true, ingress and egress rules will not be declared under the SecurityGroup in cloudformation, but will be separate elements.
Inlining rules is an optimization for producing smaller stack templates. Sometimes this is not desirable, for example when security group access is managed via tags.
The default value can be overriden globally by setting the context variable '@aws-cdk/aws-ec2.securityGroupDisableInlineRules'.
Default: false
- Parameters:
disableInlineRules
- Whether to disable inline ingress and egress rule optimization. This parameter is required.- Returns:
this
-
securityGroupName
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.
- Parameters:
securityGroupName
- The name of the security group. This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<SecurityGroup>
- Returns:
- a newly built instance of
SecurityGroup
.
-