-
Notifications
You must be signed in to change notification settings - Fork 150
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
How can I check a reference for a particular property? #234
Comments
Hi, Instead of reference you should use When its address is alb or When its address is aws_security_group.alb Sorry, couldnt remember which one I am on mobile right now :( |
Additionally, it will always pick up the linked/mounted resources on it, since they act as one resource. In order to avoid this problem we may define a new tag like ; @nomount
Given I have aws_security_group defined Of course the tag name could be many things :) |
Is it possible to give a bit more detail about the use case ? |
Thanks for the quick reply. 🙂 The use case is to check whether we only have three rules for all at, and each of them has the correct port and source security group. The other use case is that I want to check whether a security group have egress |
It is good to know it will pick up linked resources on alb. I may give that a go, thanks a lot 🙂 |
Sorry, still not quite get it. What I want to do is: Scenario Outline: Application load balancer security group allows load balancer to communicate with itself
Given I have aws_security_group_rule defined
When its reference is aws_security_group.alb
And its type is <type>
Then its protocol must be tcp
And its from_port must be 0
And its to_port must be 65535
And it must contain self
And its value must be true
Examples:
| type |
| ingress |
| egress | This obviously failed as |
Sorry for the late response. It fails, exactly for the reason you said. It mounts In order to solve this problem, a bit of refactoring is required since we keep the references as a list right now like Possibly there will be a slight improvement in ; When its reference is aws_security_group.alb where you can use as is or give a key/value pair like ; When its security_group_id reference is aws_security_group.alb
^^^^^^^^^^^^^^^^^ |
Been waiting for #229 too long. Releasing new version. |
Can you have a try with |
This issue's conversation is now locked. If you want to continue this discussion please open a new issue. |
** Question : **
Given I have following tf, how can I write a When to filter security group rules belong to
aws_security_group.alb
only? If I useits reference is aws_security_group.alb
, it will also pick upaws_security_group_rule.alb_ecs_ingress
The text was updated successfully, but these errors were encountered: