Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip Tags if exist when copy EC2 to EBS #7544

Open
rajee5444 opened this issue Jul 4, 2022 · 1 comment · May be fixed by #7888
Open

Skip Tags if exist when copy EC2 to EBS #7544

rajee5444 opened this issue Jul 4, 2022 · 1 comment · May be fixed by #7888

Comments

@rajee5444
Copy link

rajee5444 commented Jul 4, 2022

Describe the feature

We have a policy to copy Ec2 instance tags to its attached EBSvolumes.
The policy works fine, but I need to skip if tags already exist with the EBS

Ex: EC2 contained
- Technical:ApplicationID
- Technical:Environment
- Technical:PlatformOwner
- Technical:ApplicationName
- Name
if Volume doesnt have any of these tags it will copy from ec2 to ebs (fine)
Let's assume EBS has already
- Technical:ApplicationName
- Name
then I need to keep EBS Name and Technical:ApplicationName tags, only copy missing tags to EBS from EC2.

Is there any workaround we can do to achieve this, I am new to the custodian and could not find any related documentation for this.

Extra information or context

This policy actually replaces the pre-exist tags on EBS.

  • name: ec2-copy-tags-to-ebs
    resource: ebs
    description: |
    Tag EBS with the attached EC2 Tags
    mode:
    type: periodic
    schedule: "rate(1 day)"
    role: *custodian-iam-role (# already defined as Vars)
    filters:
    • type: value
      key: "Attachments[0].Device"
      value: not-null
      actions:
    • type: copy-instance-tags
      tags:
      • Technical:ApplicationID
      • Technical:Environment
      • Technical:PlatformOwner
      • Technical:ApplicationName
      • Name
@rajee5444 rajee5444 changed the title Copy Ec2 Tags to EBS Skip Tags if exist when copy EC2 to EBS Jul 5, 2022
@HappyKid117
Copy link

Hello, I want to work on this enhancement, is it still open?

HappyKid117 pushed a commit to HappyKid117/cloud-custodian that referenced this issue Oct 16, 2022
@HappyKid117 HappyKid117 linked a pull request Oct 16, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants