Skip to content

Commit 636f7cb

Browse files
committed
Work on tests, deps
1 parent 519c297 commit 636f7cb

File tree

3 files changed

+52
-40
lines changed

3 files changed

+52
-40
lines changed

go.mod

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,9 @@ require (
292292
github.com/hashicorp/terraform-plugin-framework-timeouts v0.5.0
293293
github.com/hashicorp/terraform-plugin-framework-timetypes v0.5.0
294294
github.com/hashicorp/terraform-plugin-framework-validators v0.18.0
295-
github.com/hashicorp/terraform-plugin-go v0.29.0-alpha.1.0.20250717133739-e33a5336fb19
295+
github.com/hashicorp/terraform-plugin-go v0.29.0-beta.1
296296
github.com/hashicorp/terraform-plugin-log v0.9.0
297-
github.com/hashicorp/terraform-plugin-mux v0.20.0
297+
github.com/hashicorp/terraform-plugin-mux v0.20.1-0.20250717140231-ba534763859e
298298
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0
299299
github.com/hashicorp/terraform-plugin-testing v1.13.2
300300
github.com/jmespath/go-jmespath v0.4.0
@@ -336,7 +336,7 @@ require (
336336
github.com/cloudflare/circl v1.6.1 // indirect
337337
github.com/evanphx/json-patch v0.5.2 // indirect
338338
github.com/fatih/color v1.18.0 // indirect
339-
github.com/go-logr/logr v1.4.2 // indirect
339+
github.com/go-logr/logr v1.4.3 // indirect
340340
github.com/go-logr/stdr v1.2.2 // indirect
341341
github.com/golang/protobuf v1.5.4 // indirect
342342
github.com/google/uuid v1.6.0 // indirect
@@ -368,16 +368,17 @@ require (
368368
github.com/zclconf/go-cty v1.16.3 // indirect
369369
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
370370
go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.61.0 // indirect
371-
go.opentelemetry.io/otel v1.36.0 // indirect
372-
go.opentelemetry.io/otel/metric v1.36.0 // indirect
373-
go.opentelemetry.io/otel/trace v1.36.0 // indirect
371+
go.opentelemetry.io/otel v1.37.0 // indirect
372+
go.opentelemetry.io/otel/metric v1.37.0 // indirect
373+
go.opentelemetry.io/otel/sdk v1.37.0 // indirect
374+
go.opentelemetry.io/otel/trace v1.37.0 // indirect
374375
golang.org/x/mod v0.26.0 // indirect
375376
golang.org/x/net v0.42.0 // indirect
376377
golang.org/x/sync v0.16.0 // indirect
377378
golang.org/x/sys v0.34.0 // indirect
378379
google.golang.org/appengine v1.6.8 // indirect
379-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250505200425-f936aa4a68b2 // indirect
380-
google.golang.org/grpc v1.73.0 // indirect
380+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b // indirect
381+
google.golang.org/grpc v1.74.2 // indirect
381382
google.golang.org/protobuf v1.36.6 // indirect
382383
)
383384

go.sum

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,8 @@ github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH
598598
github.com/go-git/go-git/v5 v5.14.0 h1:/MD3lCrGjCen5WfEAzKg00MJJffKhC8gzS80ycmCi60=
599599
github.com/go-git/go-git/v5 v5.14.0/go.mod h1:Z5Xhoia5PcWA3NF8vRLURn9E5FRhSl7dGj9ItW3Wk5k=
600600
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
601-
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
602-
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
601+
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
602+
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
603603
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
604604
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
605605
github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
@@ -670,10 +670,10 @@ github.com/hashicorp/terraform-plugin-framework-timetypes v0.5.0 h1:v3DapR8gsp3E
670670
github.com/hashicorp/terraform-plugin-framework-timetypes v0.5.0/go.mod h1:c3PnGE9pHBDfdEVG9t1S1C9ia5LW+gkFR0CygXlM8ak=
671671
github.com/hashicorp/terraform-plugin-framework-validators v0.18.0 h1:OQnlOt98ua//rCw+QhBbSqfW3QbwtVrcdWeQN5gI3Hw=
672672
github.com/hashicorp/terraform-plugin-framework-validators v0.18.0/go.mod h1:lZvZvagw5hsJwuY7mAY6KUz45/U6fiDR0CzQAwWD0CA=
673-
github.com/hashicorp/terraform-plugin-go v0.29.0-alpha.1.0.20250717133739-e33a5336fb19 h1:P/ZVGEGXt9xSiLz+CrP/JzV2V8rtlE7994AX4jzcGB8=
674-
github.com/hashicorp/terraform-plugin-go v0.29.0-alpha.1.0.20250717133739-e33a5336fb19/go.mod h1:hL//wLEfYo0YVt0TC/VLzia/ADQQto3HEm4/jX2gkdY=
675-
github.com/hashicorp/terraform-plugin-mux v0.20.0 h1:3QpBnI9uCuL0Yy2Rq/kR9cOdmOFNhw88A2GoZtk5aXM=
676-
github.com/hashicorp/terraform-plugin-mux v0.20.0/go.mod h1:wSIZwJjSYk86NOTX3fKUlThMT4EAV1XpBHz9SAvjQr4=
673+
github.com/hashicorp/terraform-plugin-go v0.29.0-beta.1 h1:xeHlRQYev3iMXwX2W7+D1bSfLRBs9jojZXqE6hmNxMI=
674+
github.com/hashicorp/terraform-plugin-go v0.29.0-beta.1/go.mod h1:5pww/UULn9C2tItq6o5sbScEkJxBUt9X9kI4DkeRsIw=
675+
github.com/hashicorp/terraform-plugin-mux v0.20.1-0.20250717140231-ba534763859e h1:U8n8/pVVKdUT4njKquj5T4ym5wkzmaqycQAUAW5zv4Q=
676+
github.com/hashicorp/terraform-plugin-mux v0.20.1-0.20250717140231-ba534763859e/go.mod h1:Rq0WRHKOt3KA5c4w2METfod6Pxvbk0xb58GlZNNG+Uw=
677677
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0 h1:NFPMacTrY/IdcIcnUB+7hsore1ZaRWU9cnB6jFoBnIM=
678678
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0/go.mod h1:QYmYnLfsosrxjCnGY1p9c7Zj6n9thnEE+7RObeYs3fA=
679679
github.com/hashicorp/terraform-plugin-testing v1.13.2 h1:mSotG4Odl020vRjIenA3rggwo6Kg6XCKIwtRhYgp+/M=
@@ -786,16 +786,16 @@ go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJyS
786786
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
787787
go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.61.0 h1:lR4WnQLBC9XyTwKrz0327rq2QnIdJNpaVIGuW2yMvME=
788788
go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.61.0/go.mod h1:UK49mXgwqIWFUDH8ibqTswbhy4fuwjEjj4VKMC7krUQ=
789-
go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg=
790-
go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E=
791-
go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE=
792-
go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs=
793-
go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY=
794-
go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg=
795-
go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o=
796-
go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w=
797-
go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w=
798-
go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA=
789+
go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ=
790+
go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I=
791+
go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE=
792+
go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E=
793+
go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI=
794+
go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg=
795+
go.opentelemetry.io/otel/sdk/metric v1.36.0 h1:r0ntwwGosWGaa0CrSt8cuNuTcccMXERFwHX4dThiPis=
796+
go.opentelemetry.io/otel/sdk/metric v1.36.0/go.mod h1:qTNOhFDfKRwX0yXOqJYegL5WRaW376QbB7P4Pb0qva4=
797+
go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4=
798+
go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0=
799799
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
800800
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
801801
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
@@ -852,10 +852,10 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
852852
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
853853
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
854854
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
855-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250505200425-f936aa4a68b2 h1:IqsN8hx+lWLqlN+Sc3DoMy/watjofWiU8sRFgQ8fhKM=
856-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250505200425-f936aa4a68b2/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
857-
google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok=
858-
google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc=
855+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b h1:zPKJod4w6F1+nRGDI9ubnXYhU9NSWoFAijkHkUXeTK8=
856+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
857+
google.golang.org/grpc v1.74.2 h1:WoosgB65DlWVC9FqI82dGsZhWFNBSLjQ84bjROOpMu4=
858+
google.golang.org/grpc v1.74.2/go.mod h1:CtQ+BGjaAIXHs/5YS3i473GqwBBa1zGQNevxdeBEXrM=
859859
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
860860
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
861861
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=

internal/service/ec2/stop_instance_action_test.go

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,7 @@ func TestAccEC2StopInstanceAction_force(t *testing.T) {
6464
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
6565
Steps: []resource.TestStep{
6666
{
67-
Config: testAccStopInstanceActionConfig_basic(rName),
68-
Check: resource.ComposeTestCheckFunc(
69-
testAccCheckInstanceExists(ctx, resourceName, &v),
70-
testAccCheckInstanceState(ctx, resourceName, awstypes.InstanceStateNameRunning),
71-
),
72-
},
73-
{
74-
Config: testAccStopInstanceActionConfig_withForce(rName),
67+
Config: testAccStopInstanceActionConfig_force(rName),
7568
Check: resource.ComposeTestCheckFunc(
7669
testAccCheckInstanceExists(ctx, resourceName, &v),
7770
testAccCheckInstanceState(ctx, resourceName, awstypes.InstanceStateNameStopped),
@@ -169,17 +162,35 @@ action "aws_ec2_stop_instance" "test" {
169162
`)
170163
}
171164

172-
func testAccStopInstanceActionConfig_withForce(rName string) string {
165+
func testAccStopInstanceActionConfig_force(rName string) string {
173166
return acctest.ConfigCompose(
174-
testAccStopInstanceActionConfig_basic(rName),
175-
`
167+
acctest.ConfigLatestAmazonLinux2HVMEBSX8664AMI(),
168+
acctest.ConfigAvailableAZsNoOptIn(),
169+
acctest.AvailableEC2InstanceTypeForAvailabilityZone("data.aws_availability_zones.available.names[0]", "t3.micro", "t2.micro"),
170+
fmt.Sprintf(`
171+
resource "aws_instance" "test" {
172+
ami = data.aws_ami.amzn2-ami-minimal-hvm-ebs-x86_64.id
173+
instance_type = data.aws_ec2_instance_type_offering.available.instance_type
174+
175+
tags = {
176+
Name = %[1]q
177+
}
178+
179+
lifecycle {
180+
action_trigger {
181+
events = [after_create]
182+
actions = [action.aws_ec2_stop_instance.test]
183+
}
184+
}
185+
}
186+
176187
action "aws_ec2_stop_instance" "test" {
177188
config {
178189
instance_id = aws_instance.test.id
179190
force = true
180191
}
181192
}
182-
`)
193+
`, rName))
183194
}
184195

185196
func testAccStopInstanceActionConfig_withTimeout(rName string) string {

0 commit comments

Comments
 (0)