Policy for resource with both expand modes #207
Unanswered
KazMiddelhoek
asked this question in
Q&A
Replies: 1 comment
-
|
Unfortunately, you cannot use different modes at the same time, so you have to get the resources for each and match them by name. By the way, tags should be returned even when |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to write a policy that raises issues for terraform resources with tags defined, but without a lifecycle defined for some tags.
So this is correct:
And this is not:
I believe to test this, I need something like
resources := terraform.resources("*", {"tags": "map(string)", "lifecycle": {"ignore_changes": "expr"} }, { "expand_mode": "expand" })To return the tags, I need expand_mode = expand (otherwise tags are not returned) , but to return the lifecycle correctly I need expand_mode = none (otherwise I get the error 'Invalid reference; A reference to a resource type must be followed by at least one attribute access, specifying the resource name'.)
How can I solve this problem? Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions