-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(aws-ec2): FlowLog DestinationOptions have wrong casing #25432
Comments
I can see that the wrong casing is getting generated. This has been the case ever since the feature was first introduced in Lines 92 to 107 in 8189fbe
That said, I'm not running into any errors both on |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
So when I use the factory method the wrong options (lowercased) get synthesized "FlowLog3CB084E9": {
"Type": "AWS::EC2::FlowLog",
"Properties": {
"ResourceId": {
"Fn::GetAtt": [
"TransitGateway",
"Id"
]
},
"ResourceType": "TransitGateway",
"DestinationOptions": {
"fileFormat": "plain-text",
"perHourPartition": false,
"hiveCompatiblePartitions": false
},
"LogDestination": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":s3:::aws-tgw-flow-logs-**********-eu-west-1"
]
]
},
"LogDestinationType": "s3"
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain",
"Metadata": {
"aws:cdk:path": "transit-gateway-dev/FlowLog/FlowLog"
}
} So either way the only way the CDK currently generates these options is in lowercase, which is also how I understand the code because here
which only has the lowercase keys: aws-cdk/packages/aws-cdk-lib/aws-ec2/lib/vpc-flow-logs.ts Lines 122 to 144 in 8ef0ba2
@peterwoodworth What exactly did you test to generate the correct options? Because the default is to omit |
I'm only generating the correct casing on the two specific versions I mentioned (2.55.0, 2.56.0). What I meant was that it successfully deploys for me anyway, for some reason, even with the wrong casing. In the meantime while we decide how to best address this in our construct library, you can use escape hatches to override the output CDK creates. |
@matthias-pichler-warrify thanks for reporting this. I was also able to replicate this issue. To implement @peterwoodworth's suggestion on escape hatches you can do the following as a temporary fix until we solve this issue: const cfnFlowLog = flowLog.node.defaultChild as CfnFlowLog;
// Delete incorrect lower-cased properties
cfnFlowLog.addPropertyDeletionOverride('DestinationOptions.fileFormat');
cfnFlowLog.addPropertyDeletionOverride('DestinationOptions.hiveCompatiblePartitions');
cfnFlowLog.addPropertyDeletionOverride('DestinationOptions.perHourPartition');
// Add correct properties
cfnFlowLog.addPropertyOverride('DestinationOptions.FileFormat', FlowLogFileFormat.PLAIN_TEXT);
cfnFlowLog.addPropertyOverride('DestinationOptions.HiveCompatiblePartitions', false);
cfnFlowLog.addPropertyOverride('DestinationOptions.PerHourPartition', false); |
Describe the bug
When I create a FlowLog like so:
the destination options are not set correctly
Expected Behavior
When setting the options here they should be first transformed to pascal case
Current Behavior
During deploy time I get the following warnings:
Reproduction Steps
Deploy the above resource
Possible Solution
Additional Information/Context
No response
CDK CLI Version
2.77.0
Framework Version
2.77.0
Node.js Version
18
OS
MacOS
Language
Typescript
Language Version
TypeScript 5.0.4
Other information
No response
The text was updated successfully, but these errors were encountered: