Skip to content

Is it possible to use AWS Account ID and Region in a filter? #8727

Closed Answered by ajkerrigan
CallumHibbert asked this question in AWS
Discussion options

You must be logged in to vote

Sure, you can do that. If you were looking for a filter named my-filter-1 in us-east-2 of account 111111111111, you could use the key of your value filter to mush those elements into a single string. Your pseudocode was headed in the right direction and pretty close! A couple variations on an approach to do that:

key: join('-', ['{account_id}', '{region}', filterName])
key: join('', ['{account_id}-{region}-', filterName])

And then you could check your matches against a list of known account/region/filterName combinations:

filters:
  - type: value
    key: join('-', ['{account_id}', '{region}', filterName])
    op: in
    value:
      - '111111111111-us-east-1-my-filter-1'
      - '1111111…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by CallumHibbert
Comment options

You must be logged in to vote
1 reply
@ajkerrigan
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
AWS
Labels
None yet
2 participants