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

resource/aws_comprehend_entity_recognizer: New resource #26244

Merged
merged 29 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d1e1d46
Formatting cleanup
gdavison Jul 6, 2022
c297f39
Uses AWS SDK v2 for Comprehend
gdavison Jul 7, 2022
8af3505
Adds tag code generation
gdavison Jul 7, 2022
c85a44a
Adds `aws_comprehend_entity_recognizer` with basic CRD and Import
gdavison Jul 18, 2022
92b8ae7
Moves `testAccPreCheck` to separate file
gdavison Jul 19, 2022
a335aff
Adds Comprehend endpoint ID
gdavison Jul 19, 2022
0d876cb
Waits for model to be trained
gdavison Jul 20, 2022
e58089c
Adds missing documentation
gdavison Jul 20, 2022
a4191e1
Removes `model_policy` from Entity Recognizer
gdavison Jul 20, 2022
d1d3e91
Adds tag support
gdavison Jul 21, 2022
0cb5abf
Adds handling for version name
gdavison Jul 25, 2022
fc63f15
Adds `PKG` parameter for `make test`
gdavison Jul 27, 2022
9d518f3
Adds support for KMS keys
gdavison Jul 27, 2022
7d935d8
Handles version naming and updating KMS keys
gdavison Jul 29, 2022
c82ec9f
Adds VPC and ENI handling
gdavison Aug 6, 2022
f56e614
Updates test to ensure tags are updated when a version is published
gdavison Aug 8, 2022
803d856
Refactors S3 object setup
gdavison Aug 8, 2022
ebedccf
Adds test for specifying testing data set
gdavison Aug 8, 2022
cb3d60d
Cleans up tests
gdavison Aug 8, 2022
5ceec9f
Adds validation
gdavison Aug 9, 2022
cadaef8
Factors out common version publishing
gdavison Aug 10, 2022
fe882de
Fixes error with waiting for ENI detachment
gdavison Aug 10, 2022
36387a2
Updates TeamCity config
gdavison Aug 10, 2022
712e1cb
Adds annotations and generator
gdavison Aug 11, 2022
d954ecb
Adds tests for annotations
gdavison Aug 11, 2022
c5f8565
Adds CHANGELOG entry
gdavison Aug 11, 2022
0590152
Uses `flex` `StringValue` functions
gdavison Aug 11, 2022
ca26e96
Updates semgrep rules for `flex` `StringValueSet` functions
gdavison Aug 11, 2022
6e89d7a
Fixes linting errors
gdavison Aug 11, 2022
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/26244.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
aws_comprehend_entity_recognizer
```
63 changes: 38 additions & 25 deletions .ci/.semgrep-service-name0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2896,92 +2896,105 @@ rules:
patterns:
- pattern-regex: "(?i)CognitoIDP"
severity: WARNING
- id: configservice-in-func-name
- id: comprehend-in-func-name
languages:
- go
message: Do not use "ConfigService" in func name inside configservice package
message: Do not use "Comprehend" in func name inside comprehend package
paths:
include:
- internal/service/configservice
- internal/service/comprehend
patterns:
- pattern: func $NAME( ... ) { ... }
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)ConfigService"
- pattern-regex: "(?i)Comprehend"
- pattern-not-regex: ^TestAcc.*
severity: WARNING
- id: configservice-in-test-name
- id: comprehend-in-test-name
languages:
- go
message: Include "ConfigService" in test name
message: Include "Comprehend" in test name
paths:
include:
- internal/service/configservice/*_test.go
- internal/service/comprehend/*_test.go
patterns:
- pattern: func $NAME( ... ) { ... }
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-not-regex: "^TestAccConfigService"
- pattern-not-regex: "^TestAccComprehend"
- pattern-regex: ^TestAcc.*
severity: WARNING
- id: configservice-in-const-name
- id: comprehend-in-const-name
languages:
- go
message: Do not use "ConfigService" in const name inside configservice package
message: Do not use "Comprehend" in const name inside comprehend package
paths:
include:
- internal/service/configservice
- internal/service/comprehend
patterns:
- pattern: const $NAME = ...
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)ConfigService"
- pattern-regex: "(?i)Comprehend"
severity: WARNING
- id: configservice-in-var-name
- id: comprehend-in-var-name
languages:
- go
message: Do not use "ConfigService" in var name inside configservice package
message: Do not use "Comprehend" in var name inside comprehend package
paths:
include:
- internal/service/configservice
- internal/service/comprehend
patterns:
- pattern: var $NAME = ...
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)ConfigService"
- pattern-regex: "(?i)Comprehend"
severity: WARNING
- id: connect-in-func-name
- id: configservice-in-func-name
languages:
- go
message: Do not use "Connect" in func name inside connect package
message: Do not use "ConfigService" in func name inside configservice package
paths:
include:
- internal/service/connect
- internal/service/configservice
patterns:
- pattern: func $NAME( ... ) { ... }
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)Connect"
- pattern-not-regex: .*uickConnect.*
- pattern-regex: "(?i)ConfigService"
- pattern-not-regex: ^TestAcc.*
severity: WARNING
- id: connect-in-test-name
- id: configservice-in-test-name
languages:
- go
message: Include "Connect" in test name
message: Include "ConfigService" in test name
paths:
include:
- internal/service/connect/*_test.go
- internal/service/configservice/*_test.go
patterns:
- pattern: func $NAME( ... ) { ... }
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-not-regex: "^TestAccConnect"
- pattern-not-regex: "^TestAccConfigService"
- pattern-regex: ^TestAcc.*
severity: WARNING
- id: configservice-in-const-name
languages:
- go
message: Do not use "ConfigService" in const name inside configservice package
paths:
include:
- internal/service/configservice
patterns:
- pattern: const $NAME = ...
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)ConfigService"
severity: WARNING
75 changes: 45 additions & 30 deletions .ci/.semgrep-service-name1.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
# Generated by internal/generate/servicesemgrep/main.go; DO NOT EDIT.
rules:
- id: configservice-in-var-name
languages:
- go
message: Do not use "ConfigService" in var name inside configservice package
paths:
include:
- internal/service/configservice
patterns:
- pattern: var $NAME = ...
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)ConfigService"
severity: WARNING
- id: connect-in-func-name
languages:
- go
message: Do not use "Connect" in func name inside connect package
paths:
include:
- internal/service/connect
patterns:
- pattern: func $NAME( ... ) { ... }
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)Connect"
- pattern-not-regex: .*uickConnect.*
- pattern-not-regex: ^TestAcc.*
severity: WARNING
- id: connect-in-test-name
languages:
- go
message: Include "Connect" in test name
paths:
include:
- internal/service/connect/*_test.go
patterns:
- pattern: func $NAME( ... ) { ... }
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-not-regex: "^TestAccConnect"
- pattern-regex: ^TestAcc.*
severity: WARNING
- id: connect-in-const-name
languages:
- go
Expand Down Expand Up @@ -2957,33 +3002,3 @@ rules:
patterns:
- pattern-regex: "(?i)ImageBuilder"
severity: WARNING
- id: inspector-in-func-name
languages:
- go
message: Do not use "Inspector" in func name inside inspector package
paths:
include:
- internal/service/inspector
patterns:
- pattern: func $NAME( ... ) { ... }
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)Inspector"
- pattern-not-regex: ^TestAcc.*
severity: WARNING
- id: inspector-in-test-name
languages:
- go
message: Include "Inspector" in test name
paths:
include:
- internal/service/inspector/*_test.go
patterns:
- pattern: func $NAME( ... ) { ... }
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-not-regex: "^TestAccInspector"
- pattern-regex: ^TestAcc.*
severity: WARNING
44 changes: 30 additions & 14 deletions .ci/.semgrep-service-name2.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Generated by internal/generate/servicesemgrep/main.go; DO NOT EDIT.
rules:
- id: inspector-in-func-name
languages:
- go
message: Do not use "Inspector" in func name inside inspector package
paths:
include:
- internal/service/inspector
patterns:
- pattern: func $NAME( ... ) { ... }
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)Inspector"
- pattern-not-regex: ^TestAcc.*
severity: WARNING
- id: inspector-in-test-name
languages:
- go
message: Include "Inspector" in test name
paths:
include:
- internal/service/inspector/*_test.go
patterns:
- pattern: func $NAME( ... ) { ... }
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-not-regex: "^TestAccInspector"
- pattern-regex: ^TestAcc.*
severity: WARNING
- id: inspector-in-const-name
languages:
- go
Expand Down Expand Up @@ -2968,17 +2998,3 @@ rules:
patterns:
- pattern-regex: "(?i)Redshift"
severity: WARNING
- id: redshift-in-var-name
languages:
- go
message: Do not use "Redshift" in var name inside redshift package
paths:
include:
- internal/service/redshift
patterns:
- pattern: var $NAME = ...
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)Redshift"
severity: WARNING
14 changes: 14 additions & 0 deletions .ci/.semgrep-service-name3.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Generated by internal/generate/servicesemgrep/main.go; DO NOT EDIT.
rules:
- id: redshift-in-var-name
languages:
- go
message: Do not use "Redshift" in var name inside redshift package
paths:
include:
- internal/service/redshift
patterns:
- pattern: var $NAME = ...
- metavariable-pattern:
metavariable: $NAME
patterns:
- pattern-regex: "(?i)Redshift"
severity: WARNING
- id: redshiftdata-in-func-name
languages:
- go
Expand Down
13 changes: 10 additions & 3 deletions .ci/.semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,18 @@ rules:

- id: helper-schema-Set-extraneous-NewSet-with-flattenStringList
languages: [go]
message: Prefer `flex.FlattenStringSet()` function for casting a list of string pointers to a set
message: Prefer `flex.FlattenStringSet()` or `flex.FlattenStringValueSet()`
paths:
include:
- internal/
pattern: schema.NewSet(schema.HashString, flex.FlattenStringList($APIOBJECT))
patterns:
- pattern: schema.NewSet(schema.HashString, flex.FlattenStringList($APIOBJECT))
- pattern: schema.NewSet(schema.HashString, flex.FlattenStringValueList($APIOBJECT))
severity: WARNING

- id: helper-schema-Set-extraneous-expandStringList-with-List
languages: [go]
message: Prefer `flex.ExpandStringSet()` function for casting a set to a list of string pointers
message: Prefer `flex.ExpandStringSet()` or `flex.ExpandStringValueSet()`
paths:
include:
- internal/
Expand All @@ -178,6 +180,11 @@ rules:
$LIST := $SET.List()
...
flex.ExpandStringList($LIST)
- pattern: flex.ExpandStringValueList($SET.List())
- pattern: |
$LIST := $SET.List()
...
flex.ExpandStringValueList($LIST)
severity: WARNING

- id: helper-schema-ResourceData-GetOk-with-extraneous-conditional
Expand Down
1 change: 1 addition & 0 deletions .teamcity/components/generated/services_all.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ val services = mapOf(
"codestarnotifications" to ServiceSpec("CodeStar Notifications"),
"cognitoidentity" to ServiceSpec("Cognito Identity"),
"cognitoidp" to ServiceSpec("Cognito IDP (Identity Provider)"),
"comprehend" to ServiceSpec("Comprehend", parallelismOverride = 10),
"configservice" to ServiceSpec("Config"),
"connect" to ServiceSpec("Connect"),
"cur" to ServiceSpec("Cost and Usage Report"),
Expand Down
1 change: 1 addition & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ACCTEST_PARALLELISM ?= 20

ifneq ($(origin PKG), undefined)
PKG_NAME = internal/service/$(PKG)
TEST = ./$(PKG_NAME)/...
endif

ifneq ($(origin TESTS), undefined)
Expand Down
6 changes: 3 additions & 3 deletions docs/resource-name-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestAccServiceThing_nameGenerated(t *testing.T) {
Config: testAccThingConfig_nameGenerated(),
Check: resource.ComposeTestCheckFunc(
testAccCheckThingExists(resourceName, &thing),
create.TestCheckResourceAttrNameGenerated(resourceName, "name"),
acctest.CheckResourceAttrNameGenerated(resourceName, "name"),
resource.TestCheckResourceAttr(resourceName, "name_prefix", resource.UniqueIdPrefix),
),
},
Expand Down Expand Up @@ -93,7 +93,7 @@ func TestAccServiceThing_namePrefix(t *testing.T) {
Config: testAccThingConfig_namePrefix("tf-acc-test-prefix-"),
Check: resource.ComposeTestCheckFunc(
testAccCheckThingExists(resourceName, &thing),
create.TestCheckResourceAttrNameFromPrefix(resourceName, "name", "tf-acc-test-prefix-"),
acctest.CheckResourceAttrNameFromPrefix(resourceName, "name", "tf-acc-test-prefix-"),
resource.TestCheckResourceAttr(resourceName, "name_prefix", "tf-acc-test-prefix-"),
),
},
Expand Down Expand Up @@ -156,4 +156,4 @@ d.Set("name", resp.Name)
d.Set("name_prefix", create.NamePrefixFromNameWithSuffix(aws.StringValue(resp.Name), ".fifo"))
```

There are also functions `create.TestCheckResourceAttrNameWithSuffixGenerated` and `create.TestCheckResourceAttrNameWithSuffixFromPrefix` for use in tests.
There are also functions `acctest.CheckResourceAttrNameWithSuffixGenerated` and `acctest.CheckResourceAttrNameWithSuffixFromPrefix` for use in tests.
Loading