Open alFReD-NSH opened 10 months ago
Thank you for the feature request and PR! This is an awesome feature!
Giving this more thoughts, we'll have to think off how the interface would be. This could be applied to resources, conditions and outputs.
Here's two different possibilities, we could create resources for it:
new ForEach(this, 'Queues', queueNames, (scope: Construct, variable: string) => {
new sqs.Queue(scope, 'Test', {
queueName: Token.asString(variable)
})
});
const forEach = new ForEach(this, 'Queues', queueNames);
new sqs.Queue(forEach.childrenScope, 'Test', {
queueName: Token.asString(forEach.identifier)
});
It would be nice to gather more input from CDK core members.
This feature request is open for quite a while... any prevision on when it is coming?
Describe the feature
Fn::ForEach is a new function that is added to cloudformation.
Use Case
Creating multiple resources based on Cloudformation template parameter. I'm deploying CDK generated templates to Service Cataloge.
Proposed Solution
ForEach function in aws-cdk-lib.Fn
Other Information
No response
Acknowledgements
CDK version used
v2.96.2
Environment details (OS name and version, etc.)
Any