I want give a tag like below to my aws resources:
key=<random_string>
unique_name="vrKdtBo2ZO"
In a cloud custodian policy, how to generate a unique random string for tagging a resource?
I want give a tag like below to my aws resources:
key=<random_string>
unique_name="vrKdtBo2ZO"
In a cloud custodian policy, how to generate a unique random string for tagging a resource?
Copyright © 2021 Jogjafile Inc.
You can use the built-in variables.
In your policy, you simply provide them with the notation
{<var>}and on custodian/c7n-org run, these will get interpolated at runtime.For your use-case,
{uuid}would be an option for uniqueness.Some additional variables of interest might be:
ref: https://cloudcustodian.io/docs/aws/usage.html#s3-logs-records (note: these variables appear to be documented in the custodian reporting section but these are also applicable within policies)