With a hint from the jssi issues, I finally managed the CDK escape hatches - https://docs.aws.amazon.com/cdk/v2/guide/cfn_layer.html in GO.
Basic idea is to replace the "any" types defined in the CDK/jsii like:
type CfnBucket_AnalyticsConfigurationProperty struct {
Id *string `json:"id" yaml:"id"`
StorageClassAnalysis interface{} `json:"storageClassAnalysis" yaml:"storageClassAnalysis"`
Prefix *string `json:"prefix" yaml:"prefix"`
TagFilters interface{} `json:"tagFilters" yaml:"tagFilters"`
}
With GoFormation structures, which include all type informations like:
// See:
type Bucket_AnalyticsConfiguration struct {
Id string `json:"Id,omitempty"`
Prefix string `json:"Prefix,omitempty"`
StorageClassAnalysis *Bucket_StorageClassAnalysis `json:"StorageClassAnalysis,omitempty"`
And get rid of the interface{}
.
So: Want to use AWS CDK Escape Hatches as direct Cfnxx Construct modification easy and type-safe in GO-CDK?
Details here:
https://www.go-on-aws.com/infrastructure-as-go/cdk-go/escape-hatches/
What do you think about the methods?
Top comments (0)