-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change inputs back to string from list(string) #27
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -6,15 +6,15 @@ locals { | |||||||||||||||||||
|
||||||||||||||||||||
default_rule_description = "Managed by Terraform" | ||||||||||||||||||||
|
||||||||||||||||||||
create_security_group = local.enabled && length(var.target_security_group_id) == 0 | ||||||||||||||||||||
create_security_group = local.enabled && length(var.target_security_group_id[*]) == 0 | ||||||||||||||||||||
|
||||||||||||||||||||
created_security_group = local.create_security_group ? ( | ||||||||||||||||||||
var.create_before_destroy ? aws_security_group.cbd[0] : aws_security_group.default[0] | ||||||||||||||||||||
) : null | ||||||||||||||||||||
|
||||||||||||||||||||
security_group_id = local.enabled ? ( | ||||||||||||||||||||
# Use coalesce() here to hack an error message into the output | ||||||||||||||||||||
local.create_security_group ? local.created_security_group.id : coalesce(var.target_security_group_id[0], | ||||||||||||||||||||
local.create_security_group ? local.created_security_group.id : coalesce(var.target_security_group_id, | ||||||||||||||||||||
"var.target_security_group_id contains null value. Omit value if you want this module to create a security group.") | ||||||||||||||||||||
) : null | ||||||||||||||||||||
} | ||||||||||||||||||||
|
@@ -25,15 +25,15 @@ resource "aws_security_group" "default" { | |||||||||||||||||||
# Because we have 2 almost identical alternatives, use x == false and x == true rather than x and !x | ||||||||||||||||||||
count = local.create_security_group && var.create_before_destroy == false ? 1 : 0 | ||||||||||||||||||||
|
||||||||||||||||||||
name = concat(var.security_group_name, [module.this.id])[0] | ||||||||||||||||||||
name = concat(var.security_group_name[*], [module.this.id])[0] | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ensure Security Groups are attached to EC2 instances or ENIs
|
Path | Resource | Connecting Attribute |
---|---|---|
/main.tf | aws_security_group_rule.keyed | depends_on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure Security Groups are attached to EC2 instances or ENIs
Resource: aws_security_group.default | ID: BC_AWS_NETWORKING_51
How to Fix
resource "aws_network_interface" "test" {
subnet_id = "aws_subnet.public_a.id"
security_groups = [aws_security_group.ok_sg.id]
}
resource "aws_instance" "test" {
ami = "data.aws_ami.ubuntu.id"
instance_type = "t3.micro"
security_groups = [aws_security_group.ok_sg.id]
}
resource "aws_security_group" "ok_sg" {
ingress {
description = "TLS from VPC"
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = 0.0.0.0/0
}
}
Description
A check to ensure that orphaned Security groups aren't created. Elastic Network Interfaces (ENIs). This checks that Security Groups are attached to provisioning resources.Dependent Resources
Path | Resource | Connecting Attribute |
---|---|---|
/main.tf | aws_security_group_rule.keyed | depends_on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure Security Groups are attached to EC2 instances or ENIs
Resource: aws_security_group.cbd | ID: BC_AWS_NETWORKING_51
How to Fix
resource "aws_network_interface" "test" {
subnet_id = "aws_subnet.public_a.id"
security_groups = [aws_security_group.ok_sg.id]
}
resource "aws_instance" "test" {
ami = "data.aws_ami.ubuntu.id"
instance_type = "t3.micro"
security_groups = [aws_security_group.ok_sg.id]
}
resource "aws_security_group" "ok_sg" {
ingress {
description = "TLS from VPC"
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = 0.0.0.0/0
}
}
Description
A check to ensure that orphaned Security groups aren't created. Elastic Network Interfaces (ENIs). This checks that Security Groups are attached to provisioning resources.Dependent Resources
Path | Resource | Connecting Attribute |
---|---|---|
/main.tf | aws_security_group_rule.keyed | depends_on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure Security Groups are attached to EC2 instances or ENIs
Resource: aws_security_group.cbd | ID: BC_AWS_NETWORKING_51
How to Fix
resource "aws_network_interface" "test" {
subnet_id = "aws_subnet.public_a.id"
security_groups = [aws_security_group.ok_sg.id]
}
resource "aws_instance" "test" {
ami = "data.aws_ami.ubuntu.id"
instance_type = "t3.micro"
security_groups = [aws_security_group.ok_sg.id]
}
resource "aws_security_group" "ok_sg" {
ingress {
description = "TLS from VPC"
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = 0.0.0.0/0
}
}
Description
A check to ensure that orphaned Security groups aren't created. Elastic Network Interfaces (ENIs). This checks that Security Groups are attached to provisioning resources.Dependent Resources
Path | Resource | Connecting Attribute |
---|---|---|
/main.tf | aws_security_group_rule.keyed | depends_on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure Security Groups are attached to EC2 instances or ENIs
Resource: aws_security_group.cbd | ID: BC_AWS_NETWORKING_51
How to Fix
resource "aws_network_interface" "test" {
subnet_id = "aws_subnet.public_a.id"
security_groups = [aws_security_group.ok_sg.id]
}
resource "aws_instance" "test" {
ami = "data.aws_ami.ubuntu.id"
instance_type = "t3.micro"
security_groups = [aws_security_group.ok_sg.id]
}
resource "aws_security_group" "ok_sg" {
ingress {
description = "TLS from VPC"
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = 0.0.0.0/0
}
}
Description
A check to ensure that orphaned Security groups aren't created. Elastic Network Interfaces (ENIs). This checks that Security Groups are attached to provisioning resources.Dependent Resources
Path | Resource | Connecting Attribute |
---|---|---|
/main.tf | aws_security_group_rule.keyed | depends_on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure Security Groups are attached to EC2 instances or ENIs
Resource: aws_security_group.default | ID:
BC_AWS_NETWORKING_51
How to Fix
Description
A check to ensure that orphaned Security groups aren't created. Elastic Network Interfaces (ENIs). This checks that Security Groups are attached to provisioning resources.Dependent Resources