Hello guys! Are you guys following any convention...
# help
a
Hello guys! Are you guys following any convention for resources name, logical ID, path ID, etc? I’ve found that recently I broke a bucket because I’ve changed the ID of it, then the logical-id also changed. Now I noticed all my logical-id are shitty, I want to know which is the convention that I should use, and also if the logica-id should contain the stack name, and if it should be camelCase, etc…
For example, the CDK says the logical-id should be:
Copy code
Stack2MyBucket4DD88B4F
But my ID is like.. `MyBucket4DD88B4F`… there is no stack name.
f
Hey @Adrián Mouly, the way CDK construct logical ID is concatenating all it’s ancestor’s ids. In this case,
Stack2
is likely the id of the Stack.
Copy code
Stack2
  \__ MyBucket4DD88B4F
Instead, if u created a dummy construct that wraps around the bucket, ie.
Copy code
Stack2
  \__ MyDummyWrapper
        \__MyBucket4DD88B4F
The ID is going to be
Stack2MyDummyWrapperMyBucket4DD88B4F
In most cases u shouldn’t worry about these ids, they are hidden from u.
a
Ok.
I think it makes sense.