File tree Expand file tree Collapse file tree 5 files changed +49
-1
lines changed
Expand file tree Collapse file tree 5 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 1+ data "aws_vpc" "default" {
2+ default = true
3+ }
Original file line number Diff line number Diff line change 1+ resource "aws_security_group" "this" {
2+ name = var. name
3+ description = var. description
4+ vpc_id = coalesce (var. vpc_id , data. aws_vpc . default . id )
5+
6+ tags = var. tags
7+ }
Original file line number Diff line number Diff line change 1+ output "security_group_id" {
2+ description = " The ID of the security group"
3+ value = aws_security_group. this . id
4+ }
5+
6+ output "security_group_arn" {
7+ description = " The ARN of the security group"
8+ value = aws_security_group. this . arn
9+ }
Original file line number Diff line number Diff line change 1+ variable "name" {
2+ description = " (Optional, Forces new resource) Name of the security group."
3+ type = string
4+ }
5+
6+ variable "description" {
7+ description = " (Optional, Forces new resource) Security group description."
8+ type = string
9+ default = " Managed by Terraform"
10+ }
11+
12+ variable "vpc_id" {
13+ description = " (Optional, Forces new resource) VPC ID."
14+ type = string
15+ default = null
16+ }
17+
18+ variable "tags" {
19+ description = " (Optional) Map of tags to assign to the resource. "
20+ type = map (string )
21+ default = {}
22+ }
Original file line number Diff line number Diff line change 11terraform {
2- required_version = " >= 1.8.4"
2+ required_version = " >= 1.8.4"
3+
4+ required_providers {
5+ aws = {
6+ source = " hashicorp/aws"
7+ version = " >= 5.51.0"
8+ }
9+ }
310}
You can’t perform that action at this time.
0 commit comments