I'm having a bear of a time trying to query for sp...
# atmos
i
I'm having a bear of a time trying to query for specific outputs using
!store
. This worked before using
!terraform.output
What am I missing here?
Copy code
!store dev/ssm vpc-networking "public_subnet_objects | query select(.tags.Name == ""bastion_subnet_us_east_2c"") | .id"
a
did you use hooks to write to the store first?
i
I did, it's that it's not interpolating the value into the yaml file.
"invalid YAML function: !store dev/ssm vpc-networking \"public_subnet_objects | query select(.tags.Name == \"\"bastion_subnet_us_east_2c\"\") | .id\""
is in the tfvars generated
This works:
!terraform.output vpc-networking ".public_subnet_objects.[] | select(.tags.Name == ""bastion_subnet_us_east_2b"") | .id"
a
maybe try this
Copy code
!store dev/ssm vpc-networking public_subnet_objects | query "select(.tags.Name == ""bastion_subnet_us_east_2c"") | .id"
👀 1
i
ERRO invalid YAML function function="!store dev/ssm vpc-networking public_subnet_objects | query \"select(.tags.Name == \"\"bastion_subnet_us_east_2c\"\") | .id\"" invalid number of parameters after the pipe=4
a
how about this (I can't test it right now, so just trying to help you to find the correct syntax)
Copy code
!store dev/ssm vpc-networking public_subnet_objects | query 'select(.tags.Name == "bastion_subnet_us_east_2c") | .id'
i
This produced the same error
g
@Andriy Knysh (Cloud Posse)
a
we'll have to review this. Looks like the double-quotes are not supported in the
query
(we need to make
!store
behave the same as
!terraform.state
)