Open ajlanghorn opened 8 years ago
Hi @ajlanghorn !
If the Name tag value
is unique in instances, ec2
resource can detect instance by the Name tag value
. ( see https://github.com/k1LoW/awspec/blob/master/spec/type/ec2_spec.rb#L34 )
throw Awspec::DuplicatedResourceTypeError
(And see https://github.com/k1LoW/awspec/issues/155#issuecomment-229229696)
Hi @k1LoW! Thanks; I've got a few instances with the same value for the Name
tag, but a different value for a separate tag. I'd love it if I can get something like:
describe ec2('name') do
it { should have_tag('env').value('production') }
end
to work, because then I can differentiate based on the env
tag's value, without changing the rest of my test.
Hi!
I think " *spec (like awspec / RSpec / Serverspec) should detect resource uniquely "
Your spec can not report true
or false
.
So awspec throw Awspec::DuplicatedResourceTypeError.
Best Regards.
Is it possible to give the EC2 resource type something other than an instance ID to allow it to match? As an example:
works fine, but:
doesn't.
Given that instances often don't stay around for very long, and even if they do, the instance IDs aren't how (I figure) many people refer to instances (most people I know refer using tags), is it possible to use the Name tag value in place of the instance ID to get a match on the specific resource?