Skip to content

Commit

Permalink
Add support for Route53 Health Checks
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Sep 24, 2021
1 parent e6e4863 commit 67f81f8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions aws/policy/networking.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ Statement:
- route53:UpdateHostedZoneComment
- route53:ChangeTagsForResource
- route53:ListTagsForResource
- route53:CreateHealthCheck
- route53:DeleteHealthCheck
- route53:GetHealthCheck
- route53:ListHealthChecks
- route53:UpdateHealthCheck
Resource: "*"

- Sid: AllowRegionalUnrestrictedResourceActionsWhichIncurNoFees
Effect: Allow
Action:
Expand Down Expand Up @@ -89,6 +95,7 @@ Statement:
StringEquals:
ec2:Region:
- '{{ aws_region }}'

- Sid: AllowGlobalResourceRestrictedActionsWhichIncurNoFees
Effect: Allow
Action:
Expand Down
17 changes: 17 additions & 0 deletions aws/terminator/networking.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,23 @@ def terminate(self):
self.client.delete_hosted_zone(Id=self.id)


class Route53HealthCheck(DbTerminator):
@staticmethod
def create(credentials):
return Terminator._create(credentials, Route53HealthCheck, 'route53', lambda client: client.list_health_checks()['HealthChecks'])

@property
def id(self):
return self.instance['Id']

@property
def name(self):
return self.instance['Id']

def terminate(self):
self.client.delete_health_check(HealthCheckId=self.id)


class Ec2Eip(DbTerminator):
@staticmethod
def create(credentials):
Expand Down

0 comments on commit 67f81f8

Please sign in to comment.