Repository: gruntwork-io/cloud-nuke
Pull request #635 (2024-01-25 02:14:05)

Add nukable check + nukable check implementation for transit gateway
<!-- Prepend '[WIP]' to the title if this PR is still a work-in-progress. Remove it when it is ready for review! -->

## Description

Fixes [#000.](https://github.com/gruntwork-io/cloud-nuke/issues/478).

<!-- Description of the changes introduced by this PR. -->

## TODOs

Read the [Gruntwork contribution guidelines](https://gruntwork.notion.site/Gruntwork-Coding-Methodology-02fdcd6e4b004e818553684760bf691e).

- [ ] Update the docs.
- [ ] Run the relevant tests successfully, including pre-commit checks.
- [ ] Ensure any 3rd party code adheres with our [license policy](https://www.notion.so/gruntwork/Gruntwork-licenses-and-open-source-usage-policy-f7dece1f780341c7b69c1763f22b1378) or delete this line if its not applicable.
- [ ] Include release notes. If this PR is backward incompatible, include a migration guide.
- [ ] Attention Grunts - if this PR adds support for a new resource, ensure the `nuke_sandbox` and `nuke_phxdevops` jobs in `.circleci/config.yml` have been updated with appropriate exclusions (either directly in the job or via the `.circleci/nuke_config.yml` file) to prevent nuking IAM roles, groups, resources, etc that are important for the test accounts.


## Release Notes (draft)

<!-- One-line description of the PR that can be included in the final release notes. -->
Added / Removed / Updated [X].

### Migration Guide

<!-- Important: If you made any backward incompatible changes, then you must write a migration guide! -->




Patch:
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 9c334d0..63a8e31 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1,5 +1,5 @@
 orbs:
-  go: circleci/go@1.7.3
+  go: circleci/go@1.11.0
 
 # The "sign binary" runs in a MacOS environment, so it's necessary to download GW's binaries
 env: &env
diff --git a/aws/aws.go b/aws/aws.go
index f53e930..44209b6 100644
--- a/aws/aws.go
+++ b/aws/aws.go
@@ -3,12 +3,13 @@ package aws
 import (
 	"context"
 	"fmt"
-	"github.com/gruntwork-io/cloud-nuke/util"
-	"github.com/pterm/pterm"
 	"sort"
 	"strings"
 	"time"
 
+	"github.com/gruntwork-io/cloud-nuke/util"
+	"github.com/pterm/pterm"
+
 	commonTelemetry "github.com/gruntwork-io/go-commons/telemetry"
 
 	"github.com/gruntwork-io/cloud-nuke/config"
diff --git a/aws/resource.go b/aws/resource.go
index 51203e6..3d3a9cd 100644
--- a/aws/resource.go
+++ b/aws/resource.go
@@ -2,9 +2,10 @@ package aws
 
 import (
 	"context"
+	"strings"
+
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/gruntwork-io/cloud-nuke/config"
-	"strings"
 )
 
 // AwsResource is an interface that represents a single AWS resource
@@ -15,6 +16,7 @@ type AwsResource interface {
 	MaxBatchSize() int
 	Nuke(identifiers []string) error
 	GetAndSetIdentifiers(c context.Context, configObj config.Config) ([]string, error)
+	IsNukable(string) (bool, error)
 }
 
 // AwsResources is a struct to hold multiple instances of AwsResource.
diff --git a/aws/resources/access_analyzer_types.go b/aws/resources/access_analyzer_types.go
index d27fd68..e879fc3 100644
--- a/aws/resources/access_analyzer_types.go
+++ b/aws/resources/access_analyzer_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/accessanalyzer"
@@ -12,6 +13,7 @@ import (
 
 // AccessAnalyzer - represents all AWS secrets manager secrets that should be deleted.
 type AccessAnalyzer struct {
+	BaseAwsResource
 	Client        accessanalyzeriface.AccessAnalyzerAPI
 	Region        string
 	AnalyzerNames []string
diff --git a/aws/resources/acm_types.go b/aws/resources/acm_types.go
index dd34443..1fbb8ac 100644
--- a/aws/resources/acm_types.go
+++ b/aws/resources/acm_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/acm"
@@ -12,6 +13,7 @@ import (
 
 // ACMPA - represents all ACMPA
 type ACM struct {
+	BaseAwsResource
 	Client acmiface.ACMAPI
 	Region string
 	ARNs   []string
diff --git a/aws/resources/acmpca_types.go b/aws/resources/acmpca_types.go
index 84d1b6c..46837e0 100644
--- a/aws/resources/acmpca_types.go
+++ b/aws/resources/acmpca_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/acmpca"
@@ -12,6 +13,7 @@ import (
 
 // ACMPA - represents all ACMPA
 type ACMPCA struct {
+	BaseAwsResource
 	Client acmpcaiface.ACMPCAAPI
 	Region string
 	ARNs   []string
diff --git a/aws/resources/ami_types.go b/aws/resources/ami_types.go
index b91f0cd..d5b7b64 100644
--- a/aws/resources/ami_types.go
+++ b/aws/resources/ami_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/ec2"
@@ -12,6 +13,7 @@ import (
 
 // AMIs - represents all user owned AMIs
 type AMIs struct {
+	BaseAwsResource
 	Client   ec2iface.EC2API
 	Region   string
 	ImageIds []string
diff --git a/aws/resources/apigateway_types.go b/aws/resources/apigateway_types.go
index dd58b08..4675099 100644
--- a/aws/resources/apigateway_types.go
+++ b/aws/resources/apigateway_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/apigateway"
@@ -11,6 +12,7 @@ import (
 )
 
 type ApiGateway struct {
+	BaseAwsResource
 	Client apigatewayiface.APIGatewayAPI
 	Region string
 	Ids    []string
diff --git a/aws/resources/apigatewayv2_types.go b/aws/resources/apigatewayv2_types.go
index ceff89c..57d8daa 100644
--- a/aws/resources/apigatewayv2_types.go
+++ b/aws/resources/apigatewayv2_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/apigatewayv2"
@@ -11,6 +12,7 @@ import (
 )
 
 type ApiGatewayV2 struct {
+	BaseAwsResource
 	Client apigatewayv2iface.ApiGatewayV2API
 	Region string
 	Ids    []string
diff --git a/aws/resources/asg_types.go b/aws/resources/asg_types.go
index 9fbdedf..8a58e41 100644
--- a/aws/resources/asg_types.go
+++ b/aws/resources/asg_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/autoscaling"
@@ -12,6 +13,7 @@ import (
 
 // ASGroups - represents all auto scaling groups
 type ASGroups struct {
+	BaseAwsResource
 	Client     autoscalingiface.AutoScalingAPI
 	Region     string
 	GroupNames []string
diff --git a/aws/resources/backup_vault_types.go b/aws/resources/backup_vault_types.go
index 8290208..36d4d7f 100644
--- a/aws/resources/backup_vault_types.go
+++ b/aws/resources/backup_vault_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/backup"
@@ -11,6 +12,7 @@ import (
 )
 
 type BackupVault struct {
+	BaseAwsResource
 	Client backupiface.BackupAPI
 	Region string
 	Names  []string
diff --git a/aws/resources/base_resource.go b/aws/resources/base_resource.go
new file mode 100644
index 0000000..5c71408
--- /dev/null
+++ b/aws/resources/base_resource.go
@@ -0,0 +1,35 @@
+package resources
+
+import (
+	"context"
+	"errors"
+
+	"github.com/aws/aws-sdk-go/aws/session"
+	"github.com/gruntwork-io/cloud-nuke/config"
+)
+
+// BaseAwsResource This BaseAwsResource struct and its associated methods to serve as a placeholder or template for a resource
+// that is not yet fully implemented within a system or framework.
+// Its purpose is to provide a skeleton structure that adheres to a specific interface or contract expected by the
+// system without containing the actual implementation details.
+type BaseAwsResource struct{}
+
+func (umpl *BaseAwsResource) Init(_ *session.Session) {}
+func (umpl *BaseAwsResource) ResourceName() string {
+	return "not implemented: ResourceName"
+}
+func (umpl *BaseAwsResource) ResourceIdentifiers() []string {
+	return nil
+}
+func (umpl *BaseAwsResource) MaxBatchSize() int {
+	return 0
+}
+func (umpl *BaseAwsResource) Nuke(_ []string) error {
+	return errors.New("not implemented: Nuke")
+}
+func (umpl *BaseAwsResource) GetAndSetIdentifiers(_ context.Context, _ config.Config) ([]string, error) {
+	return nil, errors.New("not implemented: GetAndSetIdentifiers")
+}
+func (umpl *BaseAwsResource) IsNukable(_ string) (bool, error) {
+	return false, errors.New("not implemented yet.")
+}
diff --git a/aws/resources/cloudtrail_types.go b/aws/resources/cloudtrail_types.go
index 4c49ce3..df5ea24 100644
--- a/aws/resources/cloudtrail_types.go
+++ b/aws/resources/cloudtrail_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/cloudtrail"
@@ -12,6 +13,7 @@ import (
 
 // CloudWatchLogGroup - represents all ec2 instances
 type CloudtrailTrail struct {
+	BaseAwsResource
 	Client cloudtrailiface.CloudTrailAPI
 	Region string
 	Arns   []string
diff --git a/aws/resources/cloudwatch_alarm_types.go b/aws/resources/cloudwatch_alarm_types.go
index 321ac22..e5e5768 100644
--- a/aws/resources/cloudwatch_alarm_types.go
+++ b/aws/resources/cloudwatch_alarm_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/cloudwatch"
@@ -12,6 +13,7 @@ import (
 
 // CloudWatchAlarms - represents all CloudWatchAlarms that should be deleted.
 type CloudWatchAlarms struct {
+	BaseAwsResource
 	Client     cloudwatchiface.CloudWatchAPI
 	Region     string
 	AlarmNames []string
diff --git a/aws/resources/cloudwatch_dashboard_types.go b/aws/resources/cloudwatch_dashboard_types.go
index 9b43119..a8ff6b3 100644
--- a/aws/resources/cloudwatch_dashboard_types.go
+++ b/aws/resources/cloudwatch_dashboard_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/cloudwatch"
@@ -12,6 +13,7 @@ import (
 
 // CloudWatchDashboards - represents all CloudWatch Dashboards that should be deleted.
 type CloudWatchDashboards struct {
+	BaseAwsResource
 	Client         cloudwatchiface.CloudWatchAPI
 	Region         string
 	DashboardNames []string
diff --git a/aws/resources/cloudwatch_loggroup_types.go b/aws/resources/cloudwatch_loggroup_types.go
index e501b4a..9112b65 100644
--- a/aws/resources/cloudwatch_loggroup_types.go
+++ b/aws/resources/cloudwatch_loggroup_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
@@ -12,6 +13,7 @@ import (
 
 // CloudWatchLogGroup - represents all ec2 instances
 type CloudWatchLogGroups struct {
+	BaseAwsResource
 	Client cloudwatchlogsiface.CloudWatchLogsAPI
 	Region string
 	Names  []string
diff --git a/aws/resources/codedeploy_application_types.go b/aws/resources/codedeploy_application_types.go
index 42ee145..19d5d46 100644
--- a/aws/resources/codedeploy_application_types.go
+++ b/aws/resources/codedeploy_application_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/codedeploy"
@@ -12,6 +13,7 @@ import (
 
 // CodeDeployApplications - represents all codedeploy applications
 type CodeDeployApplications struct {
+	BaseAwsResource
 	Client   codedeployiface.CodeDeployAPI
 	Region   string
 	AppNames []string
diff --git a/aws/resources/config_recorder_types.go b/aws/resources/config_recorder_types.go
index 9d5207f..d955eba 100644
--- a/aws/resources/config_recorder_types.go
+++ b/aws/resources/config_recorder_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/configservice"
@@ -11,6 +12,7 @@ import (
 )
 
 type ConfigServiceRecorders struct {
+	BaseAwsResource
 	Client        configserviceiface.ConfigServiceAPI
 	Region        string
 	RecorderNames []string
diff --git a/aws/resources/config_service_types.go b/aws/resources/config_service_types.go
index 7396a51..e42ef8a 100644
--- a/aws/resources/config_service_types.go
+++ b/aws/resources/config_service_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/configservice"
@@ -11,6 +12,7 @@ import (
 )
 
 type ConfigServiceRule struct {
+	BaseAwsResource
 	Client    configserviceiface.ConfigServiceAPI
 	Region    string
 	RuleNames []string
diff --git a/aws/resources/dynamodb_types.go b/aws/resources/dynamodb_types.go
index 98fc401..11e6692 100644
--- a/aws/resources/dynamodb_types.go
+++ b/aws/resources/dynamodb_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/dynamodb"
@@ -11,6 +12,7 @@ import (
 )
 
 type DynamoDB struct {
+	BaseAwsResource
 	Client           dynamodbiface.DynamoDBAPI
 	Region           string
 	DynamoTableNames []string
diff --git a/aws/resources/ebs_types.go b/aws/resources/ebs_types.go
index dcaebf8..82df5f2 100644
--- a/aws/resources/ebs_types.go
+++ b/aws/resources/ebs_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/ec2"
@@ -12,6 +13,7 @@ import (
 
 // EBSVolumes - represents all ebs volumes
 type EBSVolumes struct {
+	BaseAwsResource
 	Client    ec2iface.EC2API
 	Region    string
 	VolumeIds []string
diff --git a/aws/resources/ec2_dedicated_host_types.go b/aws/resources/ec2_dedicated_host_types.go
index 67b0921..13a3ea8 100644
--- a/aws/resources/ec2_dedicated_host_types.go
+++ b/aws/resources/ec2_dedicated_host_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/ec2"
@@ -12,6 +13,7 @@ import (
 
 // EC2DedicatedHosts - represents all host allocation IDs
 type EC2DedicatedHosts struct {
+	BaseAwsResource
 	Client  ec2iface.EC2API
 	Region  string
 	HostIds []string
diff --git a/aws/resources/ec2_dhcp_option_types.go b/aws/resources/ec2_dhcp_option_types.go
index 551722d..6ea7b86 100644
--- a/aws/resources/ec2_dhcp_option_types.go
+++ b/aws/resources/ec2_dhcp_option_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/ec2"
@@ -11,6 +12,7 @@ import (
 )
 
 type EC2DhcpOption struct {
+	BaseAwsResource
 	Client ec2iface.EC2API
 	Region string
 	VPCIds []string
diff --git a/aws/resources/ec2_ipam_byoasn_types.go b/aws/resources/ec2_ipam_byoasn_types.go
index 925734a..fcad343 100644
--- a/aws/resources/ec2_ipam_byoasn_types.go
+++ b/aws/resources/ec2_ipam_byoasn_types.go
@@ -13,6 +13,7 @@ import (
 
 // IPAM Byoasn- represents all IPAMs
 type EC2IPAMByoasn struct {
+	BaseAwsResource
 	Client ec2iface.EC2API
 	Region string
 	Pools  []string
diff --git a/aws/resources/ec2_ipam_custom_allocation_types.go b/aws/resources/ec2_ipam_custom_allocation_types.go
index 809c287..e19f2a0 100644
--- a/aws/resources/ec2_ipam_custom_allocation_types.go
+++ b/aws/resources/ec2_ipam_custom_allocation_types.go
@@ -13,6 +13,7 @@ import (
 
 // IPAM Byoasn- represents all IPAMs
 type EC2IPAMCustomAllocation struct {
+	BaseAwsResource
 	Client               ec2iface.EC2API
 	Region               string
 	Allocations          []string
diff --git a/aws/resources/ec2_ipam_pool_types.go b/aws/resources/ec2_ipam_pool_types.go
index 6c2c54f..cbcd262 100644
--- a/aws/resources/ec2_ipam_pool_types.go
+++ b/aws/resources/ec2_ipam_pool_types.go
@@ -13,6 +13,7 @@ import (
 
 // IPAM Pool- represents all IPAMs
 type EC2IPAMPool struct {
+	BaseAwsResource
 	Client ec2iface.EC2API
 	Region string
 	Pools  []string
diff --git a/aws/resources/ec2_ipam_resource_discovery_types.go b/aws/resources/ec2_ipam_resource_discovery_types.go
index d7eb396..4d5ee3d 100644
--- a/aws/resources/ec2_ipam_resource_discovery_types.go
+++ b/aws/resources/ec2_ipam_resource_discovery_types.go
@@ -13,6 +13,7 @@ import (
 
 // IPAM - represents all IPAMs
 type EC2IPAMResourceDiscovery struct {
+	BaseAwsResource
 	Client       ec2iface.EC2API
 	Region       string
 	DiscoveryIDs []string
diff --git a/aws/resources/ec2_ipam_scope_types.go b/aws/resources/ec2_ipam_scope_types.go
index 112d73d..c41acaa 100644
--- a/aws/resources/ec2_ipam_scope_types.go
+++ b/aws/resources/ec2_ipam_scope_types.go
@@ -13,6 +13,7 @@ import (
 
 // scope - represents all scopes
 type EC2IpamScopes struct {
+	BaseAwsResource
 	Client    ec2iface.EC2API
 	Region    string
 	ScopreIDs []string
diff --git a/aws/resources/ec2_ipam_types.go b/aws/resources/ec2_ipam_types.go
index 61625ea..8ac6994 100644
--- a/aws/resources/ec2_ipam_types.go
+++ b/aws/resources/ec2_ipam_types.go
@@ -13,6 +13,7 @@ import (
 
 // IPAM - represents all IPAMs
 type EC2IPAMs struct {
+	BaseAwsResource
 	Client ec2iface.EC2API
 	Region string
 	IDs    []string
diff --git a/aws/resources/ec2_key_pair_types.go b/aws/resources/ec2_key_pair_types.go
index 7623ec0..21bb684 100644
--- a/aws/resources/ec2_key_pair_types.go
+++ b/aws/resources/ec2_key_pair_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/ec2"
@@ -11,6 +12,7 @@ import (
 )
 
 type EC2KeyPairs struct {
+	BaseAwsResource
 	Client     ec2iface.EC2API
 	Region     string
 	KeyPairIds []string
diff --git a/aws/resources/ec2_types.go b/aws/resources/ec2_types.go
index 94609a7..ef264a0 100644
--- a/aws/resources/ec2_types.go
+++ b/aws/resources/ec2_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/ec2"
@@ -12,6 +13,7 @@ import (
 
 // EC2Instances - represents all ec2 instances
 type EC2Instances struct {
+	BaseAwsResource
 	Client      ec2iface.EC2API
 	Region      string
 	InstanceIds []string
diff --git a/aws/resources/ec2_vpc_types.go b/aws/resources/ec2_vpc_types.go
index e22dd41..4f3105e 100644
--- a/aws/resources/ec2_vpc_types.go
+++ b/aws/resources/ec2_vpc_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/ec2"
@@ -11,6 +12,7 @@ import (
 )
 
 type EC2VPCs struct {
+	BaseAwsResource
 	Client ec2iface.EC2API
 	Region string
 	VPCIds []string
diff --git a/aws/resources/ecr_types.go b/aws/resources/ecr_types.go
index e4c7cf8..3f44616 100644
--- a/aws/resources/ecr_types.go
+++ b/aws/resources/ecr_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/ecr"
@@ -11,6 +12,7 @@ import (
 )
 
 type ECR struct {
+	BaseAwsResource
 	Client          ecriface.ECRAPI
 	Region          string
 	RepositoryNames []string
diff --git a/aws/resources/ecs_cluster_types.go b/aws/resources/ecs_cluster_types.go
index bb66786..32a81b0 100644
--- a/aws/resources/ecs_cluster_types.go
+++ b/aws/resources/ecs_cluster_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/ecs"
@@ -19,6 +20,7 @@ const maxBatchSize = 49
 
 // ECSClusters - Represents all ECS clusters found in a region
 type ECSClusters struct {
+	BaseAwsResource
 	Client      ecsiface.ECSAPI
 	Region      string
 	ClusterArns []string
diff --git a/aws/resources/ecs_service_types.go b/aws/resources/ecs_service_types.go
index 759e938..11d6b30 100644
--- a/aws/resources/ecs_service_types.go
+++ b/aws/resources/ecs_service_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/ecs"
@@ -12,6 +13,7 @@ import (
 
 // ECSServices - Represents all ECS services found in a region
 type ECSServices struct {
+	BaseAwsResource
 	Client            ecsiface.ECSAPI
 	Region            string
 	Services          []string
diff --git a/aws/resources/efs_types.go b/aws/resources/efs_types.go
index 2044f71..eadae5e 100644
--- a/aws/resources/efs_types.go
+++ b/aws/resources/efs_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/efs"
@@ -11,6 +12,7 @@ import (
 )
 
 type ElasticFileSystem struct {
+	BaseAwsResource
 	Client efsiface.EFSAPI
 	Region string
 	Ids    []string
diff --git a/aws/resources/eip_types.go b/aws/resources/eip_types.go
index 3cce1e0..8df303d 100644
--- a/aws/resources/eip_types.go
+++ b/aws/resources/eip_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/ec2"
@@ -12,6 +13,7 @@ import (
 
 // EBSVolumes - represents all ebs volumes
 type EIPAddresses struct {
+	BaseAwsResource
 	Client        ec2iface.EC2API
 	Region        string
 	AllocationIds []string
diff --git a/aws/resources/eks_types.go b/aws/resources/eks_types.go
index e0e924e..f0799c2 100644
--- a/aws/resources/eks_types.go
+++ b/aws/resources/eks_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/eks"
@@ -12,6 +13,7 @@ import (
 
 // EKSClusters - Represents all EKS clusters found in a region
 type EKSClusters struct {
+	BaseAwsResource
 	Client   eksiface.EKSAPI
 	Region   string
 	Clusters []string
diff --git a/aws/resources/elasticache_types.go b/aws/resources/elasticache_types.go
index 6d5b0a2..6859e07 100644
--- a/aws/resources/elasticache_types.go
+++ b/aws/resources/elasticache_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/elasticache"
@@ -12,6 +13,7 @@ import (
 
 // Elasticaches - represents all Elasticache clusters
 type Elasticaches struct {
+	BaseAwsResource
 	Client     elasticacheiface.ElastiCacheAPI
 	Region     string
 	ClusterIds []string
@@ -60,6 +62,7 @@ Elasticache Parameter Groups
 */
 
 type ElasticacheParameterGroups struct {
+	BaseAwsResource
 	Client     elasticacheiface.ElastiCacheAPI
 	Region     string
 	GroupNames []string
@@ -108,6 +111,7 @@ Elasticache Subnet Groups
 */
 
 type ElasticacheSubnetGroups struct {
+	BaseAwsResource
 	Client     elasticacheiface.ElastiCacheAPI
 	Region     string
 	GroupNames []string
diff --git a/aws/resources/elb_types.go b/aws/resources/elb_types.go
index 3bc4b1f..d1f371d 100644
--- a/aws/resources/elb_types.go
+++ b/aws/resources/elb_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/elb"
@@ -12,6 +13,7 @@ import (
 
 // LoadBalancers - represents all load balancers
 type LoadBalancers struct {
+	BaseAwsResource
 	Client elbiface.ELBAPI
 	Region string
 	Names  []string
diff --git a/aws/resources/elbv2_types.go b/aws/resources/elbv2_types.go
index d19e628..bb056e3 100644
--- a/aws/resources/elbv2_types.go
+++ b/aws/resources/elbv2_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/elbv2"
@@ -12,6 +13,7 @@ import (
 
 // LoadBalancersV2 - represents all load balancers
 type LoadBalancersV2 struct {
+	BaseAwsResource
 	Client elbv2iface.ELBV2API
 	Region string
 	Arns   []string
diff --git a/aws/resources/guardduty_types.go b/aws/resources/guardduty_types.go
index 0b2eed2..2a3235d 100644
--- a/aws/resources/guardduty_types.go
+++ b/aws/resources/guardduty_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/guardduty"
@@ -10,6 +11,7 @@ import (
 )
 
 type GuardDuty struct {
+	BaseAwsResource
 	Client      guarddutyiface.GuardDutyAPI
 	Region      string
 	detectorIds []string
diff --git a/aws/resources/iam_group_types.go b/aws/resources/iam_group_types.go
index 43ff728..5dda26e 100644
--- a/aws/resources/iam_group_types.go
+++ b/aws/resources/iam_group_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/iam"
@@ -12,6 +13,7 @@ import (
 
 // IAMGroups - represents all IAMGroups on the AWS Account
 type IAMGroups struct {
+	BaseAwsResource
 	Client     iamiface.IAMAPI
 	GroupNames []string
 }
diff --git a/aws/resources/iam_policy_types.go b/aws/resources/iam_policy_types.go
index c8112e8..3e88013 100644
--- a/aws/resources/iam_policy_types.go
+++ b/aws/resources/iam_policy_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/iam"
@@ -12,6 +13,7 @@ import (
 
 // IAMPolicies - represents all IAM Policies on the AWS account
 type IAMPolicies struct {
+	BaseAwsResource
 	Client     iamiface.IAMAPI
 	PolicyArns []string
 }
diff --git a/aws/resources/iam_role_types.go b/aws/resources/iam_role_types.go
index 8fd4a0b..8008d4f 100644
--- a/aws/resources/iam_role_types.go
+++ b/aws/resources/iam_role_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/iam"
@@ -12,6 +13,7 @@ import (
 
 // IAMRoles - represents all IAMRoles on the AWS Account
 type IAMRoles struct {
+	BaseAwsResource
 	Client    iamiface.IAMAPI
 	RoleNames []string
 }
diff --git a/aws/resources/iam_service_linked_role_types.go b/aws/resources/iam_service_linked_role_types.go
index 80d5544..3faedb6 100644
--- a/aws/resources/iam_service_linked_role_types.go
+++ b/aws/resources/iam_service_linked_role_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/iam"
@@ -12,6 +13,7 @@ import (
 
 // IAMServiceLinkedRoles - represents all IAMServiceLinkedRoles on the AWS Account
 type IAMServiceLinkedRoles struct {
+	BaseAwsResource
 	Client    iamiface.IAMAPI
 	RoleNames []string
 }
diff --git a/aws/resources/iam_types.go b/aws/resources/iam_types.go
index 06288c9..c9d138a 100644
--- a/aws/resources/iam_types.go
+++ b/aws/resources/iam_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/iam"
@@ -12,6 +13,7 @@ import (
 
 // IAMUsers - represents all IAMUsers on the AWS Account
 type IAMUsers struct {
+	BaseAwsResource
 	Client    iamiface.IAMAPI
 	UserNames []string
 }
diff --git a/aws/resources/kinesis_stream_types.go b/aws/resources/kinesis_stream_types.go
index 5cfffdd..1b06d01 100644
--- a/aws/resources/kinesis_stream_types.go
+++ b/aws/resources/kinesis_stream_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	"github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/kinesis"
@@ -12,6 +13,7 @@ import (
 
 // KinesisStreams - represents all Kinesis streams
 type KinesisStreams struct {
+	BaseAwsResource
 	Client kinesisiface.KinesisAPI
 	Region string
 	Names  []string
diff --git a/aws/resources/kms_customer_key_types.go b/aws/resources/kms_customer_key_types.go
index 189c975..4b7abed 100644
--- a/aws/resources/kms_customer_key_types.go
+++ b/aws/resources/kms_customer_key_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/kms"
@@ -15,6 +16,7 @@ import (
 const kmsRemovalWindow = 7
 
 type KmsCustomerKeys struct {
+	BaseAwsResource
 	Client     kmsiface.KMSAPI
 	Region     string
 	KeyIds     []string
diff --git a/aws/resources/lambda_layer_types.go b/aws/resources/lambda_layer_types.go
index 8a321ca..8c5899d 100644
--- a/aws/resources/lambda_layer_types.go
+++ b/aws/resources/lambda_layer_types.go
@@ -12,6 +12,7 @@ import (
 )
 
 type LambdaLayers struct {
+	BaseAwsResource
 	Client              lambdaiface.LambdaAPI
 	Region              string
 	LambdaFunctionNames []string
diff --git a/aws/resources/lambda_types.go b/aws/resources/lambda_types.go
index c6641c3..bd4a3ec 100644
--- a/aws/resources/lambda_types.go
+++ b/aws/resources/lambda_types.go
@@ -12,6 +12,7 @@ import (
 )
 
 type LambdaFunctions struct {
+	BaseAwsResource
 	Client              lambdaiface.LambdaAPI
 	Region              string
 	LambdaFunctionNames []string
diff --git a/aws/resources/launch_config_types.go b/aws/resources/launch_config_types.go
index abeccd9..1dcba0f 100644
--- a/aws/resources/launch_config_types.go
+++ b/aws/resources/launch_config_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/autoscaling"
@@ -12,6 +13,7 @@ import (
 
 // LaunchConfigs - represents all launch configurations
 type LaunchConfigs struct {
+	BaseAwsResource
 	Client                   autoscalingiface.AutoScalingAPI
 	Region                   string
 	LaunchConfigurationNames []string
diff --git a/aws/resources/launch_template_types.go b/aws/resources/launch_template_types.go
index 18869e1..4adf0cb 100644
--- a/aws/resources/launch_template_types.go
+++ b/aws/resources/launch_template_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/ec2"
@@ -12,6 +13,7 @@ import (
 
 // LaunchTemplates - represents all launch templates
 type LaunchTemplates struct {
+	BaseAwsResource
 	Client              ec2iface.EC2API
 	Region              string
 	LaunchTemplateNames []string
diff --git a/aws/resources/macie_types.go b/aws/resources/macie_types.go
index c3590f8..692776e 100644
--- a/aws/resources/macie_types.go
+++ b/aws/resources/macie_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/macie2"
@@ -11,6 +12,7 @@ import (
 )
 
 type MacieMember struct {
+	BaseAwsResource
 	Client     macie2iface.Macie2API
 	Region     string
 	AccountIds []string
diff --git a/aws/resources/msk_cluster_types.go b/aws/resources/msk_cluster_types.go
index d9fc561..81e3273 100644
--- a/aws/resources/msk_cluster_types.go
+++ b/aws/resources/msk_cluster_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/kafka"
@@ -12,6 +13,7 @@ import (
 
 // MSKCluster - represents all AWS Managed Streaming for Kafka clusters that should be deleted.
 type MSKCluster struct {
+	BaseAwsResource
 	Client      kafkaiface.KafkaAPI
 	Region      string
 	ClusterArns []string
diff --git a/aws/resources/nat_gateway_types.go b/aws/resources/nat_gateway_types.go
index 649c108..8431e89 100644
--- a/aws/resources/nat_gateway_types.go
+++ b/aws/resources/nat_gateway_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/ec2"
@@ -12,6 +13,7 @@ import (
 
 // NatGateways - represents all AWS secrets manager secrets that should be deleted.
 type NatGateways struct {
+	BaseAwsResource
 	Client        ec2iface.EC2API
 	Region        string
 	NatGatewayIDs []string
diff --git a/aws/resources/oidc_provider_types.go b/aws/resources/oidc_provider_types.go
index 795cc67..06489fd 100644
--- a/aws/resources/oidc_provider_types.go
+++ b/aws/resources/oidc_provider_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/iam"
@@ -12,6 +13,7 @@ import (
 
 // OIDCProviders - represents all AWS OpenID Connect providers that should be deleted.
 type OIDCProviders struct {
+	BaseAwsResource
 	Client       iamiface.IAMAPI
 	ProviderARNs []string
 }
diff --git a/aws/resources/opensearch_types.go b/aws/resources/opensearch_types.go
index f049686..0525139 100644
--- a/aws/resources/opensearch_types.go
+++ b/aws/resources/opensearch_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/opensearchservice"
@@ -12,6 +13,7 @@ import (
 
 // OpenSearchDomains represents all OpenSearch domains found in a region
 type OpenSearchDomains struct {
+	BaseAwsResource
 	Client      opensearchserviceiface.OpenSearchServiceAPI
 	Region      string
 	DomainNames []string
diff --git a/aws/resources/rds_cluster_types.go b/aws/resources/rds_cluster_types.go
index c895410..fa3158b 100644
--- a/aws/resources/rds_cluster_types.go
+++ b/aws/resources/rds_cluster_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/rds"
@@ -11,6 +12,7 @@ import (
 )
 
 type DBClusters struct {
+	BaseAwsResource
 	Client        rdsiface.RDSAPI
 	Region        string
 	InstanceNames []string
diff --git a/aws/resources/rds_snapshot_types.go b/aws/resources/rds_snapshot_types.go
index 6ba9134..86de1ea 100644
--- a/aws/resources/rds_snapshot_types.go
+++ b/aws/resources/rds_snapshot_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/rds"
@@ -11,6 +12,7 @@ import (
 )
 
 type RdsSnapshot struct {
+	BaseAwsResource
 	Client      rdsiface.RDSAPI
 	Region      string
 	Identifiers []string
diff --git a/aws/resources/rds_subnet_group_types.go b/aws/resources/rds_subnet_group_types.go
index a4cea4e..b9ab952 100644
--- a/aws/resources/rds_subnet_group_types.go
+++ b/aws/resources/rds_subnet_group_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/rds"
@@ -11,6 +12,7 @@ import (
 )
 
 type DBSubnetGroups struct {
+	BaseAwsResource
 	Client        rdsiface.RDSAPI
 	Region        string
 	InstanceNames []string
diff --git a/aws/resources/rds_types.go b/aws/resources/rds_types.go
index 0bfc97c..3f25a95 100644
--- a/aws/resources/rds_types.go
+++ b/aws/resources/rds_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/rds"
@@ -11,6 +12,7 @@ import (
 )
 
 type DBInstances struct {
+	BaseAwsResource
 	Client        rdsiface.RDSAPI
 	Region        string
 	InstanceNames []string
diff --git a/aws/resources/redshift_types.go b/aws/resources/redshift_types.go
index aa415c6..6221b17 100644
--- a/aws/resources/redshift_types.go
+++ b/aws/resources/redshift_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/redshift"
@@ -11,6 +12,7 @@ import (
 )
 
 type RedshiftClusters struct {
+	BaseAwsResource
 	Client             redshiftiface.RedshiftAPI
 	Region             string
 	ClusterIdentifiers []string
diff --git a/aws/resources/s3_types.go b/aws/resources/s3_types.go
index 3e7a469..08ebc03 100644
--- a/aws/resources/s3_types.go
+++ b/aws/resources/s3_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	"github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/s3"
@@ -13,6 +14,7 @@ import (
 
 // S3Buckets - represents all S3 Buckets
 type S3Buckets struct {
+	BaseAwsResource
 	Client s3iface.S3API
 	Region string
 	Names  []string
diff --git a/aws/resources/sagemaker_notebook_instance_types.go b/aws/resources/sagemaker_notebook_instance_types.go
index daa36c0..fc99645 100644
--- a/aws/resources/sagemaker_notebook_instance_types.go
+++ b/aws/resources/sagemaker_notebook_instance_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/sagemaker"
@@ -11,6 +12,7 @@ import (
 )
 
 type SageMakerNotebookInstances struct {
+	BaseAwsResource
 	Client        sagemakeriface.SageMakerAPI
 	Region        string
 	InstanceNames []string
diff --git a/aws/resources/secrets_manager_types.go b/aws/resources/secrets_manager_types.go
index 0c50f79..277afa5 100644
--- a/aws/resources/secrets_manager_types.go
+++ b/aws/resources/secrets_manager_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/secretsmanager"
@@ -12,6 +13,7 @@ import (
 
 // SecretsManagerSecrets - represents all AWS secrets manager secrets that should be deleted.
 type SecretsManagerSecrets struct {
+	BaseAwsResource
 	Client    secretsmanageriface.SecretsManagerAPI
 	Region    string
 	SecretIDs []string
diff --git a/aws/resources/security_hub_types.go b/aws/resources/security_hub_types.go
index 27957cb..686787d 100644
--- a/aws/resources/security_hub_types.go
+++ b/aws/resources/security_hub_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/securityhub"
@@ -11,6 +12,7 @@ import (
 )
 
 type SecurityHub struct {
+	BaseAwsResource
 	Client  securityhubiface.SecurityHubAPI
 	Region  string
 	HubArns []string
diff --git a/aws/resources/snapshot_types.go b/aws/resources/snapshot_types.go
index 0564826..4220783 100644
--- a/aws/resources/snapshot_types.go
+++ b/aws/resources/snapshot_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/ec2"
@@ -12,6 +13,7 @@ import (
 
 // Snapshots - represents all user owned Snapshots
 type Snapshots struct {
+	BaseAwsResource
 	Client      ec2iface.EC2API
 	Region      string
 	SnapshotIds []string
diff --git a/aws/resources/sns_types.go b/aws/resources/sns_types.go
index beb6f09..a2305af 100644
--- a/aws/resources/sns_types.go
+++ b/aws/resources/sns_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/sns"
@@ -11,6 +12,7 @@ import (
 )
 
 type SNSTopic struct {
+	BaseAwsResource
 	Client snsiface.SNSAPI
 	Region string
 	Arns   []string
diff --git a/aws/resources/sqs_types.go b/aws/resources/sqs_types.go
index 752ae34..624a4a0 100644
--- a/aws/resources/sqs_types.go
+++ b/aws/resources/sqs_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/sqs"
@@ -12,6 +13,7 @@ import (
 
 // SqsQueue - represents all sqs queues
 type SqsQueue struct {
+	BaseAwsResource
 	Client    sqsiface.SQSAPI
 	Region    string
 	QueueUrls []string
diff --git a/aws/resources/transit_gateway.go b/aws/resources/transit_gateway.go
index 1318517..336ad03 100644
--- a/aws/resources/transit_gateway.go
+++ b/aws/resources/transit_gateway.go
@@ -12,14 +12,37 @@ import (
 	"github.com/gruntwork-io/cloud-nuke/logging"
 	"github.com/gruntwork-io/cloud-nuke/report"
 	"github.com/gruntwork-io/cloud-nuke/telemetry"
+	"github.com/gruntwork-io/cloud-nuke/util"
 	"github.com/gruntwork-io/go-commons/errors"
 	commonTelemetry "github.com/gruntwork-io/go-commons/telemetry"
 )
 
+/*
+NOTE on the Apporach used:-Using the `dry run` approach on verifying the nuking permission in case of a scoped IAM role.
+IAM:simulateCustomPolicy : could also be used but the IAM role itself needs permission for simulateCustomPolicy method
+else this would not get the desired result. Also in case of multiple t-gateway, if only some has permssion to be nuked,
+the t-gateway resource ids needs to be passed individually inside the IAM:simulateCustomPolicy to get the desired result,
+else all would result in `Implicit-deny` as response- this might increase the time complexity.Using dry run to avoid this.
+*/
+func (tgw *TransitGateways) VerifyNukablePermissions(ctx context.Context, ids []*string) {
+	// check permissions without actually performing the nuke operation
+	for _, id := range ids {
+		// dry run set as true , checks permission without actualy making the request
+		params := &ec2.DeleteTransitGatewayInput{
+			TransitGatewayId: id,
+			DryRun:           aws.Bool(true),
+		}
+		_, err := tgw.Client.DeleteTransitGateway(params)
+		tgw.Nukable[*id] = !util.IsAwsUnauthorizedError(err)
+	}
+}
+
 // Returns a formatted string of TransitGateway IDs
 func (tgw *TransitGateways) getAll(c context.Context, configObj config.Config) ([]*string, error) {
+
 	result, err := tgw.Client.DescribeTransitGateways(&ec2.DescribeTransitGatewaysInput{})
 	if err != nil {
+		logging.Debugf("[DescribeTransitGateways Failed] %s", err)
 		return nil, errors.WithStackTrace(err)
 	}
 
@@ -31,10 +54,14 @@ func (tgw *TransitGateways) getAll(c context.Context, configObj config.Config) (
 		}
 	}
 
+	// Check and verfiy the list of allowed nuke actions
+	tgw.VerifyNukablePermissions(c, ids)
+
 	return ids, nil
 }
 
 // Delete all TransitGateways
+// it attempts to nuke only those resources for which the current IAM user has permission
 func (tgw *TransitGateways) nukeAll(ids []*string) error {
 	if len(ids) == 0 {
 		logging.Debugf("No Transit Gateways to nuke in region %s", tgw.Region)
@@ -45,6 +72,13 @@ func (tgw *TransitGateways) nukeAll(ids []*string) error {
 	var deletedIds []*string
 
 	for _, id := range ids {
+		//check the id has the permission to nuke, if not. continue the execution
+		if nukable, err := tgw.IsNukable(*id); !nukable && err == nil {
+			//not adding the report on final result hence not adding a record entry here
+			logging.Debugf("[Skipping] %s nuke while you didn't have the permission", *id)
+			continue
+		}
+
 		params := &ec2.DeleteTransitGatewayInput{
 			TransitGatewayId: id,
 		}
diff --git a/aws/resources/transit_gateway_types.go b/aws/resources/transit_gateway_types.go
index 3240487..d08503f 100644
--- a/aws/resources/transit_gateway_types.go
+++ b/aws/resources/transit_gateway_types.go
@@ -2,6 +2,7 @@ package resources
 
 import (
 	"context"
+
 	awsgo "github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/session"
 	"github.com/aws/aws-sdk-go/service/ec2"
@@ -12,6 +13,7 @@ import (
 
 // TransitGateways - represents all transit gateways
 type TransitGatewayPeeringAttachment struct {
+	BaseAwsResource
 	Client ec2iface.EC2API
 	Region string
 	Ids    []string
@@ -53,6 +55,7 @@ func (tgpa *TransitGatewayPeeringAttachment) Nuke(identifiers []string) error {
 
 // TransitGatewaysVpcAttachment - represents all transit gateways vpc attachments
 type TransitGatewaysVpcAttachment struct {
+	BaseAwsResource
 	Client ec2iface.EC2API
 	Region string
 	Ids    []string
@@ -98,6 +101,7 @@ func (tgw *TransitGatewaysVpcAttachment) Nuke(identifiers []string) error {
 
 // TransitGatewaysRouteTables - represents all transit gateways route tables
 type TransitGatewaysRouteTables struct {
+	BaseAwsResource
 	Client ec2iface.EC2API
 	Region string
 	Ids    []string
@@ -143,13 +147,17 @@ func (tgw *TransitGatewaysRouteTables) Nuke(identifiers []string) error {
 
 // TransitGateways - represents all transit gateways
 type TransitGateways struct {
+	BaseAwsResource
 	Client ec2iface.EC2API
 	Region string
 	Ids    []string
+	// A key-value of identifiers and nukable status
+	Nukable map[string]bool
 }
 
 func (tgw *TransitGateways) Init(session *session.Session) {
 	tgw.Client = ec2.New(session)
+	tgw.Nukable = map[string]bool{}
 }
 
 // ResourceName - the simple name of the aws resource
@@ -185,3 +193,12 @@ func (tgw *TransitGateways) Nuke(identifiers []string) error {
 
 	return nil
 }
+
+// IsNukable - Checks whether the given identifier is authorized to nuke
+func (tgw *TransitGateways) IsNukable(identifier string) (bool, error) {
+	if status, ok := tgw.Nukable[identifier]; ok && status {
+		return true, nil
+	}
+
+	return false, nil
+}
diff --git a/ui/ui.go b/ui/ui.go
index ec02025..b2c3eb9 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -2,13 +2,14 @@ package ui
 
 import (
 	"fmt"
-	"github.com/gruntwork-io/cloud-nuke/aws"
-	"github.com/gruntwork-io/cloud-nuke/util"
-	"github.com/gruntwork-io/go-commons/errors"
 	"io"
 	"os"
 	"strings"
 
+	"github.com/gruntwork-io/cloud-nuke/aws"
+	"github.com/gruntwork-io/cloud-nuke/util"
+	"github.com/gruntwork-io/go-commons/errors"
+
 	"github.com/gruntwork-io/cloud-nuke/logging"
 	"github.com/gruntwork-io/cloud-nuke/report"
 	"github.com/pterm/pterm"
@@ -132,12 +133,16 @@ func renderTableWithHeader(headers []string, data [][]string, w io.Writer) {
 
 func RenderResourcesAsTable(account *aws.AwsAccountResources) error {
 	var tableData [][]string
-	tableData = append(tableData, []string{"Resource Type", "Region", "Identifier"})
+	tableData = append(tableData, []string{"Resource Type", "Region", "Identifier", "Nukable"})
 
 	for region, resourcesInRegion := range account.Resources {
 		for _, foundResources := range resourcesInRegion.Resources {
 			for _, identifier := range (*foundResources).ResourceIdentifiers() {
-				tableData = append(tableData, []string{(*foundResources).ResourceName(), region, identifier})
+				isnukable := "-"
+				if marked, err := (*foundResources).IsNukable(identifier); err == nil {
+					isnukable = fmt.Sprintf("%v", marked)
+				}
+				tableData = append(tableData, []string{(*foundResources).ResourceName(), region, identifier, isnukable})
 			}
 		}
 	}
diff --git a/util/error.go b/util/error.go
new file mode 100644
index 0000000..3be79fb
--- /dev/null
+++ b/util/error.go
@@ -0,0 +1,17 @@
+package util
+
+import (
+	"github.com/aws/aws-sdk-go/aws/awserr"
+)
+
+const AWsUnauthorizedError string = "UnauthorizedOperation"
+
+// IsAwsUnauthorizedError : checks whether the aws returned error is AWsUnauthorizedError
+// For any unauthorised error we can use the same code as AWS returns the same code in this scenario
+// ref : https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html
+func IsAwsUnauthorizedError(err error) bool {
+	if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == AWsUnauthorizedError {
+		return true
+	}
+	return false
+}


Test patch:
diff --git a/aws/resources/transit_gateway_test.go b/aws/resources/transit_gateway_test.go
index a6711ce..7760216 100644
--- a/aws/resources/transit_gateway_test.go
+++ b/aws/resources/transit_gateway_test.go
@@ -2,14 +2,15 @@ package resources
 
 import (
 	"context"
+	"testing"
+	"time"
+
 	"github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/service/ec2"
 	"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
 	"github.com/gruntwork-io/cloud-nuke/config"
 	"github.com/gruntwork-io/cloud-nuke/telemetry"
 	"github.com/stretchr/testify/require"
-	"testing"
-	"time"
 )
 
 type mockedTransitGateway struct {
@@ -86,6 +87,7 @@ func TestTransitGateways_GetAll(t *testing.T) {
 	gatewayId1 := "gateway1"
 	gatewayId2 := "gateway2"
 	tgw := TransitGateways{
+		Nukable: make(map[string]bool),
 		Client: mockedTransitGateway{
 			DescribeTransitGatewaysOutput: ec2.DescribeTransitGatewaysOutput{
 				TransitGateways: []*ec2.TransitGateway{