diff --git a/.changelog/33348.txt b/.changelog/33348.txt new file mode 100644 index 00000000000..5737411ea25 --- /dev/null +++ b/.changelog/33348.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_inspector2_enabler: Fix fails to create due to incorrect resource type constant +``` diff --git a/internal/service/inspector2/enabler.go b/internal/service/inspector2/enabler.go index 257f096bfdf..72bfea2fb38 100644 --- a/internal/service/inspector2/enabler.go +++ b/internal/service/inspector2/enabler.go @@ -539,6 +539,9 @@ func AccountStatuses(ctx context.Context, conn *inspector2.Client, accountIDs [] continue } for k, v := range m { + if k == "LambdaCode" { + k = "LAMBDA_CODE" + } status.ResourceStatuses[types.ResourceScanType(strings.ToUpper(k))] = v.Status } results[aws.ToString(a.AccountId)] = status diff --git a/website/docs/r/inspector2_enabler.html.markdown b/website/docs/r/inspector2_enabler.html.markdown index 850fc0827cb..1998810f6a3 100644 --- a/website/docs/r/inspector2_enabler.html.markdown +++ b/website/docs/r/inspector2_enabler.html.markdown @@ -41,7 +41,7 @@ The following arguments are required: * `account_ids` - (Required) Set of account IDs. Can contain one of: the Organization's Administrator Account, or one or more Member Accounts. * `resource_types` - (Required) Type of resources to scan. - Valid values are `EC2`, `ECR`, and `LAMBDA`. + Valid values are `EC2`, `ECR`, `LAMBDA` and `LAMBDA_CODE`. At least one item is required. ## Attribute Reference