Open toyotest2 opened 1 month ago
Hi @toyotest2 , thanks for reaching out and linking the related docs available. I found this issue mentioned in the workshop doc which was further fixed by the PR.
Considering the usecase, it would be helpful to have the mentioned support for GO as well. Marking the issue as P2 as L2 constructs are available. P2 would mean it would not be immediately addressed by the team but would be on their radar.
Although I'm very surprised that missing Go support for L1 would be a P2 issue (considering there's no workaround), L1 resources are fully supported in Go as far as I understand, and escape hatches work with jsii.UnsafeCast
. Am I missing something?
Hi @gshpychka , I understand your point of view here. I marked it as P2 as escape hatches are available in other languages and I am not sure supporting this for GO is on the team roadmap.
I would reach out to team on this if they have this in their future action items or something to be considered a priority.
I am not sure supporting L1 construct for GO is on the team roadmap.
My understanding is that it's already supported, but I may be missing something.
Let me recheck the docs and get back as I am not very familiar with GO language and the provided support by CDK or cloudformation. Apologies for the confusion there.
Hey @gshpychka , thanks for double checking and sharing your insights here.
The Go constructs and way of usage are very different and I think I got stumped by that, my bad. It is correct in saying the L1 constructs support as well Escape hatch support is already there, however we need to provide better samples for the GO CDK usage in the docs.
Sharing the CDK GO construct and props ref.
Constructs, which represent one or more AWS resources and their associated attributes, are represented in Go as interfaces
So let me clarify a bit on my earlier statements as per my understanding -
First, CDK has L2 Construct that allows you to build resources according to best practices by simply specifying a few required values.
L2 constructs are built on L1 construct with abstraction, which allows you to build resources by specifying them in a manner consistent with CloudFormation.
While L2 Construct is convenient and easy to create resources, it also abstracts parameters, so there are some parameters that might not be specified in L2.
Therefore, Escape Hatch come into picture - these provide a way to cast a resource created with L2 Construct to an L1 Construct type and later override the parameters that can only be specified with L1.
but its mentioned in the workshop page -
However, the CDK for Go does not currently support escape hatch according to [the workshop](https://catalog.us-east-1.prod.workshops.aws/workshops/d93fec4c-fb0f-4813-ac90-758cb5527f2f/en-US/walkthrough/go/sample/source-construct/s3-bucket).
which seems confusing but the issue mentioned in above workshop also seems to be resolved and implemented.
Also given that PR and its implementation , it makes sense to have its support by jsii.UnsafeCast
(though it might not be applicable in every service parameter scenario).
I found an article on Escape hatch support for CDK GO, please feel free to check this out - https://www.go-on-aws.com/infrastructure-as-go/cdk-go/escape-hatches/
So in a nutshell. yes Escape hatches are there.
and here is a complete Dev guide of CDK with GO language for the reference - https://pkg.go.dev/github.com/aws/aws-cdk-go/awscdk/v2
@toyotest2 , as better examples could be provided in case of GO CDK, I would submit the page feedback which is located on the top right corner. And also adding documentation
label to this issue.
@gshpychka , hope that makes sense! Thanks for the correction!
Describe the feature
Request: Escape hatches: Go Lang Support
I could not find any Go language samples in the documentation below. https://docs.aws.amazon.com/cdk/v2/guide/cfn_layer.html
Additionally, I found the following comments at the workshop.
https://catalog.us-east-1.prod.workshops.aws/workshops/d93fec4c-fb0f-4813-ac90-758cb5527f2f/en-US/walkthrough/go/sample/source-construct/s3-bucket
Use Case
For Customize L2/L3 Constructs in Go Lang.
Proposed Solution
No response
Other Information
No response
Acknowledgements
CDK version used
2.162.1
Environment details (OS name and version, etc.)
Cloud9AmazonLinux2023-2024-10-21T21-56