terraform-cdk
terraform-cdk copied to clipboard
Count iterators and count meta-argument
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
In some scenarios (like https://github.com/hashicorp/terraform-cdk/issues/1981#issuecomment-1202720769) users need to use count, so we should support this through an API.
import { TerraformIterator } from "cdktf";
const iterator = TerraformIterator.count(5);
new S3Bucket(this, "s3", {
count: iterator,
name: `bucket-${iterator.index}`
})