Open NemanjaMilenkovic opened 5 months ago
Hi @NemanjaMilenkovic 👋
Thanks for raising this! I just tried to replicate your problem with the latest CDKTF version (0.20.3
) and was unable to do so. It seemed to work for me.
Is transforming snake_case to camelCase expected?
Yes that is expected as CDKTF tries to match the common casing for each target language.
Can you try whether upgrading to CDKTF 0.20.3 fixes your problem? There have been recent fixes related to the problem you are seeing. Although, I think they were related to modules 🤔
If the problem persists, could you post more of your configuration (cdktf.json
) or even a link to a reproducible example? 😊
That said, there seems to be s3Bucket
and s3_bucket
in the fivetran_connector
resource and they seem to do different things. This will cause problems in CDKTF, if the s3Bucket
needs to be set as they collide as far as CDKTF is concerned. To solve this, a manual override could be used (e.g. myConnectorResource.addOverride("s3Bucket", "my-bucket")
) – but I haven't tested that. In general CDKTF assumes snake_cased attribute names, which is why this Terraform provider might not be 100% supported currently.
Hi @ansgarm 👋 Thank you for looking into this!
Yes, as you noticed - that is correct - CDKTF 0.20.3 works as expected. Also, every CDKTF version higher than 0.19 works with no issues.
Our main question was about the difference in CDKTF behaviour in versions before CDKTF version 0.19 and after where schema might be mapped differently but I can't seem to find a reason why or a documented breaking change that would explain it.
This is an example configuration where it is noticed:
Fivetran version: 1.1.11 cdktf version: 0.18.0 (or any version < 0.19.0)
Note: in our current use case, we need to use Fivetran version: 1.1.11 but we would prefer not upgrading CDKTF above version 0.19.0 at this moment.
If CDKTF version > 0.19.0 is used, including the latest CDKTF 0.20.3, there are no issues.
Is there a difference in how CDKTF is handling casing before version 0.19.0 and after?
Hi @ansgarm Just in case you've missed this - is there any additional information needed?
Expected Behavior
Generated Terraform code without errors. Is transforming snake_case to camelCase expected?
Actual Behavior
CDKTF tranfforms snake_case to camelCase which creates duplicates in schema:
Steps to Reproduce
import { Construct } from 'constructs'; import * as fivetran from '../../../.gen/providers/fivetran';
export class FivetranGroup extends Construct { constructor( scope: Construct, id: string, ) { super(scope, id); }
readonly group = new fivetran.group.Group(this, 'example-group', { name: "example-group", });
}
Versions
Fivetran version: 1.1.11 cdktf version: 0.18.0
Providers
No response
Gist
No response
Possible Solutions
No response
Workarounds
No response
Anything Else?
Is there any tool, or setting that allows CDKTF to handle such cases on schema mapping?
References
No response
Help Wanted
Community Note