Skip to content

Commit

Permalink
r/aws_ecs_service: fix crash from nil service_registries item
Browse files Browse the repository at this point in the history
```console
% make testacc PKG=ecs TESTS=TestAccECSService_ServiceRegistries
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.6 test ./internal/service/ecs/... -v -count 1 -parallel 20 -run='TestAccECSService_ServiceRegistries'  -timeout 360m

--- PASS: TestAccECSService_ServiceRegistries_basic (145.59s)
--- PASS: TestAccECSService_ServiceRegistries_container (145.60s)
--- PASS: TestAccECSService_ServiceRegistries_removal (156.46s)
--- PASS: TestAccECSService_ServiceRegistries_changes (279.51s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ecs        285.700s
```
  • Loading branch information
jar-b committed Aug 15, 2024
1 parent 7b440b8 commit 8570eea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/service/ecs/flex.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ func expandServiceRegistries(tfList []interface{}) []awstypes.ServiceRegistry {
apiObjects := make([]awstypes.ServiceRegistry, 0, len(tfList))

for _, tfMapRaw := range tfList {
if tfMapRaw == nil {
continue
}

tfMap := tfMapRaw.(map[string]interface{})
apiObject := awstypes.ServiceRegistry{
RegistryArn: aws.String(tfMap["registry_arn"].(string)),
Expand Down

0 comments on commit 8570eea

Please sign in to comment.