Skip to content

Conversation

nikolaymatrosov
Copy link

Related issue

Fixes #3915

Description

This PR adds support for StringMapMap type to handle provider schemas that define attributes with map[map[string]] type structure. The yandex-cloud provider (and potentially others) define certain attributes like airflow_config with a nested map structure that wasn't previously supported by the CDKTF code generation.

The implementation includes:

  1. New StringMapMap class: Added to packages/cdktf/lib/complex-computed-list.ts that extends ComplexResolvable and provides a lookup(key: string): StringMap method for accessing nested maps
  2. Provider generator updates: Modified attribute-type-model.ts to detect when the element type is StringMap and generate the appropriate StringMapMap type instead of the generic pattern
  3. Comprehensive tests: Added test fixtures and snapshots to ensure the new functionality works correctly

The fix enables users to successfully generate providers that use nested map structures in their schemas, resolving the JSII compilation errors that were preventing provider generation.

Checklist

  • I have updated the PR title to match CDKTF's style guide
  • I have run the linter on my code locally
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation if applicable
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works if applicable
  • New and existing unit tests pass locally with my changes

@nikolaymatrosov
Copy link
Author

@mutahhir @ansgarm Could you please take a look at this PR when you have a moment? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lib: add StringMapMap class
1 participant