Repository: gruntwork-io/cloud-nuke
Pull request #802 (2024-12-04 19:27:08)

register missing resource - TGW Peering Attachment
## Description
I was running `dead code` analysis and noticed that the `TransitGatewayPeeringAttachment` resource is not being used.

```sh

aws/resources/tgw_peering_attachment.go:14:46: unreachable func: TransitGatewayPeeringAttachment.getAll
aws/resources/tgw_peering_attachment.go:34:46: unreachable func: TransitGatewayPeeringAttachment.nukeAll
aws/resources/tgw_peering_attachment_types.go:22:46: unreachable func: TransitGatewayPeeringAttachment.Init
aws/resources/tgw_peering_attachment_types.go:26:46: unreachable func: TransitGatewayPeeringAttachment.ResourceName
aws/resources/tgw_peering_attachment_types.go:30:46: unreachable func: TransitGatewayPeeringAttachment.MaxBatchSize
aws/resources/tgw_peering_attachment_types.go:34:46: unreachable func: TransitGatewayPeeringAttachment.ResourceIdentifiers
aws/resources/tgw_peering_attachment_types.go:38:46: unreachable func: TransitGatewayPeeringAttachment.GetAndSetResourceConfig
aws/resources/tgw_peering_attachment_types.go:42:46: unreachable func: TransitGatewayPeeringAttachment.GetAndSetIdentifiers
aws/resources/tgw_peering_attachment_types.go:52:46: unreachable func: TransitGatewayPeeringAttachment.Nuke
```

## TODOs

Read the [Gruntwork contribution guidelines](https://gruntwork.notion.site/Gruntwork-Coding-Methodology-02fdcd6e4b004e818553684760bf691e).

- [x] Update the docs.
- [x] Run the relevant tests successfully, including pre-commit checks.
- [x] 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.
- [x] 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)
Added `TransitGatewayPeeringAttachment` to be loaded.

### Migration Guide
n/a

james03160927: It seems like there are some merge conflict. We can submit it once it's resolved. 
wakeful: > It seems like there are some merge conflict. We can submit it once it's resolved.

resolved 
wakeful: hey @james03160927 

I added another commit to this MR with code changes to move the `transit-gateway-peering-attachment` resource to AWS SDK v2.


