Open ge0Aja opened 1 week ago
You appear to be using SDK v2 based on your code sample. Transferring.
Hi @ge0Aja ,
Thanks for reaching out. If I understand you correctly, your concerns is that when creating an event notification filter the filter name is prefix
but when you are getting the result back from S3 using GetBucketNotificationConfiguration
you get the filter name as Prefix
.
The AWS SDKs are code generated from the API model of each AWS service it interacts with. The reason why the SDK is generated with the Filter Rule names as prefix
and suffix
(lower cased) is because this is how they are modeled in the S3 API model:
"com.amazonaws.s3#FilterRuleName": {
"type": "enum",
"members": {
"prefix": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "prefix"
}
},
"suffix": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "suffix"
}
}
}
},
In addition, the S3 docs also showcase that to create those filter rules those names should be lower cased.
While I agree that this is confusing, the SDK team cannot do anything to change it since model changes must be changed upstream with the S3 service team itself, not on the SDK side. Even if the service decides to change the casing here, from a backwards compatibility standpoint, we wont be able to roll out the change since code that is reliant on the lower cased value will start breaking.
Let me know if I understood your concern, and if you have any questions that we can further assist with.
Thanks, Ran~
Describe the bug
I'm using FilterRuleNames to have a prefix filter when creating an event notification for an S3 bucket. I'm using the const enum values provided by the SDK to create the filter. However, when I query back the created event notification and match against the filter rule name I get empty values. I've checked on the created event notification and the rule seem to be there, but with a different name i.e.
Prefix
instead ofprefix
.Regression Issue
Expected Behavior
I expect to find the created rule using the filter rule name consts provided by the SDK.
Current Behavior
If we iterate over the created filter names we won't be able to match any of the const names provided by the SDK
Reproduction Steps
Create an event notification on an S3 bucket with a filter rule to target a specific prefix for example
Try to query it back again and switch case match using the prefix enum value
prefix
will always be""
Possible Solution
No response
Additional Information/Context
No response
SDK version used
v1.32.2
Environment details (Version of Go (
go version
)? OS name and version, etc.)go 1.23.1 / ubuntu 22.04