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

cloudformation-include: Support Fn::ForEach #27315

Open
2 tasks
faridnsh opened this issue Sep 27, 2023 · 2 comments
Open
2 tasks

cloudformation-include: Support Fn::ForEach #27315

faridnsh opened this issue Sep 27, 2023 · 2 comments
Labels
@aws-cdk/cloudformation-include Issues related to the "CFN include v.20" package effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@faridnsh
Copy link

Describe the feature

cloudformation-include fails when a template with Fn::Foreach resource is passed as it tries to convert it to a CfnResource, but it's not exactly a resource so it doesn't have a type property:

jsii.errors.JavaScriptError:
  Error: The `type` property is required
      at new CfnResource (C:\Users\483413\AppData\Local\Temp\2\jsii-kernel-d3l9Pa\node_modules\aws-cdk-lib\core\lib\cfn-resource.js:1:1194)
      at CfnInclude.getOrCreateResource (C:\Users\483413\AppData\Local\Temp\2\jsii-kernel-d3l9Pa\node_modules\aws-cdk-lib\cloudformation-include\lib\cfn-include.js:1:13061)
      at new CfnInclude (C:\Users\483413\AppData\Local\Temp\2\jsii-kernel-d3l9Pa\node_modules\aws-cdk-lib\cloudformation-include\lib\cfn-include.js:1:2011)
      at Kernel._Kernel_create (C:\Users\483413\AppData\Local\Temp\2\tmpdsxxbqtf\lib\program.js:10071:25)
      at Kernel.create (C:\Users\483413\AppData\Local\Temp\2\tmpdsxxbqtf\lib\program.js:9742:93)
      at KernelHost.processRequest (C:\Users\483413\AppData\Local\Temp\2\tmpdsxxbqtf\lib\program.js:11658:36)
      at KernelHost.run (C:\Users\483413\AppData\Local\Temp\2\tmpdsxxbqtf\lib\program.js:11618:22)
      at Immediate._onImmediate (C:\Users\483413\AppData\Local\Temp\2\tmpdsxxbqtf\lib\program.js:11619:46)
      at processImmediate (node:internal/timers:466:21)

Use Case

Trying to use Fn::ForEach in cloudformation to create multiple resources based on custom resource output and bring that to my CDK stack but cloudformation-include.CfnInclude doesn't support Fn::ForEach.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

v2.98.0

Environment details (OS name and version, etc.)

any

@faridnsh faridnsh added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Sep 27, 2023
@github-actions github-actions bot added the @aws-cdk/cloudformation-include Issues related to the "CFN include v.20" package label Sep 27, 2023
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Sep 27, 2023
@khushail
Copy link
Contributor

Hi @alFReD-NSH ,thanks for reporting this.

@khushail khushail added p1 effort/medium Medium work item – several days of effort and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Sep 27, 2023
@pahud pahud added p2 and removed p1 labels Jun 11, 2024
@jaecktec
Copy link
Contributor

jaecktec commented Aug 9, 2024

This is related to #27211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/cloudformation-include Issues related to the "CFN include v.20" package effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

4 participants