-
-
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
Conversation
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.
Bridgecrew has found infrastructure configuration errors in this PR ⬇️
@@ -82,7 +82,7 @@ resource "aws_security_group" "cbd" { | |||
# 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 == true ? 1 : 0 | |||
|
|||
name_prefix = concat(var.security_group_name, ["${module.this.id}${module.this.delimiter}"])[0] | |||
name_prefix = concat(var.security_group_name[*], ["${module.this.id}${module.this.delimiter}"])[0] |
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 |
@@ -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 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 |
@@ -82,7 +82,7 @@ resource "aws_security_group" "cbd" { | |||
# 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 == true ? 1 : 0 | |||
|
|||
name_prefix = concat(var.security_group_name, ["${module.this.id}${module.this.delimiter}"])[0] | |||
name_prefix = concat(var.security_group_name[*], ["${module.this.id}${module.this.delimiter}"])[0] |
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 |
@@ -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 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.
Change details
-
Error ID Change Path Resource BC_AWS_NETWORKING_51 Added /main.tf aws_security_group.cbd BC_AWS_NETWORKING_51 Added /main.tf aws_security_group.default
/test bats |
/test readme terratest |
@@ -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 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 |
@@ -82,7 +82,7 @@ resource "aws_security_group" "cbd" { | |||
# 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 == true ? 1 : 0 | |||
|
|||
name_prefix = concat(var.security_group_name, ["${module.this.id}${module.this.delimiter}"])[0] | |||
name_prefix = concat(var.security_group_name[*], ["${module.this.id}${module.this.delimiter}"])[0] |
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.
Change details
-
Error ID Change Path Resource BC_AWS_NETWORKING_51 Added /main.tf aws_security_group.cbd BC_AWS_NETWORKING_51 Added /main.tf aws_security_group.default
@mcalhoun While these changes do avoid the I updated the test to surface the error. The first |
/test all |
I see the problem and the issue you opened. I guess we can't use this method until the underlying bug is fixed. Should we ask Hashcorp on that issue what a workaround is instead of turning |
@mcalhoun said:
Turning |
@mcalhoun Indeed, as I expected, hashicorp/terraform#29973 has been fixed by ensuring "unknown values upgraded to a collection via a splat expression result in a |
This pull request is now in conflict. Could you fix it @mcalhoun? 🙏 |
what
string
rather thanlist(string)