Git Product home page Git Product logo

aws-route53-purge-dead-records's Introduction

aws-route53-purge-dead-records

Purge AWS R53 dead records for a known node name pattern using Ansible

ansible-playbook -i <dynamic-inventory-of-all-ec2s> aws_r53_purge_dead_records.yml -e "aws_profile=<aws-local-profile>"

!! BEWARE !! Please review the code and make sure you know what is going on .. I tried to keep it simple, but the scope of how/where this works is limited: Here are some known things to keep an eye out for:

  • the Ansible inventory needs to contain ALL running EC2s
    • dynamic inventory makes the most sense
  • That way you can compare what is in R53 against what is known and current and running
  • Uses AWS profile to talk to AWS API
  • There are many pauses along the way to make sure you can stop whenever you want
  • in the purge.yml file, there is a "filter" you can apply to make sure you are only going to validate a predictable node name pattern
  - set_fact:
      asg_records: "{{ asg_records + [ item.Name | regex_replace ('\\.$', '') ] }}"
    when: |
      item.Type == "A" and
      item.Name | search("asg-")
    with_items: "{{ r53_records.ResourceRecordSets }}"

aws-route53-purge-dead-records's People

Contributors

gkspranger avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.