mirror of
https://github.com/inspec/inspec
synced 2024-11-10 23:24:18 +00:00
Ensure unique security group name while integration testing. (#218)
Signed-off-by: Miah Johnson <miah@chia-pet.org>
This commit is contained in:
parent
f09d4f5266
commit
820547aa9d
2 changed files with 8 additions and 3 deletions
|
@ -189,7 +189,7 @@ output "vpc_non_default_instance_tenancy" {
|
|||
# Create a security group with a known description
|
||||
# in the default VPC
|
||||
resource "aws_security_group" "alpha" {
|
||||
name = "alpha"
|
||||
name = "${terraform.env}-alpha"
|
||||
description = "SG alpha"
|
||||
vpc_id = "${data.aws_vpc.default.id}"
|
||||
}
|
||||
|
@ -197,3 +197,7 @@ resource "aws_security_group" "alpha" {
|
|||
output "ec2_security_group_alpha_group_id" {
|
||||
value = "${aws_security_group.alpha.id}"
|
||||
}
|
||||
|
||||
output "ec2_security_group_alpha_group_name" {
|
||||
value = "${aws_security_group.alpha.name}"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ fixtures = {}
|
|||
'ec2_security_group_default_vpc_id',
|
||||
'ec2_security_group_default_group_id',
|
||||
'ec2_security_group_alpha_group_id',
|
||||
'ec2_security_group_alpha_group_name',
|
||||
].each do |fixture_name|
|
||||
fixtures[fixture_name] = attribute(
|
||||
fixture_name,
|
||||
|
@ -33,7 +34,7 @@ control "aws_ec2_security_group properties" do
|
|||
end
|
||||
|
||||
describe aws_ec2_security_group(fixtures['ec2_security_group_alpha_group_id']) do
|
||||
its('group_name') { should cmp 'alpha' }
|
||||
its('group_name') { should cmp fixtures['ec2_security_group_alpha_group_name'] }
|
||||
its('vpc_id') { should cmp fixtures['ec2_security_group_default_vpc_id'] }
|
||||
its('description') { should cmp 'SG alpha' }
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue