This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 725
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into jrarmstro-instance-profile-role
- Loading branch information
Showing
80 changed files
with
2,361 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,7 @@ updates: | |
day: "tuesday" | ||
time: "10:00" | ||
timezone: "Europe/Berlin" | ||
groups: | ||
golang: | ||
patterns: | ||
- "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
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/appconfig" | ||
"github.com/rebuy-de/aws-nuke/v2/pkg/types" | ||
) | ||
|
||
type AppConfigApplication struct { | ||
svc *appconfig.AppConfig | ||
id *string | ||
name *string | ||
} | ||
|
||
func init() { | ||
register("AppConfigApplication", ListAppConfigApplications) | ||
} | ||
|
||
func ListAppConfigApplications(sess *session.Session) ([]Resource, error) { | ||
svc := appconfig.New(sess) | ||
resources := []Resource{} | ||
params := &appconfig.ListApplicationsInput{ | ||
MaxResults: aws.Int64(50), | ||
} | ||
err := svc.ListApplicationsPages(params, func(page *appconfig.ListApplicationsOutput, lastPage bool) bool { | ||
for _, item := range page.Items { | ||
resources = append(resources, &AppConfigApplication{ | ||
svc: svc, | ||
id: item.Id, | ||
name: item.Name, | ||
}) | ||
} | ||
return true | ||
}) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return resources, nil | ||
} | ||
|
||
func (f *AppConfigApplication) Remove() error { | ||
_, err := f.svc.DeleteApplication(&appconfig.DeleteApplicationInput{ | ||
ApplicationId: f.id, | ||
}) | ||
return err | ||
} | ||
|
||
func (f *AppConfigApplication) Properties() types.Properties { | ||
return types.NewProperties(). | ||
Set("ID", f.id). | ||
Set("Name", f.name) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
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/appconfig" | ||
"github.com/rebuy-de/aws-nuke/v2/pkg/types" | ||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
type AppConfigConfigurationProfile struct { | ||
svc *appconfig.AppConfig | ||
applicationId *string | ||
id *string | ||
name *string | ||
} | ||
|
||
func init() { | ||
register("AppConfigConfigurationProfile", ListAppConfigConfigurationProfiles) | ||
} | ||
|
||
func ListAppConfigConfigurationProfiles(sess *session.Session) ([]Resource, error) { | ||
svc := appconfig.New(sess) | ||
resources := []Resource{} | ||
applications, err := ListAppConfigApplications(sess) | ||
if err != nil { | ||
return nil, err | ||
} | ||
for _, applicationResource := range applications { | ||
application, ok := applicationResource.(*AppConfigApplication) | ||
if !ok { | ||
logrus.Errorf("Unable to cast AppConfigApplication.") | ||
continue | ||
} | ||
params := &appconfig.ListConfigurationProfilesInput{ | ||
ApplicationId: application.id, | ||
MaxResults: aws.Int64(50), | ||
} | ||
err := svc.ListConfigurationProfilesPages(params, func(page *appconfig.ListConfigurationProfilesOutput, lastPage bool) bool { | ||
for _, item := range page.Items { | ||
resources = append(resources, &AppConfigConfigurationProfile{ | ||
svc: svc, | ||
applicationId: application.id, | ||
id: item.Id, | ||
name: item.Name, | ||
}) | ||
} | ||
return true | ||
}) | ||
if err != nil { | ||
return nil, err | ||
} | ||
} | ||
return resources, nil | ||
} | ||
|
||
func (f *AppConfigConfigurationProfile) Remove() error { | ||
_, err := f.svc.DeleteConfigurationProfile(&appconfig.DeleteConfigurationProfileInput{ | ||
ApplicationId: f.applicationId, | ||
ConfigurationProfileId: f.id, | ||
}) | ||
return err | ||
} | ||
|
||
func (f *AppConfigConfigurationProfile) Properties() types.Properties { | ||
return types.NewProperties(). | ||
Set("ApplicationID", f.applicationId). | ||
Set("ID", f.id). | ||
Set("Name", f.name) | ||
} |
Oops, something went wrong.