You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to test if certain tags have been set on my subnets, but unfortunately, the tags property returns a nested list, making it rather impossible to test if a certain tag is in it.
Test code:
vpc_private_subnet_ids = attribute('vpc_private_subnet_ids', description: 'private subnet ids')
control 'vpc' do
vpc_private_subnet_ids.each do |subnet_id|
describe aws_subnets.where(subnet_id: subnet_id) do
its('tags') { should include({key: 'kubernetes.io/cluster/test-cluster1', value: 'shared'}) }
end
end
end
(Redacted) output of the test:
× aws_subnets with subnet_id == "subnet-0****6" tags is expected to include {:key => "kubernetes.io/cluster/test-cluster1", :value => "shared"}
expected [[{:key => "Ext_access", :value => "true"}, {:key => "Name", :value => "********-1...hared"}, {:key => "Public", :value => "false"}, {:key => "kubernetes.io/role/internal-elb", :value => "1"}]] to include {:key => "kubernetes.io/cluster/test-cluster1", :value => "shared"}
Possible Solution
The tags property should be a simple list containing the key-value pairs. This will allow us to test resources with multiple tags.
The text was updated successfully, but these errors were encountered:
Describe the problem
I try to test if certain tags have been set on my subnets, but unfortunately, the
tags
property returns a nested list, making it rather impossible to test if a certain tag is in it.Test code:
(Redacted) output of the test:
Possible Solution
The
tags
property should be a simple list containing the key-value pairs. This will allow us to test resources with multiple tags.The text was updated successfully, but these errors were encountered: