You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, as I was researching the topic of importing CloudFormation templates into CDK (using CfnInclude module) and transforming L1 constructs to L2 constructs, the documentation got me a little bit confused.
If you have an L1 construct, such as CfnBucket, you can create a new L2 construct (Bucket in this case) to wrap the L1 construct.
From my understanding, this is not entirely true as you can only go from s3.CfnBucket to s3.IBucket type (not s3.Bucket), and the same applies to other types of resources (e.g., going from cloudfront.CfnDistribution to cloudfront.IDistribution but not cloudfront.Distribution).
In the next paragraph, it's stated that:
L2 constructs created from L1 constructs are proxy objects that refer to the L1 resource, similar to those created from resource names, ARNs, or lookups.
Here are some of the questions I would like to get clarified:
Does that mean that both s3.IBucket and s3.Bucket are considered L2 constructs?
Would it be correct to state that proxy objects will always be instances of the "interface" types such as IBucket or IDistribution?
Do I understand it correctly that it's not possible to transform e.g., CfnBucket (L1) to Bucket (L2) constructs? (only to IBucket which is also considered L2 construct)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, as I was researching the topic of importing CloudFormation templates into CDK (using CfnInclude module) and transforming L1 constructs to L2 constructs, the documentation got me a little bit confused.
In the Use un-escape hatches section it's mentioned that:
From my understanding, this is not entirely true as you can only go from
s3.CfnBucket
tos3.IBucket
type (nots3.Bucket
), and the same applies to other types of resources (e.g., going fromcloudfront.CfnDistribution
tocloudfront.IDistribution
but notcloudfront.Distribution
).In the next paragraph, it's stated that:
Here are some of the questions I would like to get clarified:
s3.IBucket
ands3.Bucket
are considered L2 constructs?IBucket
orIDistribution
?CfnBucket
(L1) toBucket
(L2) constructs? (only toIBucket
which is also considered L2 construct)Thank you for help.
Beta Was this translation helpful? Give feedback.
All reactions