Patch:
diff --git a/aws/resource_registry.go b/aws/resource_registry.go
index 56a1b79..18d2819 100644
--- a/aws/resource_registry.go
+++ b/aws/resource_registry.go
@@ -89,6 +89,7 @@ func getRegisteredRegionalResources() []AwsResource {
 		&resources.TransitGateways{},
 		&resources.TransitGatewaysRouteTables{},
 		// Note: nuking transitgateway vpc attachement before nuking the vpc since vpc could be associated with it.
+		&resources.TransitGatewayPeeringAttachment{},
 		&resources.TransitGatewaysVpcAttachment{},
 		&resources.EC2Endpoints{},
 		&resources.EC2VPCs{},
diff --git a/aws/resources/tgw_peering_attachment.go b/aws/resources/tgw_peering_attachment.go
index e15323e..69a2c5c 100644
--- a/aws/resources/tgw_peering_attachment.go
+++ b/aws/resources/tgw_peering_attachment.go
@@ -3,8 +3,8 @@ package resources
 import (
 	"context"
 
-	"github.com/aws/aws-sdk-go/aws"
-	"github.com/aws/aws-sdk-go/service/ec2"
+	"github.com/aws/aws-sdk-go-v2/aws"
+	"github.com/aws/aws-sdk-go-v2/service/ec2"
 	"github.com/gruntwork-io/cloud-nuke/config"
 	"github.com/gruntwork-io/cloud-nuke/logging"
 	"github.com/gruntwork-io/cloud-nuke/report"
@@ -13,19 +13,20 @@ import (
 
 func (tgpa *TransitGatewayPeeringAttachment) getAll(c context.Context, configObj config.Config) ([]*string, error) {
 	var ids []*string
-	err := tgpa.Client.DescribeTransitGatewayPeeringAttachmentsPagesWithContext(tgpa.Context, &ec2.DescribeTransitGatewayPeeringAttachmentsInput{}, func(result *ec2.DescribeTransitGatewayPeeringAttachmentsOutput, lastPage bool) bool {
-		for _, attachment := range result.TransitGatewayPeeringAttachments {
+	paginator := ec2.NewDescribeTransitGatewayPeeringAttachmentsPaginator(tgpa.Client, &ec2.DescribeTransitGatewayPeeringAttachmentsInput{})
+	for paginator.HasMorePages() {
+		page, err := paginator.NextPage(c)
+		if err != nil {
+			return nil, errors.WithStackTrace(err)
+		}
+
+		for _, attachment := range page.TransitGatewayPeeringAttachments {
 			if configObj.TransitGatewayPeeringAttachment.ShouldInclude(config.ResourceValue{
 				Time: attachment.CreationTime,
 			}) {
 				ids = append(ids, attachment.TransitGatewayAttachmentId)
 			}
 		}
-
-		return !lastPage
-	})
-	if err != nil {
-		return nil, errors.WithStackTrace(err)
 	}
 
 	return ids, nil
@@ -33,12 +34,12 @@ func (tgpa *TransitGatewayPeeringAttachment) getAll(c context.Context, configObj
 
 func (tgpa *TransitGatewayPeeringAttachment) nukeAll(ids []*string) error {
 	for _, id := range ids {
-		_, err := tgpa.Client.DeleteTransitGatewayPeeringAttachmentWithContext(tgpa.Context, &ec2.DeleteTransitGatewayPeeringAttachmentInput{
+		_, err := tgpa.Client.DeleteTransitGatewayPeeringAttachment(tgpa.Context, &ec2.DeleteTransitGatewayPeeringAttachmentInput{
 			TransitGatewayAttachmentId: id,
 		})
 		// Record status of this resource
 		report.Record(report.Entry{
-			Identifier:   aws.StringValue(id),
+			Identifier:   aws.ToString(id),
 			ResourceType: tgpa.ResourceName(),
 			Error:        err,
 		})
diff --git a/aws/resources/tgw_peering_attachment_types.go b/aws/resources/tgw_peering_attachment_types.go
index d9dfae7..88c304f 100644
--- a/aws/resources/tgw_peering_attachment_types.go
+++ b/aws/resources/tgw_peering_attachment_types.go
@@ -3,26 +3,31 @@ 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"
-	"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
+	"github.com/aws/aws-sdk-go-v2/aws"
+	"github.com/aws/aws-sdk-go-v2/service/ec2"
 	"github.com/gruntwork-io/cloud-nuke/config"
 	"github.com/gruntwork-io/go-commons/errors"
 )
 
+type TransitGatewayPeeringAttachmentAPI interface {
+	DescribeTransitGatewayPeeringAttachments(ctx context.Context, params *ec2.DescribeTransitGatewayPeeringAttachmentsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeTransitGatewayPeeringAttachmentsOutput, error)
+	DeleteTransitGatewayPeeringAttachment(ctx context.Context, params *ec2.DeleteTransitGatewayPeeringAttachmentInput, optFns ...func(*ec2.Options)) (*ec2.DeleteTransitGatewayPeeringAttachmentOutput, error)
+}
+
 // TransitGatewayPeeringAttachment - represents all transit gateways peering attachment
 type TransitGatewayPeeringAttachment struct {
 	BaseAwsResource
-	Client ec2iface.EC2API
+	Client TransitGatewayPeeringAttachmentAPI
 	Region string
 	Ids    []string
 }
 
-func (tgpa *TransitGatewayPeeringAttachment) Init(session *session.Session) {
-	tgpa.Client = ec2.New(session)
+func (tgpa *TransitGatewayPeeringAttachment) InitV2(cfg aws.Config) {
+	tgpa.Client = ec2.NewFromConfig(cfg)
 }
 
+func (tgpa *TransitGatewayPeeringAttachment) IsUsingV2() bool { return true }
+
 func (tgpa *TransitGatewayPeeringAttachment) ResourceName() string {
 	return "transit-gateway-peering-attachment"
 }
@@ -36,7 +41,7 @@ func (tgpa *TransitGatewayPeeringAttachment) ResourceIdentifiers() []string {
 }
 
 func (tgpa *TransitGatewayPeeringAttachment) GetAndSetResourceConfig(configObj config.Config) config.ResourceType {
-	return configObj.TransitGateway
+	return configObj.TransitGatewayPeeringAttachment
 }
 
 func (tgpa *TransitGatewayPeeringAttachment) GetAndSetIdentifiers(c context.Context, configObj config.Config) ([]string, error) {
@@ -45,12 +50,12 @@ func (tgpa *TransitGatewayPeeringAttachment) GetAndSetIdentifiers(c context.Cont
 		return nil, err
 	}
 
-	tgpa.Ids = awsgo.StringValueSlice(identifiers)
+	tgpa.Ids = aws.ToStringSlice(identifiers)
 	return tgpa.Ids, nil
 }
 
 func (tgpa *TransitGatewayPeeringAttachment) Nuke(identifiers []string) error {
-	if err := tgpa.nukeAll(awsgo.StringSlice(identifiers)); err != nil {
+	if err := tgpa.nukeAll(aws.StringSlice(identifiers)); err != nil {
 		return errors.WithStackTrace(err)
 	}
 
diff --git a/v2_migration_report/output.md b/v2_migration_report/output.md
index 7ab394f..db4416d 100644
--- a/v2_migration_report/output.md
+++ b/v2_migration_report/output.md
@@ -4,120 +4,121 @@ The table below outlines the progress of the `AWS SDK` migration as detailed in
 run `go generate ./...` to refresh this report.
 
 
-| Resource Name                    | Migrated           |
-|----------------------------------|--------------------|
-| accessanalyzer                   | :white_check_mark: |
-| acm                              | :white_check_mark: |
-| acmpca                           | :white_check_mark: |
-| ami                              | :white_check_mark: |
-| apigateway                       | :white_check_mark: |
-| apigatewayv2                     | :white_check_mark: |
-| app-runner-service               | :white_check_mark: |
-| asg                              | :white_check_mark: |
-| backup-vault                     | :white_check_mark: |
-| cloudtrail                       | :white_check_mark: |
-| cloudwatch-alarm                 | :white_check_mark: |
-| cloudwatch-dashboard             | :white_check_mark: |
-| cloudwatch-loggroup              | :white_check_mark: |
-| codedeploy-application           | :white_check_mark: |
-| config-recorders                 | :white_check_mark: |
-| config-rules                     | :white_check_mark: |
-| data-sync-location               | :white_check_mark: |
-| data-sync-task                   | :white_check_mark: |
-| dynamodb                         | :white_check_mark: |
-| ebs                              | :white_check_mark: |
-| ec2                              |                    |
-| ec2-dedicated-hosts              | :white_check_mark: |
-| ec2-endpoint                     | :white_check_mark: |
-| ec2-keypairs                     | :white_check_mark: |
-| ec2-placement-groups             | :white_check_mark: |
-| ec2-subnet                       | :white_check_mark: |
-| ec2_dhcp_option                  | :white_check_mark: |
-| ecr                              | :white_check_mark: |
-| ecscluster                       | :white_check_mark: |
-| ecsserv                          | :white_check_mark: |
-| efs                              | :white_check_mark: |
-| egress-only-internet-gateway     | :white_check_mark: |
-| eip                              | :white_check_mark: |
-| ekscluster                       | :white_check_mark: |
-| elastic-beanstalk                | :white_check_mark: |
-| elasticache                      | :white_check_mark: |
-| elasticacheParameterGroups       | :white_check_mark: |
-| elasticacheSubnetGroups          | :white_check_mark: |
-| elasticcache-serverless          | :white_check_mark: |
-| elb                              | :white_check_mark: |
-| elbv2                            | :white_check_mark: |
-| event-bridge                     | :white_check_mark: |
-| event-bridge-archive             | :white_check_mark: |
-| event-bridge-rule                | :white_check_mark: |
-| event-bridge-schedule            | :white_check_mark: |
-| event-bridge-schedule-group      | :white_check_mark: |
-| grafana                          | :white_check_mark: |
-| guardduty                        | :white_check_mark: |
-| iam                              | :white_check_mark: |
-| iam-group                        | :white_check_mark: |
-| iam-policy                       | :white_check_mark: |
-| iam-role                         | :white_check_mark: |
-| iam-service-linked-role          | :white_check_mark: |
-| internet-gateway                 | :white_check_mark: |
-| ipam                             | :white_check_mark: |
-| ipam-byoasn                      | :white_check_mark: |
-| ipam-custom-allocation           | :white_check_mark: |
-| ipam-pool                        | :white_check_mark: |
-| ipam-resource-discovery          | :white_check_mark: |
-| ipam-scope                       | :white_check_mark: |
-| kinesis-firehose                 | :white_check_mark: |
-| kinesis-stream                   | :white_check_mark: |
-| kmscustomerkeys                  | :white_check_mark: |
-| lambda                           | :white_check_mark: |
-| lambda_layer                     | :white_check_mark: |
-| lc                               | :white_check_mark: |
-| lt                               | :white_check_mark: |
-| macie-member                     | :white_check_mark: |
-| managed-prometheus               | :white_check_mark: |
-| msk-cluster                      | :white_check_mark: |
-| nat-gateway                      | :white_check_mark: |
-| network-acl                      | :white_check_mark: |
-| network-firewall                 | :white_check_mark: |
-| network-firewall-policy          | :white_check_mark: |
-| network-firewall-resource-policy | :white_check_mark: |
-| network-firewall-rule-group      | :white_check_mark: |
-| network-firewall-tls-config      | :white_check_mark: |
-| network-interface                | :white_check_mark: |
-| oidcprovider                     | :white_check_mark: |
-| opensearchdomain                 | :white_check_mark: |
-| rds                              | :white_check_mark: |
-| rds-cluster                      | :white_check_mark: |
-| rds-global-cluster               | :white_check_mark: |
-| rds-global-cluster-membership    | :white_check_mark: |
-| rds-parameter-group              | :white_check_mark: |
-| rds-proxy                        | :white_check_mark: |
-| rds-snapshot                     | :white_check_mark: |
-| rds-subnet-group                 | :white_check_mark: |
-| redshift                         |                    |
-| route53-cidr-collection          | :white_check_mark: |
-| route53-hosted-zone              | :white_check_mark: |
-| route53-traffic-policy           | :white_check_mark: |
-| s3                               | :white_check_mark: |
-| s3-ap                            | :white_check_mark: |
-| s3-mrap                          | :white_check_mark: |
-| s3-olap                          | :white_check_mark: |
-| sagemaker-notebook-smni          | :white_check_mark: |
-| secretsmanager                   | :white_check_mark: |
-| security-group                   | :white_check_mark: |
-| security-hub                     | :white_check_mark: |
-| ses-configuration-set            | :white_check_mark: |
-| ses-email-template               | :white_check_mark: |
-| ses-identity                     | :white_check_mark: |
-| ses-receipt-filter               | :white_check_mark: |
-| ses-receipt-rule-set             | :white_check_mark: |
-| snap                             | :white_check_mark: |
-| snstopic                         | :white_check_mark: |
-| sqs                              | :white_check_mark: |
-| transit-gateway                  | :white_check_mark: |
-| transit-gateway-attachment       | :white_check_mark: |
-| transit-gateway-route-table      | :white_check_mark: |
-| vpc                              | :white_check_mark: |
-| vpc-lattice-service              | :white_check_mark: |
-| vpc-lattice-service-network      | :white_check_mark: |
-| vpc-lattice-target-group         | :white_check_mark: |
+| Resource Name                      | Migrated           |
+|------------------------------------|--------------------|
+| accessanalyzer                     | :white_check_mark: |
+| acm                                | :white_check_mark: |
+| acmpca                             | :white_check_mark: |
+| ami                                | :white_check_mark: |
+| apigateway                         | :white_check_mark: |
+| apigatewayv2                       | :white_check_mark: |
+| app-runner-service                 | :white_check_mark: |
+| asg                                | :white_check_mark: |
+| backup-vault                       | :white_check_mark: |
+| cloudtrail                         | :white_check_mark: |
+| cloudwatch-alarm                   | :white_check_mark: |
+| cloudwatch-dashboard               | :white_check_mark: |
+| cloudwatch-loggroup                | :white_check_mark: |
+| codedeploy-application             | :white_check_mark: |
+| config-recorders                   | :white_check_mark: |
+| config-rules                       | :white_check_mark: |
+| data-sync-location                 | :white_check_mark: |
+| data-sync-task                     | :white_check_mark: |
+| dynamodb                           | :white_check_mark: |
+| ebs                                | :white_check_mark: |
+| ec2                                |                    |
+| ec2-dedicated-hosts                | :white_check_mark: |
+| ec2-endpoint                       | :white_check_mark: |
+| ec2-keypairs                       | :white_check_mark: |
+| ec2-placement-groups               | :white_check_mark: |
+| ec2-subnet                         | :white_check_mark: |
+| ec2_dhcp_option                    | :white_check_mark: |
+| ecr                                | :white_check_mark: |
+| ecscluster                         | :white_check_mark: |
+| ecsserv                            | :white_check_mark: |
+| efs                                | :white_check_mark: |
+| egress-only-internet-gateway       | :white_check_mark: |
+| eip                                | :white_check_mark: |
+| ekscluster                         | :white_check_mark: |
+| elastic-beanstalk                  | :white_check_mark: |
+| elasticache                        | :white_check_mark: |
+| elasticacheParameterGroups         | :white_check_mark: |
+| elasticacheSubnetGroups            | :white_check_mark: |
+| elasticcache-serverless            | :white_check_mark: |
+| elb                                | :white_check_mark: |
+| elbv2                              | :white_check_mark: |
+| event-bridge                       | :white_check_mark: |
+| event-bridge-archive               | :white_check_mark: |
+| event-bridge-rule                  | :white_check_mark: |
+| event-bridge-schedule              | :white_check_mark: |
+| event-bridge-schedule-group        | :white_check_mark: |
+| grafana                            | :white_check_mark: |
+| guardduty                          | :white_check_mark: |
+| iam                                | :white_check_mark: |
+| iam-group                          | :white_check_mark: |
+| iam-policy                         | :white_check_mark: |
+| iam-role                           | :white_check_mark: |
+| iam-service-linked-role            | :white_check_mark: |
+| internet-gateway                   | :white_check_mark: |
+| ipam                               | :white_check_mark: |
+| ipam-byoasn                        | :white_check_mark: |
+| ipam-custom-allocation             | :white_check_mark: |
+| ipam-pool                          | :white_check_mark: |
+| ipam-resource-discovery            | :white_check_mark: |
+| ipam-scope                         | :white_check_mark: |
+| kinesis-firehose                   | :white_check_mark: |
+| kinesis-stream                     | :white_check_mark: |
+| kmscustomerkeys                    | :white_check_mark: |
+| lambda                             | :white_check_mark: |
+| lambda_layer                       | :white_check_mark: |
+| lc                                 | :white_check_mark: |
+| lt                                 | :white_check_mark: |
+| macie-member                       | :white_check_mark: |
+| managed-prometheus                 | :white_check_mark: |
+| msk-cluster                        | :white_check_mark: |
+| nat-gateway                        | :white_check_mark: |
+| network-acl                        | :white_check_mark: |
+| network-firewall                   | :white_check_mark: |
+| network-firewall-policy            | :white_check_mark: |
+| network-firewall-resource-policy   | :white_check_mark: |
+| network-firewall-rule-group        | :white_check_mark: |
+| network-firewall-tls-config        | :white_check_mark: |
+| network-interface                  | :white_check_mark: |
+| oidcprovider                       | :white_check_mark: |
+| opensearchdomain                   | :white_check_mark: |
+| rds                                | :white_check_mark: |
+| rds-cluster                        | :white_check_mark: |
+| rds-global-cluster                 | :white_check_mark: |
+| rds-global-cluster-membership      | :white_check_mark: |
+| rds-parameter-group                | :white_check_mark: |
+| rds-proxy                          | :white_check_mark: |
+| rds-snapshot                       | :white_check_mark: |
+| rds-subnet-group                   | :white_check_mark: |
+| redshift                           |                    |
+| route53-cidr-collection            | :white_check_mark: |
+| route53-hosted-zone                | :white_check_mark: |
+| route53-traffic-policy             | :white_check_mark: |
+| s3                                 | :white_check_mark: |
+| s3-ap                              | :white_check_mark: |
+| s3-mrap                            | :white_check_mark: |
+| s3-olap                            | :white_check_mark: |
+| sagemaker-notebook-smni            | :white_check_mark: |
+| secretsmanager                     | :white_check_mark: |
+| security-group                     | :white_check_mark: |
+| security-hub                       | :white_check_mark: |
+| ses-configuration-set              | :white_check_mark: |
+| ses-email-template                 | :white_check_mark: |
+| ses-identity                       | :white_check_mark: |
+| ses-receipt-filter                 | :white_check_mark: |
+| ses-receipt-rule-set               | :white_check_mark: |
+| snap                               | :white_check_mark: |
+| snstopic                           | :white_check_mark: |
+| sqs                                | :white_check_mark: |
+| transit-gateway                    | :white_check_mark: |
+| transit-gateway-attachment         | :white_check_mark: |
+| transit-gateway-peering-attachment | :white_check_mark: |
+| transit-gateway-route-table        | :white_check_mark: |
+| vpc                                | :white_check_mark: |
+| vpc-lattice-service                | :white_check_mark: |
+| vpc-lattice-service-network        | :white_check_mark: |
+| vpc-lattice-target-group           | :white_check_mark: |


Test patch:
diff --git a/aws/resources/tgw_peering_attachment_test.go b/aws/resources/tgw_peering_attachment_test.go
index edb8882..020604d 100644
--- a/aws/resources/tgw_peering_attachment_test.go
+++ b/aws/resources/tgw_peering_attachment_test.go
@@ -5,32 +5,28 @@ import (
 	"testing"
 	"time"
 
-	"github.com/aws/aws-sdk-go/aws"
-	awsgo "github.com/aws/aws-sdk-go/aws"
-	"github.com/aws/aws-sdk-go/aws/request"
-	"github.com/aws/aws-sdk-go/service/ec2"
-	"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
+	"github.com/aws/aws-sdk-go-v2/aws"
+	"github.com/aws/aws-sdk-go-v2/service/ec2"
+	"github.com/aws/aws-sdk-go-v2/service/ec2/types"
 	"github.com/gruntwork-io/cloud-nuke/config"
 	"github.com/stretchr/testify/require"
 )
 
 type mockedTransitGatewayPeeringAttachment struct {
-	ec2iface.EC2API
+	TransitGatewayPeeringAttachmentAPI
 	DescribeTransitGatewayPeeringAttachmentsOutput ec2.DescribeTransitGatewayPeeringAttachmentsOutput
 	DeleteTransitGatewayPeeringAttachmentOutput    ec2.DeleteTransitGatewayPeeringAttachmentOutput
 }
 
-func (m mockedTransitGatewayPeeringAttachment) DescribeTransitGatewayPeeringAttachmentsPagesWithContext(_ awsgo.Context, _ *ec2.DescribeTransitGatewayPeeringAttachmentsInput, fn func(*ec2.DescribeTransitGatewayPeeringAttachmentsOutput, bool) bool, _ ...request.Option) error {
-	fn(&m.DescribeTransitGatewayPeeringAttachmentsOutput, true)
-	return nil
+func (m mockedTransitGatewayPeeringAttachment) DescribeTransitGatewayPeeringAttachments(_ context.Context, _ *ec2.DescribeTransitGatewayPeeringAttachmentsInput, _ ...func(*ec2.Options)) (*ec2.DescribeTransitGatewayPeeringAttachmentsOutput, error) {
+	return &m.DescribeTransitGatewayPeeringAttachmentsOutput, nil
 }
 
-func (m mockedTransitGatewayPeeringAttachment) DeleteTransitGatewayPeeringAttachmentWithContext(_ awsgo.Context, _ *ec2.DeleteTransitGatewayPeeringAttachmentInput, _ ...request.Option) (*ec2.DeleteTransitGatewayPeeringAttachmentOutput, error) {
+func (m mockedTransitGatewayPeeringAttachment) DeleteTransitGatewayPeeringAttachment(_ context.Context, _ *ec2.DeleteTransitGatewayPeeringAttachmentInput, _ ...func(*ec2.Options)) (*ec2.DeleteTransitGatewayPeeringAttachmentOutput, error) {
 	return &m.DeleteTransitGatewayPeeringAttachmentOutput, nil
 }
 
 func TestTransitGatewayPeeringAttachment_getAll(t *testing.T) {
-
 	t.Parallel()
 
 	now := time.Now()
@@ -39,7 +35,7 @@ func TestTransitGatewayPeeringAttachment_getAll(t *testing.T) {
 	tgpa := TransitGatewayPeeringAttachment{
 		Client: mockedTransitGatewayPeeringAttachment{
 			DescribeTransitGatewayPeeringAttachmentsOutput: ec2.DescribeTransitGatewayPeeringAttachmentsOutput{
-				TransitGatewayPeeringAttachments: []*ec2.TransitGatewayPeeringAttachment{
+				TransitGatewayPeeringAttachments: []types.TransitGatewayPeeringAttachment{
 					{
 						TransitGatewayAttachmentId: aws.String(attachment1),
 						CreationTime:               aws.Time(now),
@@ -75,7 +71,7 @@ func TestTransitGatewayPeeringAttachment_getAll(t *testing.T) {
 				TransitGatewayPeeringAttachment: tc.configObj,
 			})
 			require.NoError(t, err)
-			require.Equal(t, tc.expected, aws.StringValueSlice(names))
+			require.Equal(t, tc.expected, aws.ToStringSlice(names))
 		})
 	}
 }