DefaultSecurityGroup

class DefaultSecurityGroup : KotlinCustomResource

Provides a resource to manage a default security group. This resource can manage the default security group of the default or a non-default VPC.

NOTE: This is an advanced resource with special caveats. Please read this document in its entirety before using this resource. The aws.ec2.DefaultSecurityGroup resource behaves differently from normal resources. This provider does not create this resource but instead attempts to "adopt" it into management. When the provider first begins managing the default security group, it immediately removes all ingress and egress rules in the Security Group. It then creates any rules specified in the configuration. This way only the rules specified in the configuration are created. This resource treats its inline rules as absolute; only the rules defined inline are created, and any additions/removals external to this resource will result in diff shown. For these reasons, this resource is incompatible with the aws.ec2.SecurityGroupRule resource. For more information about default security groups, see the AWS documentation on aws-default-security-groups. To manage normal security groups, see the aws.ec2.SecurityGroup resource.

Example Usage

The following config gives the default security group the same rules that AWS provides by default but under management by this provider. This means that any ingress or egress rules added or changed will be detected as drift. No Java example available.

Example Config To Deny All Egress Traffic, Allowing Ingress

The following denies all Egress traffic by omitting any egress rules, while including the default ingress rule to allow all traffic. No Java example available.

Import

Security Groups can be imported using the security group id, e.g.,

$ pulumi import aws:ec2/defaultSecurityGroup:DefaultSecurityGroup default_sg sg-903004f8

Properties

Link copied to clipboard
val arn: Output<String>

ARN of the security group.

Link copied to clipboard
val description: Output<String>

Description of this rule.

Link copied to clipboard

Configuration block. Detailed below.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

Configuration block. Detailed below.

Link copied to clipboard
val name: Output<String>

Name of the security group.

Link copied to clipboard
val namePrefix: Output<String>
Link copied to clipboard
val ownerId: Output<String>

Owner ID.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val tags: Output<Map<String, String>>?

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val tagsAll: Output<Map<String, String>>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val vpcId: Output<String>

VPC ID. Note that changing the vpc_id will not restore any default security group rules that were modified, added, or removed. It will be left in its current state.