Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug]: Panic when importing aws_securitylake_data_lake #34802

@lawliet89

Description

@lawliet89

Terraform Core Version

1.6.5

AWS Provider Version

5.30.0

Affected Resource(s)

  • aws_securitylake_data_lake

Expected Behavior

To plan successfully

Actual Behavior

When planning an import of aws_securitylake_data_lake, the provider panics.

Provider panics with the same trace for both workflows.

Relevant Error/Panic Output Snippet

Stack trace from the terraform-provider-aws_v5.30.0_x5 plugin:

panic: reflect.Set: value of type basetypes.StringValue is not assignable to type types.ARN

goroutine 27 [running]:
reflect.Value.assignTo({0xe326660?, 0xc003106f78?, 0x18?}, {0xe7332fe, 0xb}, 0xe3b0ea0, 0x0)
reflect/value.go:3245 +0x2a5
reflect.Value.Set({0xe3b0ea0?, 0xc002cdb250?, 0x0?}, {0xe326660?, 0xc003106f78?, 0xe3b0ea0?})
reflect/value.go:2236 +0xeb
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlattener.ptr({}, {0xfc03d60, 0xc002360660}, {0xbfe31e0?, 0xc00312b7e8?, 0x4b418f?}, {0xfc0d450?, 0x16567db0}, {0xe3b0ea0, 0xc002cdb250, ...})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:1042 +0x986
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlattener.convert({}, {0xfc03d60, 0xc002360660}, {0xbfe31e0?, 0xc00312b7e8?, 0xc00312e1c0?}, {0xe3b0ea0?, 0xc002cdb250?, 0x0?})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:874 +0x38e
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlexConvertStruct({0xfc03d60, 0xc002360660}, {0xdbfbc20?, 0xc00312b7d0?}, {0xbfd40a0?, 0xc002cdb220?}, {0xfaf9200, 0x16567db0})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:156 +0x358
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlattener.ptrToStructNestedObject({}, {0xfc03d60, 0xc002360660}, {0xcc04ac0?, 0xc0031140d0?, 0x8?}, {0x7f5d4eda4bc8, 0xc0031019f0}, {0xe44ca20, 0xc00249a968, ...})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:1431 +0x3e5
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlattener.ptr({}, {0xfc03d60, 0xc002360660}, {0xcc04ac0?, 0xc0031140d0?, 0xc002ccb3c0?}, {0xfc0d918?, 0xc0031019f0}, {0xe44ca20, 0xc00249a968, ...})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:1054 +0xbd1
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlattener.convert({}, {0xfc03d60, 0xc002360660}, {0xcc04ac0?, 0xc0031140d0?, 0xc00312e178?}, {0xe44ca20?, 0xc00249a968?, 0x0?})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:874 +0x38e
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlexConvertStruct({0xfc03d60, 0xc002360660}, {0xcc04b20?, 0xc0031140a0?}, {0xbfd3f60?, 0xc00249a8f0?}, {0xfaf4b80, 0x16567db0})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:156 +0x358
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlexConvert({0xfc03d60, 0xc002360660}, {0xcc04b20, 0xc0031140a0}, {0xbfd3f60, 0xc00249a8f0}, {0xfaf4b80?, 0x16567db0?})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:99 +0x287
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.Flatten({0xfc03d60, 0xc002360660}, {0xcc04b20, 0xc0031140a0}, {0xbfd3f60, 0xc00249a8f0}, {0x0, 0x0, 0xfc03d60?})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:65 +0xf8
github.com/hashicorp/terraform-provider-aws/internal/service/securitylake.(*dataLakeResource).Read(0xc00213b860, {0xfc03d60, 0xc002360660}, {{{{0xfc14178, 0xc002360180}, {0xcc92e40, 0xc00231be00}}, {0xfc1e838, 0xc0005d0370}}, 0xc00214c2b0, ...}, ...)
github.com/hashicorp/terraform-provider-aws/internal/service/securitylake/data_lake.go:262 +0x265
github.com/hashicorp/terraform-provider-aws/internal/provider/fwprovider.(*wrappedResource).Read.func1({0xfc03d60?, 0xc002360660?}, {{{{0xfc14178, 0xc002360180}, {0xcc92e40, 0xc00231be00}}, {0xfc1e838, 0xc0005d0370}}, 0xc00214c2b0, {{{0x0, ...}, ...}, ...}}, ...)
github.com/hashicorp/terraform-provider-aws/internal/provider/fwprovider/intercept.go:232 +0x89
github.com/hashicorp/terraform-provider-aws/internal/provider/fwprovider.interceptedHandler[...].func1({{{{0xfc14178, 0xc002360180}, {0xcc92e40, 0xc00231be00}}, {0xfc1e838, 0xc0005d0370}}, 0xc00214c2b0, {{{0x0, 0x0}, {0x0, ...}}, ...}}, ...)
github.com/hashicorp/terraform-provider-aws/internal/provider/fwprovider/intercept.go:119 +0x2fa
github.com/hashicorp/terraform-provider-aws/internal/provider/fwprovider.(*wrappedResource).Read(0xc004e24300, {0xfc03d60, 0xc004e16c90}, {{{{0xfc14178, 0xc002360180}, {0xcc92e40, 0xc00231be00}}, {0xfc1e838, 0xc0005d0370}}, 0xc00214c2b0, ...}, ...)
github.com/hashicorp/terraform-provider-aws/internal/provider/fwprovider/intercept.go:236 +0x157
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ReadResource(0xc0024626e0, {0xfc03d60, 0xc004e16c90}, 0xc004e16d20, 0xc002375550)
github.com/hashicorp/[email protected]/internal/fwserver/server_readresource.go:101 +0x677
github.com/hashicorp/terraform-plugin-framework/internal/proto5server.(*Server).ReadResource(0xc0024626e0, {0xfc03d60?, 0xc004e16b40?}, 0xc004e24100)
github.com/hashicorp/[email protected]/internal/proto5server/server_readresource.go:56 +0x41a
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ReadResource(0xfc03cb8?, {0xfc03d60?, 0xc004e16810?}, 0xc004e24100)
github.com/hashicorp/[email protected]/tf5muxserver/mux_server_ReadResource.go:35 +0x1b5
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc000a93040, {0xfc03d60?, 0xc001d63710?}, 0xc001d5e600)
github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:789 +0x4b1
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0xe422180?, 0xc000a93040}, {0xfc03d60, 0xc001d63710}, 0xc002208680, 0x0)
github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:431 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00003c960, {0xfc03d60, 0xc001d63680}, {0xfc155c0, 0xc0005301a0}, 0xc002240d80, 0xc00252b110, 0x1650b748, 0x0)
google.golang.org/[email protected]/server.go:1343 +0xe49
google.golang.org/grpc.(*Server).handleStream(0xc00003c960, {0xfc155c0, 0xc0005301a0}, 0xc002240d80)
google.golang.org/[email protected]/server.go:1737 +0xca6
google.golang.org/grpc.(*Server).serveStreams.func1.1()
google.golang.org/[email protected]/server.go:986 +0x8c
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:997 +0x15c

