Skip to content

Commit

Permalink
chore: add resource to all registrations
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen committed Dec 6, 2024
1 parent 303b7da commit fa765d6
Show file tree
Hide file tree
Showing 504 changed files with 2,256 additions and 1,752 deletions.
7 changes: 4 additions & 3 deletions resources/amplify-app.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ const AmplifyAppResource = "AmplifyApp"

func init() {
registry.Register(&registry.Registration{
Name: AmplifyAppResource,
Scope: nuke.Account,
Lister: &AmplifyAppLister{},
Name: AmplifyAppResource,
Scope: nuke.Account,
Resource: &AmplifyApp{},
Lister: &AmplifyAppLister{},
})
}

Expand Down
1 change: 1 addition & 0 deletions resources/apigateway-api-key.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func init() {
registry.Register(&registry.Registration{
Name: APIGatewayAPIKeyResource,
Scope: nuke.Account,
Resource: &APIGatewayAPIKey{},
Lister: &APIGatewayAPIKeyLister{},
AlternativeResource: "AWS::ApiGateway::ApiKey",
})
Expand Down
1 change: 1 addition & 0 deletions resources/apigateway-clientcertificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func init() {
registry.Register(&registry.Registration{
Name: APIGatewayClientCertificateResource,
Scope: nuke.Account,
Resource: &APIGatewayClientCertificate{},
Lister: &APIGatewayClientCertificateLister{},
AlternativeResource: "AWS::ApiGateway::ClientCertificate",
})
Expand Down
7 changes: 4 additions & 3 deletions resources/apigateway-domainnames.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ const APIGatewayDomainNameResource = "APIGatewayDomainName"

func init() {
registry.Register(&registry.Registration{
Name: APIGatewayDomainNameResource,
Scope: nuke.Account,
Lister: &APIGatewayDomainNameLister{},
Name: APIGatewayDomainNameResource,
Scope: nuke.Account,
Resource: &APIGatewayDomainName{},
Lister: &APIGatewayDomainNameLister{},
})
}

Expand Down
7 changes: 4 additions & 3 deletions resources/apigateway-restapis.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ var deleteRestAPILimit = ratelimit.New(1, ratelimit.Per(32*time.Second))

func init() {
registry.Register(&registry.Registration{
Name: APIGatewayRestAPIResource,
Scope: nuke.Account,
Lister: &APIGatewayRestAPILister{},
Name: APIGatewayRestAPIResource,
Scope: nuke.Account,
Resource: &APIGatewayRestAPI{},
Lister: &APIGatewayRestAPILister{},
})
}

Expand Down
1 change: 1 addition & 0 deletions resources/apigateway-usage-plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func init() {
registry.Register(&registry.Registration{
Name: APIGatewayUsagePlanResource,
Scope: nuke.Account,
Resource: &APIGatewayUsagePlan{},
Lister: &APIGatewayUsagePlanLister{},
AlternativeResource: "AWS::ApiGateway::UsagePlan",
})
Expand Down
7 changes: 4 additions & 3 deletions resources/apigateway-vpclinks.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ const APIGatewayVpcLinkResource = "APIGatewayVpcLink"

func init() {
registry.Register(&registry.Registration{
Name: APIGatewayVpcLinkResource,
Scope: nuke.Account,
Lister: &APIGatewayVpcLinkLister{},
Name: APIGatewayVpcLinkResource,
Scope: nuke.Account,
Resource: &APIGatewayVpcLink{},
Lister: &APIGatewayVpcLinkLister{},
})
}

Expand Down
7 changes: 4 additions & 3 deletions resources/apigatewayv2-apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ const APIGatewayV2APIResource = "APIGatewayV2API"

func init() {
registry.Register(&registry.Registration{
Name: APIGatewayV2APIResource,
Scope: nuke.Account,
Lister: &APIGatewayV2APILister{},
Name: APIGatewayV2APIResource,
Scope: nuke.Account,
Resource: &APIGatewayV2API{},
Lister: &APIGatewayV2APILister{},
})
}

Expand Down
7 changes: 4 additions & 3 deletions resources/apigatewayv2-vpc-links.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ const APIGatewayV2VpcLinkResource = "APIGatewayV2VpcLink"

func init() {
registry.Register(&registry.Registration{
Name: APIGatewayV2VpcLinkResource,
Scope: nuke.Account,
Lister: &APIGatewayV2VpcLinkLister{},
Name: APIGatewayV2VpcLinkResource,
Scope: nuke.Account,
Resource: &APIGatewayV2VpcLink{},
Lister: &APIGatewayV2VpcLinkLister{},
})
}

Expand Down
19 changes: 10 additions & 9 deletions resources/appconfig-applications.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,14 @@ import (
"github.com/ekristen/aws-nuke/v3/pkg/nuke"
)

type AppConfigApplication struct {
svc *appconfig.AppConfig
id *string
name *string
}

const AppConfigApplicationResource = "AppConfigApplication"

func init() {
registry.Register(&registry.Registration{
Name: AppConfigApplicationResource,
Scope: nuke.Account,
Lister: &AppConfigApplicationLister{},
Name: AppConfigApplicationResource,
Scope: nuke.Account,
Resource: &AppConfigApplication{},
Lister: &AppConfigApplicationLister{},
DependsOn: []string{
AppConfigConfigurationProfileResource,
AppConfigEnvironmentResource,
Expand Down Expand Up @@ -59,6 +54,12 @@ func (l *AppConfigApplicationLister) List(_ context.Context, o interface{}) ([]r
return resources, nil
}

type AppConfigApplication struct {
svc *appconfig.AppConfig
id *string
name *string
}

func (f *AppConfigApplication) Remove(_ context.Context) error {
_, err := f.svc.DeleteApplication(&appconfig.DeleteApplicationInput{
ApplicationId: f.id,
Expand Down
21 changes: 11 additions & 10 deletions resources/appconfig-configurationprofiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,14 @@ import (
"github.com/ekristen/aws-nuke/v3/pkg/nuke"
)

type AppConfigConfigurationProfile struct {
svc *appconfig.AppConfig
applicationID *string
id *string
name *string
}

const AppConfigConfigurationProfileResource = "AppConfigConfigurationProfile"

func init() {
registry.Register(&registry.Registration{
Name: AppConfigConfigurationProfileResource,
Scope: nuke.Account,
Lister: &AppConfigConfigurationProfileLister{},
Name: AppConfigConfigurationProfileResource,
Scope: nuke.Account,
Resource: &AppConfigConfigurationProfile{},
Lister: &AppConfigConfigurationProfileLister{},
DependsOn: []string{
AppConfigHostedConfigurationVersionResource,
},
Expand Down Expand Up @@ -77,6 +71,13 @@ func (l *AppConfigConfigurationProfileLister) List(ctx context.Context, o interf
return resources, nil
}

type AppConfigConfigurationProfile struct {
svc *appconfig.AppConfig
applicationID *string
id *string
name *string
}

func (f *AppConfigConfigurationProfile) Remove(_ context.Context) error {
_, err := f.svc.DeleteConfigurationProfile(&appconfig.DeleteConfigurationProfileInput{
ApplicationId: f.applicationID,
Expand Down
19 changes: 10 additions & 9 deletions resources/appconfig-deploymentstrategies.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,14 @@ import (
"github.com/ekristen/aws-nuke/v3/pkg/nuke"
)

type AppConfigDeploymentStrategy struct {
svc *appconfig.AppConfig
id *string
name *string
}

const AppConfigDeploymentStrategyResource = "AppConfigDeploymentStrategy"

func init() {
registry.Register(&registry.Registration{
Name: AppConfigDeploymentStrategyResource,
Scope: nuke.Account,
Lister: &AppConfigDeploymentStrategyLister{},
Name: AppConfigDeploymentStrategyResource,
Scope: nuke.Account,
Resource: &AppConfigDeploymentStrategy{},
Lister: &AppConfigDeploymentStrategyLister{},
})
}

Expand Down Expand Up @@ -57,6 +52,12 @@ func (l *AppConfigDeploymentStrategyLister) List(_ context.Context, o interface{
return resources, nil
}

type AppConfigDeploymentStrategy struct {
svc *appconfig.AppConfig
id *string
name *string
}

func (f *AppConfigDeploymentStrategy) Filter() error {
if strings.HasPrefix(*f.name, "AppConfig.") {
return fmt.Errorf("cannot delete predefined Deployment Strategy")
Expand Down
21 changes: 11 additions & 10 deletions resources/appconfig-environments.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,14 @@ import (
"github.com/ekristen/aws-nuke/v3/pkg/nuke"
)

type AppConfigEnvironment struct {
svc *appconfig.AppConfig
applicationID *string
id *string
name *string
}

const AppConfigEnvironmentResource = "AppConfigEnvironment"

func init() {
registry.Register(&registry.Registration{
Name: AppConfigEnvironmentResource,
Scope: nuke.Account,
Lister: &AppConfigEnvironmentLister{},
Name: AppConfigEnvironmentResource,
Scope: nuke.Account,
Resource: &AppConfigEnvironment{},
Lister: &AppConfigEnvironmentLister{},
})
}

Expand Down Expand Up @@ -73,6 +67,13 @@ func (l *AppConfigEnvironmentLister) List(ctx context.Context, o interface{}) ([
return resources, nil
}

type AppConfigEnvironment struct {
svc *appconfig.AppConfig
applicationID *string
id *string
name *string
}

func (f *AppConfigEnvironment) Remove(_ context.Context) error {
_, err := f.svc.DeleteEnvironment(&appconfig.DeleteEnvironmentInput{
ApplicationId: f.applicationID,
Expand Down
21 changes: 11 additions & 10 deletions resources/appconfig-hostedconfigurationversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,14 @@ import (
"github.com/ekristen/aws-nuke/v3/pkg/nuke"
)

type AppConfigHostedConfigurationVersion struct {
svc *appconfig.AppConfig
applicationID *string
configurationProfileID *string
versionNumber *int64
}

const AppConfigHostedConfigurationVersionResource = "AppConfigHostedConfigurationVersion"

func init() {
registry.Register(&registry.Registration{
Name: AppConfigHostedConfigurationVersionResource,
Scope: nuke.Account,
Lister: &AppConfigHostedConfigurationVersionLister{},
Name: AppConfigHostedConfigurationVersionResource,
Scope: nuke.Account,
Resource: &AppConfigHostedConfigurationVersion{},
Lister: &AppConfigHostedConfigurationVersionLister{},
})
}

Expand Down Expand Up @@ -74,6 +68,13 @@ func (l *AppConfigHostedConfigurationVersionLister) List(ctx context.Context, o
return resources, nil
}

type AppConfigHostedConfigurationVersion struct {
svc *appconfig.AppConfig
applicationID *string
configurationProfileID *string
versionNumber *int64
}

func (f *AppConfigHostedConfigurationVersion) Remove(_ context.Context) error {
_, err := f.svc.DeleteHostedConfigurationVersion(&appconfig.DeleteHostedConfigurationVersionInput{
ApplicationId: f.applicationID,
Expand Down
7 changes: 4 additions & 3 deletions resources/applicationautoscaling-scalable-targets.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ const ApplicationAutoScalingScalableTargetResource = "ApplicationAutoScalingScal

func init() {
registry.Register(&registry.Registration{
Name: ApplicationAutoScalingScalableTargetResource,
Scope: nuke.Account,
Lister: &ApplicationAutoScalingScalableTargetLister{},
Name: ApplicationAutoScalingScalableTargetResource,
Scope: nuke.Account,
Resource: &AppAutoScaling{},
Lister: &ApplicationAutoScalingScalableTargetLister{},
})
}

Expand Down
7 changes: 4 additions & 3 deletions resources/appmesh-gatewayroute.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ const AppMeshGatewayRouteResource = "AppMeshGatewayRoute"

func init() {
registry.Register(&registry.Registration{
Name: AppMeshGatewayRouteResource,
Scope: nuke.Account,
Lister: &AppMeshGatewayRouteLister{},
Name: AppMeshGatewayRouteResource,
Scope: nuke.Account,
Resource: &AppMeshGatewayRoute{},
Lister: &AppMeshGatewayRouteLister{},
})
}

Expand Down
7 changes: 4 additions & 3 deletions resources/appmesh-mesh.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ const AppMeshMeshResource = "AppMeshMesh"

func init() {
registry.Register(&registry.Registration{
Name: AppMeshMeshResource,
Scope: nuke.Account,
Lister: &AppMeshMeshLister{},
Name: AppMeshMeshResource,
Scope: nuke.Account,
Resource: &AppMeshMesh{},
Lister: &AppMeshMeshLister{},
})
}

Expand Down
7 changes: 4 additions & 3 deletions resources/appmesh-route.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ const AppMeshRouteResource = "AppMeshRoute"

func init() {
registry.Register(&registry.Registration{
Name: AppMeshRouteResource,
Scope: nuke.Account,
Lister: &AppMeshRouteLister{},
Name: AppMeshRouteResource,
Scope: nuke.Account,
Resource: &AppMeshRoute{},
Lister: &AppMeshRouteLister{},
})
}

Expand Down
7 changes: 4 additions & 3 deletions resources/appmesh-virtualgateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ const AppMeshVirtualGatewayResource = "AppMeshVirtualGateway"

func init() {
registry.Register(&registry.Registration{
Name: AppMeshVirtualGatewayResource,
Scope: nuke.Account,
Lister: &AppMeshVirtualGatewayLister{},
Name: AppMeshVirtualGatewayResource,
Scope: nuke.Account,
Resource: &AppMeshVirtualGateway{},
Lister: &AppMeshVirtualGatewayLister{},
})
}

Expand Down
7 changes: 4 additions & 3 deletions resources/appmesh-virtualnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ const AppMeshVirtualNodeResource = "AppMeshVirtualNode"

func init() {
registry.Register(&registry.Registration{
Name: AppMeshVirtualNodeResource,
Scope: nuke.Account,
Lister: &AppMeshVirtualNodeLister{},
Name: AppMeshVirtualNodeResource,
Scope: nuke.Account,
Resource: &AppMeshVirtualNode{},
Lister: &AppMeshVirtualNodeLister{},
})
}

Expand Down
Loading

0 comments on commit fa765d6

Please sign in to comment.