Skip to content

Commit

Permalink
service/wafv2: Initial service client and tagging implementation
Browse files Browse the repository at this point in the history
Reference: #11046

Following the [Contributing Guide](https://github.com/terraform-providers/terraform-provider-aws/blob/master/.github/CONTRIBUTING.md#new-service).

Output from acceptance testing:

```
--- PASS: TestAccAWSProvider_Endpoints_Deprecated (3.08s)
--- PASS: TestAccAWSProvider_Endpoints (3.10s)
```
  • Loading branch information
bflad committed Dec 6, 2019
1 parent f573465 commit 8d649bf
Show file tree
Hide file tree
Showing 16 changed files with 13,569 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .hashibot.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ behavior "regexp_issue_labeler_v2" "service_labels" {
"aws_waf_",
"aws_wafregional_",
],
"service/wafv2" = [
"aws_wafv2_",
],
"service/workdocs" = [
"aws_workdocs_",
],
Expand Down Expand Up @@ -1164,6 +1167,10 @@ behavior "pull_request_path_labeler" "service_labels" {
"**/*_wafregional_*",
"**/wafregional_*"
]
"service/wafv2" = [
"**/*_wafv2_*",
"**/wafv2_*",
]
"service/workdocs" = [
"**/*_workdocs_*",
"**/workdocs_*"
Expand Down
3 changes: 3 additions & 0 deletions aws/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ import (
"github.com/aws/aws-sdk-go/service/transfer"
"github.com/aws/aws-sdk-go/service/waf"
"github.com/aws/aws-sdk-go/service/wafregional"
"github.com/aws/aws-sdk-go/service/wafv2"
"github.com/aws/aws-sdk-go/service/worklink"
"github.com/aws/aws-sdk-go/service/workspaces"
"github.com/aws/aws-sdk-go/service/xray"
Expand Down Expand Up @@ -319,6 +320,7 @@ type AWSClient struct {
transferconn *transfer.Transfer
wafconn *waf.WAF
wafregionalconn *wafregional.WAFRegional
wafv2conn *wafv2.WAFV2
worklinkconn *worklink.WorkLink
workspacesconn *workspaces.WorkSpaces
xrayconn *xray.XRay
Expand Down Expand Up @@ -514,6 +516,7 @@ func (c *Config) Client() (interface{}, error) {
transferconn: transfer.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["transfer"])})),
wafconn: waf.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["waf"])})),
wafregionalconn: wafregional.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["wafregional"])})),
wafv2conn: wafv2.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["wafv2"])})),
worklinkconn: worklink.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["worklink"])})),
workspacesconn: workspaces.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["workspaces"])})),
xrayconn: xray.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["xray"])})),
Expand Down
5 changes: 5 additions & 0 deletions aws/internal/keyvaluetags/generators/listtags/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ var serviceNames = []string{
"transfer",
"waf",
"wafregional",
"wafv2",
"workspaces",
}

Expand Down Expand Up @@ -316,6 +317,8 @@ func ServiceListTagsInputIdentifierField(serviceName string) string {
return "ResourceARN"
case "wafregional":
return "ResourceARN"
case "wafv2":
return "ResourceARN"
default:
return "ResourceArn"
}
Expand Down Expand Up @@ -372,6 +375,8 @@ func ServiceListTagsOutputTagsField(serviceName string) string {
return "TagInfoForResource.TagList"
case "wafregional":
return "TagInfoForResource.TagList"
case "wafv2":
return "TagInfoForResource.TagList"
case "workspaces":
return "TagList"
default:
Expand Down
1 change: 1 addition & 0 deletions aws/internal/keyvaluetags/generators/servicetags/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ var sliceServiceNames = []string{
"transfer",
"waf",
"wafregional",
"wafv2",
"workspaces",
}

Expand Down
3 changes: 3 additions & 0 deletions aws/internal/keyvaluetags/generators/updatetags/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ var serviceNames = []string{
"transfer",
"waf",
"wafregional",
"wafv2",
"workspaces",
}

Expand Down Expand Up @@ -380,6 +381,8 @@ func ServiceTagInputIdentifierField(serviceName string) string {
return "ResourceARN"
case "wafregional":
return "ResourceARN"
case "wafv2":
return "ResourceARN"
case "workspaces":
return "ResourceId"
default:
Expand Down
18 changes: 18 additions & 0 deletions aws/internal/keyvaluetags/list_tags_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ import (
"github.com/aws/aws-sdk-go/service/transfer"
"github.com/aws/aws-sdk-go/service/waf"
"github.com/aws/aws-sdk-go/service/wafregional"
"github.com/aws/aws-sdk-go/service/wafv2"
"github.com/aws/aws-sdk-go/service/workspaces"
)

Expand Down Expand Up @@ -283,6 +284,8 @@ func ServiceClientType(serviceName string) string {
funcType = reflect.TypeOf(waf.New)
case "wafregional":
funcType = reflect.TypeOf(wafregional.New)
case "wafv2":
funcType = reflect.TypeOf(wafv2.New)
case "workspaces":
funcType = reflect.TypeOf(workspaces.New)
default:
Expand Down
28 changes: 28 additions & 0 deletions aws/internal/keyvaluetags/service_tags_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions aws/internal/keyvaluetags/update_tags_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions aws/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,7 @@ func init() {
"transfer",
"waf",
"wafregional",
"wafv2",
"worklink",
"workspaces",
"xray",
Expand Down
Loading

0 comments on commit 8d649bf

Please sign in to comment.