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

feat(wafv2): add webacl #2152

Merged
merged 1 commit into from
Feb 28, 2025
Merged
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
2 changes: 2 additions & 0 deletions apis/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ import (
transferv1alpha1 "github.com/crossplane-contrib/provider-aws/apis/transfer/v1alpha1"
awsv1alpha1 "github.com/crossplane-contrib/provider-aws/apis/v1alpha1"
awsv1beta1 "github.com/crossplane-contrib/provider-aws/apis/v1beta1"
wafv2v1alpha1 "github.com/crossplane-contrib/provider-aws/apis/wafv2/v1alpha1"
)

func init() {
Expand Down Expand Up @@ -175,6 +176,7 @@ func init() {
servicecatalogv1alpha1.SchemeBuilder.AddToScheme,
s3control.SchemeBuilder.AddToScheme,
firehosev1alpha1.SchemeBuilder.AddToScheme,
wafv2v1alpha1.SchemeBuilder.AddToScheme,
)
}

Expand Down
69 changes: 69 additions & 0 deletions apis/wafv2/disabled-generator-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# NOTE(teeverr): this config file was used for ACK generation(make services SERVICES=wafv2) via ack-code-generator v0.38.1,
# then these types were backported to v0.26.1(current version in January 2025), and then the controller code was generated(make generate) by ack-code-generator v0.26.1.
# The reason is that ack-code-generator supports empty shapes(https://github.com/aws-controllers-k8s/code-generator/pull/536) and
# set: ignore directive(https://github.com/aws-controllers-k8s/code-generator/pull/464) only since version v0.38.0.
# But github.com/aws-controllers-k8s/code-generator v0.38.0 and higher brings a lot of other changes: 1) it automatically detects new aws resources
# for cloudfront, cloudwatchlogs, eks, elasticache, elbv2, prometheuservice, s3control 2) breaks camelcase naming pattern for some fields, for instance
# RecrawlPolicy(glue crawler) field becomes RECrawler 3) Controller servicecatalog/provisionedproduct(probably something else) loses some methods of `external` object.
# 4) Every crd has changes in description of fields (primary it is about indents/new lines)
# So these massive changes definitely require a dedicated PR, and until that I disabled this config.
---
ignore:
resource_names:
- APIKey
- IPSet
- RegexPatternSet
- RuleGroup
field_paths:
- CreateWebACLInput.Name
- UpdateWebACLInput.Name
- DeleteWebACLInput.Name
- GetWebACLInput.Name
- WebACL.Rules.Statement.AndStatement
- WebACL.Rules.Statement.OrStatement
- WebACL.Rules.Statement.NotStatement
- WebACL.Rules.Statement.ManagedRuleGroupStatement.ScopeDownStatement
- WebACL.Rules.Statement.RateBasedStatement.ScopeDownStatement
empty_shapes:
- All
- Method
- UriPath
- QueryString
- AllQueryArguments
- RateLimitIP
- RateLimitForwardedIP
- RateLimitHTTPMethod
- NoneAction
operations:
GetWebACL:
output_wrapper_field_path: WebACL
resources:
WebACL:
fields:
# The statements below have infinite recursion(e.g. Statement.AndStatement.Statements contains list of Statement), so it's ignored and replaced with a string. The controller expects json string for these fields.
Rules.Statement.AndStatement:
type: string
set:
- ignore: "all"
Rules.Statement.OrStatement:
type: string
set:
- ignore: "all"
Rules.Statement.NotStatement:
type: string
set:
- ignore: "all"
Rules.Statement.ManagedRuleGroupStatement.ScopeDownStatement:
type: string
set:
- ignore: "all"
Rules.Statement.RateBasedStatement.ScopeDownStatement:
type: string
set:
- ignore: "all"
Rules.Statement.ByteMatchStatement.TextTransformations.Type:
go_tag: json:"type,omitempty"
exceptions:
errors:
404:
code: ResourceNotFoundException
Loading
Loading