question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need a way to tag lambda functions being created by Cloud Custodian

See original GitHub issue

Does Cloud Custodian have a way to tag lambda functions created with Cloud Custodian.

It would be useful for trying to group similar policies together. For example, say I have two policies in a file named multiAZ-notify.yml. It would be beneficial to have a tag with the key ‘policy-group’ and the value: multiAZ-notify.

For example if we could add a tag similar too this:

policies:
  - name: multiAZ-created-notify
    tags:
      - key: policy-group
        value: multiAZ-notify
    resource: rds
    mode:
      type: cloudtrail
      events:
        - CreateDBInstance
    filters:
      - type: value
        key: 'MultiAZ'
        value: true
    actions:
      - type: notify    
        template: default
        priority_header: '1'
        subject: RDS MultiAZ Detected
        to:
            - test@email.com
        transport:
            type: sqs
            region: us-east-1

  - name: multiAZ-modified-notify
    tags:
      - key: policy-group
        value: multiAZ-notify
    resource: rds
    mode:
      type: cloudtrail
      events:
        - source: rds.amazonaws.com
          event: ModifyDBInstance
          ids: "requestParameters.dBInstanceIdentifier"
    filters:
      - type: value
        key: 'PendingModifiedValues.MultiAZ'
        value: true
    actions:
      - type: notify
        template: default
        priority_header: '1'
        subject: RDS MultiAZ Detected
        to:
            - test@email.com
        transport:
            type: sqs
            region: us-east-1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
thisisshicommented, Jun 14, 2018

Yeah, looks like the actual docs are a bit obtuse when it comes to showing how to exactly do it. This should work:

policies:
  - name: multiAZ-created-notify
    resource: rds
    mode:
      type: cloudtrail
      events:
        - CreateDBInstance
      tags:
        policy-group: multiAZ-notify
0reactions
rishiloyolacommented, Apr 23, 2019

no this is not working for me. Can someone suggest me a way to tag it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lambda Support — Cloud Custodian documentation
First, modify custodian. yml to specify a mode type of config-rule . You'll also need the ARN of an IAM role to assume...
Read more >
aws.lambda — Cloud Custodian documentation
Set lambda function concurrency to the desired level. Can be used to set the reserved function concurrency to an exact value, to delete...
Read more >
AWS Common Actions — Cloud Custodian documentation
Finally, specify a list of tag keys to copy from the related resource onto the original resource. The special character “*” can be...
Read more >
Notify On Lambda Errors — Cloud Custodian documentation
The policies filters will check each Lambdas CloudWatch Metrics for errors. If there are any errors in an hour period and the Lambda...
Read more >
Tag Compliance Across Resources (EC2, ASG, ELB, S3, etc)
All EC2 non-AutoScaling instances that do not have the three required tags (CostCenter, Owner, Project) will be stopped hourly after 2 days, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found