Resource
aws.ec2.SecurityGroup
Describes a security group.
Example
let vpc = aws.ec2.Vpc {
cidr_block = '10.0.0.0/16'
tags = {
Environment = 'example'
}
}
aws.ec2.SecurityGroup {
group_name = 'carina-example-sg'
description = 'Example security group'
vpc_id = vpc.vpc_id
tags = {
Environment = 'example'
}
}
Argument Reference
description
- Type:
String - Required: Yes
A description for the security group. Constraints: Up to 255 characters in length Valid characters: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*
group_name
- Type:
Ec2SecurityGroupName (pattern: /^[A-Za-z0-9 ._:/()#,@\[\]+=\&;{}!$*\-]+\z/ (Full), len: 1..=255, custom validator); 1..255 ASCII characters; must not start with sg- - Required: Yes
The name of the security group. Names are case-insensitive and must be unique within the VPC. Constraints: Up to 255 characters in length. Can't start with sg-. Valid characters: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*
vpc_id
- Type:
VpcId (pattern: /^vpc-[0-9a-f]{8,}$/ (Full)) - Required: No
The ID of the VPC. Required for a nondefault VPC.
tags
- Type: Map<
String,String> - Required: No
The tags for the resource.
Attribute Reference
group_id
- Type:
SecurityGroupId (pattern: /^sg-[0-9a-f]{8,}$/ (Full)) - Read-only
The ID of the security group.