Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: inspector2_enabler fails to create due to incorrect resource type #33348

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/33348.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_inspector2_enabler: Fix fails to create due to incorrect resource type constant
```
3 changes: 3 additions & 0 deletions internal/service/inspector2/enabler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/inspector2_enabler.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down