Does anyone know how to convert a string to int he...
# general
j
Does anyone know how to convert a string to int here:
Copy code
policies:
  - name: monitor-cloudwatch-log-group
    resource: aws.log-group
    description: Set log retention on log cloud watch groups if missing
    filters:
      - type: value
        key: retentionInDays
        value: null
    actions:
      - type: retention
        days: "{c7n_cloudwatch_logroup_retention}" # HERE is a string should be a int
I can't find much in the docs, or any examples
a
I'm running a policy like that and it's working fine, but it does assume that wherever you're defining the variable you're using an int. So if you've got a c7n-org config file it would need to have a block like
Copy code
vars:
      c7n_cloudwatch_logroup_retention: 60
rather than
Copy code
vars:
      c7n_cloudwatch_logroup_retention: "60"
Having the quotes around the variable placeholder in the policy itself is fine
j
thanks I don't think I can change the variable in the vars file to a string, as it's populated from a tag on aws accounts, and tags are string