@@ -130,6 +130,40 @@ func TestAccRoute53ProfilesResourceAssociation_resolverRule(t *testing.T) {
130
130
})
131
131
}
132
132
133
+ func TestAccRoute53ProfilesResourceAssociation_vpcEndpoint (t * testing.T ) {
134
+ ctx := acctest .Context (t )
135
+ if testing .Short () {
136
+ t .Skip ("skipping long-running test in short mode" )
137
+ }
138
+
139
+ var resourceAssociation awstypes.ProfileResourceAssociation
140
+ rName := sdkacctest .RandomWithPrefix (acctest .ResourcePrefix )
141
+ resourceName := "aws_route53profiles_resource_association.test"
142
+
143
+ resource .ParallelTest (t , resource.TestCase {
144
+ PreCheck : func () {
145
+ acctest .PreCheck (ctx , t )
146
+ },
147
+ ErrorCheck : acctest .ErrorCheck (t , names .Route53ProfilesServiceID ),
148
+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories ,
149
+ CheckDestroy : testAccCheckResourceAssociationDestroy (ctx ),
150
+ Steps : []resource.TestStep {
151
+ {
152
+ Config : testAccResourceAssociationConfig_vpcEndpoint (rName ),
153
+ Check : resource .ComposeTestCheckFunc (
154
+ testAccCheckResourceAssociationExists (ctx , resourceName , & resourceAssociation ),
155
+ ),
156
+ },
157
+ {
158
+ ResourceName : resourceName ,
159
+ ImportState : true ,
160
+ ImportStateVerify : true ,
161
+ ImportStateVerifyIgnore : []string {},
162
+ },
163
+ },
164
+ })
165
+ }
166
+
133
167
func TestAccRoute53ProfilesResourceAssociation_disappears (t * testing.T ) {
134
168
ctx := acctest .Context (t )
135
169
if testing .Short () {
@@ -243,7 +277,6 @@ resource "aws_route53_resolver_firewall_rule_group" "test" {
243
277
name = %[1]q
244
278
}
245
279
246
-
247
280
resource "aws_route53profiles_resource_association" "test" {
248
281
name = %[1]q
249
282
profile_id = aws_route53profiles_profile.test.id
@@ -271,3 +304,48 @@ resource "aws_route53profiles_resource_association" "test" {
271
304
}
272
305
` , rName )
273
306
}
307
+
308
+ func testAccResourceAssociationConfig_vpcEndpoint (rName string ) string {
309
+ return acctest .ConfigCompose (acctest .ConfigVPCWithSubnetsEnableDNSHostnames (rName , 3 ), fmt .Sprintf (`
310
+ resource "aws_route53profiles_profile" "test" {
311
+ name = %[1]q
312
+ }
313
+
314
+ data "aws_region" "current" {}
315
+
316
+ resource "aws_security_group" "test" {
317
+ vpc_id = aws_vpc.test.id
318
+
319
+ tags = {
320
+ Name = %[1]q
321
+ }
322
+ }
323
+
324
+ resource "aws_vpc_endpoint" "test" {
325
+ vpc_id = aws_vpc.test.id
326
+ service_name = "com.amazonaws.${data.aws_region.current.name}.ssm"
327
+ vpc_endpoint_type = "Interface"
328
+ private_dns_enabled = true
329
+
330
+ subnet_ids = [
331
+ aws_subnet.test[2].id,
332
+ aws_subnet.test[1].id,
333
+ aws_subnet.test[0].id,
334
+ ]
335
+
336
+ security_group_ids = [
337
+ aws_security_group.test.id,
338
+ ]
339
+
340
+ tags = {
341
+ Name = %[1]q
342
+ }
343
+ }
344
+
345
+ resource "aws_route53profiles_resource_association" "test" {
346
+ name = %[1]q
347
+ profile_id = aws_route53profiles_profile.test.id
348
+ resource_arn = aws_vpc_endpoint.test.arn
349
+ }
350
+ ` , rName ))
351
+ }
0 commit comments