Skip to content

Commit eaaedd5

Browse files
committed
fix: mark aws_route53profiles_resource_association resource_properties as Computed
1 parent d45a5fd commit eaaedd5

File tree

2 files changed

+80
-1
lines changed

2 files changed

+80
-1
lines changed

internal/service/route53profiles/resource_association.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ func (r *resourceResourceAssociation) Schema(ctx context.Context, req resource.S
7878
},
7979
},
8080
"resource_properties": schema.StringAttribute{
81+
Computed: true,
8182
CustomType: jsontypes.NormalizedType{},
8283
Optional: true,
8384
},

internal/service/route53profiles/resource_association_test.go

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,40 @@ func TestAccRoute53ProfilesResourceAssociation_resolverRule(t *testing.T) {
130130
})
131131
}
132132

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+
133167
func TestAccRoute53ProfilesResourceAssociation_disappears(t *testing.T) {
134168
ctx := acctest.Context(t)
135169
if testing.Short() {
@@ -243,7 +277,6 @@ resource "aws_route53_resolver_firewall_rule_group" "test" {
243277
name = %[1]q
244278
}
245279
246-
247280
resource "aws_route53profiles_resource_association" "test" {
248281
name = %[1]q
249282
profile_id = aws_route53profiles_profile.test.id
@@ -271,3 +304,48 @@ resource "aws_route53profiles_resource_association" "test" {
271304
}
272305
`, rName)
273306
}
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

Comments
 (0)