-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
resource/securityhub_insight: new resource #18494
Conversation
ae4dfd4
to
1bf3741
Compare
func numberFilterSchema() *schema.Schema { | ||
return &schema.Schema{ | ||
Type: schema.TypeSet, | ||
Optional: true, | ||
MaxItems: 20, | ||
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"eq": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
ValidateFunc: validateTypeStringNullableFloat, | ||
}, | ||
"gte": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
ValidateFunc: validateTypeStringNullableFloat, | ||
}, | ||
"lte": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
ValidateFunc: validateTypeStringNullableFloat, | ||
}, | ||
}, | ||
}, | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using a string here in place of using the Float type to help distinguish between a 0 value supplied by a user and the default we get from calling d.Get()/extracting the values from the nested map..i think this is an ok alternative atm, but wondering if we have other strategies to work with?
1bf3741
to
fca6674
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like some hardcoded ARN somewhere in there:
GovCloud is sad.
=== RUN TestAccAWSSecurityHub_serial/Insight/Name
resource_aws_securityhub_insight_test.go:282: Step 1/3 error: Check failed: Check 2/3 error: aws_securityhub_insight.test: Attribute 'arn' didn't match "arn:aws-us-gov:securityhub:us-gov-west-1:357342307427:insight/357342307427/custom/.+$", got "arn:aws:securityhub:us-gov-west-1:357342307427:insight/357342307427/custom/b81d92d3-7ea7-4bda-afd7-aec03030f714"
=== RUN TestAccAWSSecurityHub_serial/Insight/NumberFilters
=== RUN TestAccAWSSecurityHub_serial/Insight/basic
resource_aws_securityhub_insight_test.go:22: Step 1/2 error: Check failed: Check 2/7 error: aws_securityhub_insight.test: Attribute 'arn' didn't match "arn:aws-us-gov:securityhub:us-gov-west-1:357342307427:insight/357342307427/custom/.+$", got "arn:aws:securityhub:us-gov-west-1:357342307427:insight/357342307427/custom/33b4d342-83d3-4ff8-85e2-1909eb7eade9"
=== RUN TestAccAWSSecurityHub_serial/Insight/WorkflowStatus
--- FAIL: TestAccAWSSecurityHub_serial (253.27s)
--- FAIL: TestAccAWSSecurityHub_serial/Insight (253.27s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/IpFilters (19.28s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/disappears (14.82s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/DateFilters (33.30s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/GroupByAttribute (30.23s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/KeywordFilters (17.89s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/MapFilters (19.43s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/MultipleFilters (35.18s)
--- FAIL: TestAccAWSSecurityHub_serial/Insight/Name (10.26s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/NumberFilters (44.91s)
--- FAIL: TestAccAWSSecurityHub_serial/Insight/basic (10.25s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/WorkflowStatus (17.73s)
dd7a520
to
f243ff0
Compare
Output of acceptance tests (GovCloud):
Commercial:
|
f243ff0
to
2978e61
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work! 🎉 It's cool to see the new context stuff in action.
Just a few nits.
Acceptance tests in GovCloud:
--- PASS: TestAccAWSSecurityHub_serial (275.37s)
--- PASS: TestAccAWSSecurityHub_serial/Insight (275.37s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/GroupByAttribute (36.06s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/IpFilters (18.01s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/MultipleFilters (29.80s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/NumberFilters (43.84s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/WorkflowStatus (17.69s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/disappears (15.72s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/DateFilters (31.84s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/KeywordFilters (17.55s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/MapFilters (17.58s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/Name (29.73s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/basic (17.54s)
Acceptance tests in commercial:
--- PASS: TestAccAWSSecurityHub_serial (216.08s)
--- PASS: TestAccAWSSecurityHub_serial/Insight (216.08s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/Name (25.07s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/NumberFilters (34.71s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/WorkflowStatus (14.20s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/basic (14.07s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/disappears (11.97s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/DateFilters (24.90s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/KeywordFilters (14.51s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/MultipleFilters (23.57s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/GroupByAttribute (23.45s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/IpFilters (15.35s)
--- PASS: TestAccAWSSecurityHub_serial/Insight/MapFilters (14.28s)
Co-authored-by: Dirk Avery <31492422+YakDriver@users.noreply.github.com>
Co-authored-by: Dirk Avery <31492422+YakDriver@users.noreply.github.com>
Co-authored-by: Dirk Avery <31492422+YakDriver@users.noreply.github.com>
Co-authored-by: Dirk Avery <31492422+YakDriver@users.noreply.github.com>
b70808f
to
10213f2
Compare
This has been released in version 3.37.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Closes #6674
Output from acceptance testing: