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

Add support for new resources #10

Merged
merged 56 commits into from
Nov 3, 2020
Merged
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
6c7cb15
Add support for Athena WorkGroups and NamedQueries (#464)
eschwartz Feb 6, 2020
ae134bc
Upgrade to aws sdk version 1.28.12 (#466)
jami Feb 7, 2020
38b4ff9
added eks fargate profile resource (#469)
jami Feb 10, 2020
4ceae29
added eks nodegroup as resource (#468)
jami Feb 10, 2020
0ba41a1
add route53 health check resource (#471)
matthagenbuch Feb 11, 2020
61ab1ce
Delete all record sets of the type "NS" except for the default "NS" s…
jami Feb 11, 2020
4760e7d
Handle pagination 101+ route53 healthchecks (#472)
Brian-Williams Feb 13, 2020
5d16eb6
add cloudformation stackset support (#475)
tylersouthwick Feb 13, 2020
b06573a
feat: Add OwnerId Prop to EC2TGW (#483)
rwhelan Mar 9, 2020
5b777fb
#430 - cloudformation support for disabling termination protection (#…
jcarter3 Mar 9, 2020
ec7a07a
Disable Security Hub (#484)
gebailey Mar 9, 2020
3367f79
Replace Regex in S3Object sample to recursive nuke (#486)
Mar 9, 2020
4b199d2
only list active stacksets; ignore deleted (#488)
tylersouthwick Mar 19, 2020
8aae595
Additional tag support (#492)
sjpalf Apr 3, 2020
b425267
Feature/324 date filter (#480)
jcarter3 Apr 23, 2020
3f0d5aa
add tag support to additional resource types (#509)
sjpalf May 25, 2020
b61e6d5
fix Route53HealthCheck loop (#510)
svenwltr May 25, 2020
bff333e
Fix presets filter example in README (#514)
reegnz Jun 4, 2020
82c1a84
add firewall manager resources (#491)
tylersouthwick Jun 5, 2020
92d4237
Add quay.io badge and note where to find releases (#519)
der-eismann Jun 11, 2020
63d0495
Generate mocks before building (#499)
der-eismann Jun 19, 2020
236fcbb
add comprehend resources (#531)
tylersouthwick Jul 29, 2020
6cd9695
add cloudformation type support (#530)
tylersouthwick Jul 29, 2020
cedff5e
add support for programatically setting custom aws credentials (#529)
tylersouthwick Jul 29, 2020
ad29ed9
add iam user SSH public key support (#533)
zerbitx Aug 1, 2020
231fcf9
Added support for image builder resources (#535)
wrschneider Aug 10, 2020
dd8b161
added global accelerator resources (#524)
jami Aug 11, 2020
1e5ecf2
Add API Gateway v2 APIs as a resource (#538)
der-eismann Aug 28, 2020
1a7a6a9
Add API Gateway v2 VPC links & properties for some resources (#540)
der-eismann Aug 28, 2020
af924af
Use Go 1.15 & update dependencies (#539)
der-eismann Aug 28, 2020
f8ff7c2
Add wafregional rulegroup & properties for some resources (#541)
der-eismann Aug 28, 2020
46124fa
Add support for CloudWatchLogsResourcePolicy (#521)
oliver-schoenherr Aug 28, 2020
a9538f9
remove anonymous feature flag struct (#527)
tylersouthwick Aug 28, 2020
9f427dd
Add WAFv2 resources (#542)
der-eismann Aug 28, 2020
55a2f25
Add tags for KMS keys (#544)
der-eismann Aug 28, 2020
9555443
Add RDS Event Subscriptions resource (#543)
der-eismann Aug 28, 2020
970888e
Add Path property to IAM roles for filtering (#545)
der-eismann Aug 28, 2020
3fe7ac3
Add AWS Lex resources (#546)
der-eismann Aug 28, 2020
7d12644
Enable paging for KMS Keys (#549)
hligit Sep 3, 2020
bb0ea1d
kms-key: Skip aws managed keys (#550)
hligit Sep 3, 2020
0d7db11
kms-keys: Skip keys already in pending deletion state (#551)
hligit Sep 3, 2020
3ac36c6
Build binaries for Windows & ARM (#548)
der-eismann Sep 7, 2020
033d2ed
Enable CLICOLOR and CLICOLOR_FORCE env variables (#557)
icholy Sep 21, 2020
b898ad2
Adding some more route53 resources (#556)
zerbitx Sep 25, 2020
7930eb0
Add Transfer Server & User resources (#562)
der-eismann Oct 2, 2020
928f315
Add CodeStar Notification Rules resource (#563)
der-eismann Oct 2, 2020
c2bf803
Add support for Egress Only Internet Gateway
Oct 16, 2020
69a8e74
Add support for Kinesis Analytics Application V2
Oct 22, 2020
ecf304e
Add support for WAF rule predicates
Oct 22, 2020
99ce991
Add support for EMR disable termination protection flag
Oct 22, 2020
7654419
Merge branch 'master' of https://github.com/Optum/aws-nuke into featu…
Oct 22, 2020
f7918c2
Update changelog
Oct 22, 2020
06b1645
Update sdk version in changelog
Oct 22, 2020
2e40c0f
Remove comment for emr cluster
Oct 22, 2020
565d05d
Add unit test for egress only internet gateway and emr
Oct 27, 2020
b55635d
Add unit tests for kinesis analytics v2 and waf rule predicate
Oct 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add support for CloudWatchLogsResourcePolicy (rebuy-de#521)
* add support for CloudWatchLogsResourcePolicy

* add Properties()
  • Loading branch information
oliver-schoenherr committed Aug 28, 2020
commit 46124fa582b031f92b5d22c508f97c70d459a3d3
68 changes: 68 additions & 0 deletions resources/cloudwatchlogs-resourcepolicy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package resources

import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
"github.com/rebuy-de/aws-nuke/pkg/types"
)

type CloudWatchLogsResourcePolicy struct {
svc *cloudwatchlogs.CloudWatchLogs
policyName *string
}

func init() {
register("CloudWatchLogsResourcePolicy", ListCloudWatchLogsResourcePolicies)
}

func ListCloudWatchLogsResourcePolicies(sess *session.Session) ([]Resource, error) {
svc := cloudwatchlogs.New(sess)
resources := []Resource{}

params := &cloudwatchlogs.DescribeResourcePoliciesInput{
Limit: aws.Int64(50),
}

for {
output, err := svc.DescribeResourcePolicies(params)
if err != nil {
return nil, err
}

for _, destination := range output.ResourcePolicies {
resources = append(resources, &CloudWatchLogsResourcePolicy{
svc: svc,
policyName: destination.PolicyName,
})
}

if output.NextToken == nil {
break
}

params.NextToken = output.NextToken
}

return resources, nil
}

func (p *CloudWatchLogsResourcePolicy) Remove() error {

_, err := p.svc.DeleteResourcePolicy(&cloudwatchlogs.DeleteResourcePolicyInput{
PolicyName: p.policyName,
})

return err
}

func (p *CloudWatchLogsResourcePolicy) Properties() types.Properties {
properties := types.NewProperties()
properties.Set("Name", p.policyName)

return properties
}

func (p *CloudWatchLogsResourcePolicy) String() string {
return *p.policyName
}