full-artist-27215
09/22/2022, 6:03 PMtrue
whenever I create one of these repositories (in particular, the xray_index
property: https://www.pulumi.com/registry/packages/artifactory/api-docs/localgenericrepository/#xray_index_python). I know that I can explicitly check the type of the resource first and then see if the property is set:
if args.resource_type in ["artifactory:index/localGenericRepository:LocalGenericRepository", ...]:
if not args.props.get("xrayIndex"):
report_violation(...)
However, I was wondering if it would instead be possible to just see if the resource had an xrayIndex
property (without listing out all the resource types explicitly). However, it only appears that I have access to whatever properties happen to have been set on the concrete resource. Since this particular boolean property defaults to false
, this makes any resources that are in violation "invisible" to this kind of checking logic.
Is there any way in a policy to see all the possible properties a resource could have, rather than just the ones that have been set on any given instance?
After typing this out, I think I may end up sticking with the more explicit approach, but now I'm curious 😅No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by