Show / Hide Table of Contents

Interface ISecurityGroupProps

Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.AWS.EC2.dll
Syntax (csharp)
public interface ISecurityGroupProps
Syntax (vb)
Public Interface ISecurityGroupProps
Remarks

ExampleMetadata: infused

Examples
Vpc vpc;


SecurityGroup securityGroup1 = new SecurityGroup(this, "SecurityGroup1", new SecurityGroupProps { Vpc = vpc });
ApplicationLoadBalancer lb = new ApplicationLoadBalancer(this, "LB", new ApplicationLoadBalancerProps {
    Vpc = vpc,
    InternetFacing = true,
    SecurityGroup = securityGroup1
});

SecurityGroup securityGroup2 = new SecurityGroup(this, "SecurityGroup2", new SecurityGroupProps { Vpc = vpc });
lb.AddSecurityGroup(securityGroup2);

Synopsis

Properties

AllowAllOutbound

Whether to allow all outbound traffic by default.

Description

A description of the security group.

DisableInlineRules

Whether to disable inline ingress and egress rule optimization.

SecurityGroupName

The name of the security group.

Vpc

The VPC in which to create the security group.

Properties

AllowAllOutbound

Whether to allow all outbound traffic by default.

virtual Nullable<bool> AllowAllOutbound { get; }
Property Value

System.Nullable<System.Boolean>

Remarks

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

A description of the security group.

virtual string Description { get; }
Property Value

System.String

Remarks

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

DisableInlineRules

Whether to disable inline ingress and egress rule optimization.

virtual Nullable<bool> DisableInlineRules { get; }
Property Value

System.Nullable<System.Boolean>

Remarks

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&apos;.

Default: false

SecurityGroupName

The name of the security group.

virtual string SecurityGroupName { get; }
Property Value

System.String

Remarks

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.

Vpc

The VPC in which to create the security group.

IVpc Vpc { get; }
Property Value

IVpc

Back to top Generated by DocFX