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(lib): Introduce TerraformDynamicBlock to enable iterator usage on blocks #1882

Merged
merged 15 commits into from
Jul 22, 2022

Conversation

ansgarm
Copy link
Member

@ansgarm ansgarm commented Jun 16, 2022

Closes #1798

Open tasks

  • Add unit test for error case if TerraformDynamicBlock is used at the wrong position and tried to be resolved (should throw an error; e.g. could happen if passed to a Terraform function)
  • How to handle normal lists (non-block type lists)? Convert to some other expression (using Terraform functions) or at least throw an Error if used at an invalid location. Not sure how to detect this yet.
  • Add edge provider tests for iteration in the various languages
  • Add tests that invoke at least terraform validate to confirm result is valid (might be something to add to edge provider tests)
  • Add docs to iterator docs with an example for block level iteration (in each language) will follow in a separate PR as they will be based on a branch that is not merged yet
  • make sure there are follow-up issues for all new todo: comments in the code base

Copy link
Contributor

@DanielMSchmidt DanielMSchmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, great work! Just a couple of comments :)

packages/cdktf/lib/runtime.ts Show resolved Hide resolved
packages/cdktf/lib/runtime.ts Show resolved Hide resolved
packages/cdktf/lib/terraform-dynamic-block.ts Outdated Show resolved Hide resolved
packages/cdktf/lib/tfExpression.ts Outdated Show resolved Hide resolved
packages/cdktf/lib/tfExpression.ts Show resolved Hide resolved
packages/cdktf/test/helper/data-source.ts Outdated Show resolved Hide resolved
packages/cdktf/test/helper/resource.ts Outdated Show resolved Hide resolved
test/typescript/iterators/main.ts Show resolved Hide resolved
test/typescript/iterators/main.ts Show resolved Hide resolved
test/typescript/iterators/main.ts Show resolved Hide resolved
Copy link
Contributor

@DanielMSchmidt DanielMSchmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides from the missing docs this looks great 👍

@github-actions
Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement block-level iterators
2 participants