Error: The terraform-provider-aws_v5.30.0_x5 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Terraform Configuration Files

terraform plan -generate-config-out generate.tf

import {
  to = aws_securitylake_data_lake.this
  id = "arn:aws:securitylake:ap-southeast-1:123456789012:data-lake/default"
}

terraform plan

resource "aws_securitylake_data_lake" "ap_southeast_1" {
  meta_store_manager_role_arn  = "arn:aws:iam::123456789012:role/role"

  configuration {
    region = "ap-southeast-1"
  }
}

import {
  to = aws_securitylake_data_lake.ap_southeast_1
  id = "arn:aws:securitylake:ap-southeast-1:123456789012:data-lake/default"
}

Steps to Reproduce

  • terraform plan -generate-config-out generate.tf
  • terraform plan

Debug Output

Debug logs posted in support case ID #133461 with HashiCorp Support.

Panic Output

Stack trace from the terraform-provider-aws_v5.30.0_x5 plugin:

panic: reflect.Set: value of type basetypes.StringValue is not assignable to type types.ARN

goroutine 27 [running]:
reflect.Value.assignTo({0xe326660?, 0xc003106f78?, 0x18?}, {0xe7332fe, 0xb}, 0xe3b0ea0, 0x0)
reflect/value.go:3245 +0x2a5
reflect.Value.Set({0xe3b0ea0?, 0xc002cdb250?, 0x0?}, {0xe326660?, 0xc003106f78?, 0xe3b0ea0?})
reflect/value.go:2236 +0xeb
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlattener.ptr({}, {0xfc03d60, 0xc002360660}, {0xbfe31e0?, 0xc00312b7e8?, 0x4b418f?}, {0xfc0d450?, 0x16567db0}, {0xe3b0ea0, 0xc002cdb250, ...})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:1042 +0x986
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlattener.convert({}, {0xfc03d60, 0xc002360660}, {0xbfe31e0?, 0xc00312b7e8?, 0xc00312e1c0?}, {0xe3b0ea0?, 0xc002cdb250?, 0x0?})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:874 +0x38e
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlexConvertStruct({0xfc03d60, 0xc002360660}, {0xdbfbc20?, 0xc00312b7d0?}, {0xbfd40a0?, 0xc002cdb220?}, {0xfaf9200, 0x16567db0})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:156 +0x358
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlattener.ptrToStructNestedObject({}, {0xfc03d60, 0xc002360660}, {0xcc04ac0?, 0xc0031140d0?, 0x8?}, {0x7f5d4eda4bc8, 0xc0031019f0}, {0xe44ca20, 0xc00249a968, ...})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:1431 +0x3e5
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlattener.ptr({}, {0xfc03d60, 0xc002360660}, {0xcc04ac0?, 0xc0031140d0?, 0xc002ccb3c0?}, {0xfc0d918?, 0xc0031019f0}, {0xe44ca20, 0xc00249a968, ...})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:1054 +0xbd1
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlattener.convert({}, {0xfc03d60, 0xc002360660}, {0xcc04ac0?, 0xc0031140d0?, 0xc00312e178?}, {0xe44ca20?, 0xc00249a968?, 0x0?})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:874 +0x38e
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlexConvertStruct({0xfc03d60, 0xc002360660}, {0xcc04b20?, 0xc0031140a0?}, {0xbfd3f60?, 0xc00249a8f0?}, {0xfaf4b80, 0x16567db0})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:156 +0x358
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlexConvert({0xfc03d60, 0xc002360660}, {0xcc04b20, 0xc0031140a0}, {0xbfd3f60, 0xc00249a8f0}, {0xfaf4b80?, 0x16567db0?})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:99 +0x287
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.Flatten({0xfc03d60, 0xc002360660}, {0xcc04b20, 0xc0031140a0}, {0xbfd3f60, 0xc00249a8f0}, {0x0, 0x0, 0xfc03d60?})
github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:65 +0xf8
github.com/hashicorp/terraform-provider-aws/internal/service/securitylake.(*dataLakeResource).Read(0xc00213b860, {0xfc03d60, 0xc002360660}, {{{{0xfc14178, 0xc002360180}, {0xcc92e40, 0xc00231be00}}, {0xfc1e838, 0xc0005d0370}}, 0xc00214c2b0, ...}, ...)
github.com/hashicorp/terraform-provider-aws/internal/service/securitylake/data_lake.go:262 +0x265
github.com/hashicorp/terraform-provider-aws/internal/provider/fwprovider.(*wrappedResource).Read.func1({0xfc03d60?, 0xc002360660?}, {{{{0xfc14178, 0xc002360180}, {0xcc92e40, 0xc00231be00}}, {0xfc1e838, 0xc0005d0370}}, 0xc00214c2b0, {{{0x0, ...}, ...}, ...}}, ...)
github.com/hashicorp/terraform-provider-aws/internal/provider/fwprovider/intercept.go:232 +0x89
github.com/hashicorp/terraform-provider-aws/internal/provider/fwprovider.interceptedHandler[...].func1({{{{0xfc14178, 0xc002360180}, {0xcc92e40, 0xc00231be00}}, {0xfc1e838, 0xc0005d0370}}, 0xc00214c2b0, {{{0x0, 0x0}, {0x0, ...}}, ...}}, ...)
github.com/hashicorp/terraform-provider-aws/internal/provider/fwprovider/intercept.go:119 +0x2fa
github.com/hashicorp/terraform-provider-aws/internal/provider/fwprovider.(*wrappedResource).Read(0xc004e24300, {0xfc03d60, 0xc004e16c90}, {{{{0xfc14178, 0xc002360180}, {0xcc92e40, 0xc00231be00}}, {0xfc1e838, 0xc0005d0370}}, 0xc00214c2b0, ...}, ...)
github.com/hashicorp/terraform-provider-aws/internal/provider/fwprovider/intercept.go:236 +0x157
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ReadResource(0xc0024626e0, {0xfc03d60, 0xc004e16c90}, 0xc004e16d20, 0xc002375550)
github.com/hashicorp/[email protected]/internal/fwserver/server_readresource.go:101 +0x677
github.com/hashicorp/terraform-plugin-framework/internal/proto5server.(*Server).ReadResource(0xc0024626e0, {0xfc03d60?, 0xc004e16b40?}, 0xc004e24100)
github.com/hashicorp/[email protected]/internal/proto5server/server_readresource.go:56 +0x41a
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ReadResource(0xfc03cb8?, {0xfc03d60?, 0xc004e16810?}, 0xc004e24100)
github.com/hashicorp/[email protected]/tf5muxserver/mux_server_ReadResource.go:35 +0x1b5
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc000a93040, {0xfc03d60?, 0xc001d63710?}, 0xc001d5e600)
github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:789 +0x4b1
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0xe422180?, 0xc000a93040}, {0xfc03d60, 0xc001d63710}, 0xc002208680, 0x0)
github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:431 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00003c960, {0xfc03d60, 0xc001d63680}, {0xfc155c0, 0xc0005301a0}, 0xc002240d80, 0xc00252b110, 0x1650b748, 0x0)
google.golang.org/[email protected]/server.go:1343 +0xe49
google.golang.org/grpc.(*Server).handleStream(0xc00003c960, {0xfc155c0, 0xc0005301a0}, 0xc002240d80)
google.golang.org/[email protected]/server.go:1737 +0xca6
google.golang.org/grpc.(*Server).serveStreams.func1.1()
google.golang.org/[email protected]/server.go:986 +0x8c
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:997 +0x15c

Error: The terraform-provider-aws_v5.30.0_x5 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

Metadata

Metadata

Assignees

Labels

bugAddresses a defect in current functionality.crashResults from or addresses a Terraform crash or kernel panic.prioritizedPart of the maintainer teams immediate focus. To be addressed within the current quarter.service/securitylakeIssues and PRs that pertain to the securitylake service.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions