Skip to content

Commit 3f5fb65

Browse files
authored
Merge pull request #44266 from hashicorp/td-acm-sweepers
sweepers: `aws_acm_certificate` and `aws_api_gateway_domain_name`
2 parents 045b803 + acf6406 commit 3f5fb65

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

internal/service/acm/sweep.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import (
99

1010
"github.com/aws/aws-sdk-go-v2/aws"
1111
"github.com/aws/aws-sdk-go-v2/service/acm"
12+
awstypes "github.com/aws/aws-sdk-go-v2/service/acm/types"
1213
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
14+
"github.com/hashicorp/terraform-provider-aws/internal/enum"
1315
"github.com/hashicorp/terraform-provider-aws/internal/sweep"
1416
"github.com/hashicorp/terraform-provider-aws/internal/sweep/awsv2"
1517
)
@@ -48,7 +50,12 @@ func sweepCertificates(region string) error {
4850
conn := client.ACMClient(ctx)
4951
var sweepResources []sweep.Sweepable
5052

51-
input := acm.ListCertificatesInput{}
53+
input := acm.ListCertificatesInput{
54+
Includes: &awstypes.Filters{
55+
// By default, ListCertificates only returns RSA_1024 and RSA_2048 certificates
56+
KeyTypes: enum.EnumValues[awstypes.KeyAlgorithm](),
57+
},
58+
}
5259
pages := acm.NewListCertificatesPaginator(conn, &input)
5360
for pages.HasMorePages() {
5461
page, err := pages.NextPage(ctx)

internal/service/apigateway/sweep.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ func sweepDomainNames(region string) error {
305305
for _, v := range page.Items {
306306
r := resourceDomainName()
307307
d := r.Data(nil)
308-
d.SetId(aws.ToString(v.DomainName))
308+
d.SetId(domainNameCreateResourceID(aws.ToString(v.DomainName), aws.ToString(v.DomainNameId)))
309309

310310
sweepResources = append(sweepResources, sweep.NewSweepResource(r, d, client))
311311
}

0 commit comments

Comments
 (0)