-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Overriding allocateLogicalId not Working Python #8343
Comments
I think I was able to get around it by setting the specific name parameters for the construct, but I'm not sure if that's the proper way to approach it. |
@RomainMuller any idea? |
@SKIIDK - would you be able to show us the code you're using for your override attempt that is not working? Bonus points if that is stripped to a minimal reproduction 😬 |
I ended up being able to get around it just by specifying the name parameters, but the override methods mentioned in that other thread don't seem the actual way to do it. |
@RomainMuller here is my sample. queue_name = 'my-queue'
queue = sqs.Queue(self, queue_name,
visibility_timeout=core.Duration.seconds(300),
receive_message_wait_time=core.Duration.seconds(20),
encryption=sqs.QueueEncryption.KMS
)
cfnQueue = queue.node.default_child
cfnQueue.override_logical_id("myqueue") after running I am not sure about @SKIIDK recommendation there is no |
I was able to override Here is the example code translated: class TestStack(Stack):
def _allocate_logical_id(self, cfn_element: CfnElement) -> str:
return cfn_element.node.id Environment:
|
❓ General Issue
The Question
I am trying to override the allocateLogicalId method in order to have an ARN without extraneous hash characters afterwards, but this does not seem to be working in Python. The TypeScript version was described by @skinny85 in #1424 , but when translating to Python, overriding allocate_logical_id does not seem to have an impact on the logical id's or the ARN's made from those id's.
Environment
Other information
Doing
my_resource.node.default_child.override_logical_id('new name')
also doesn't seem to actually modify the names in the CDK and the names continue to have the hash characters following them.The text was updated successfully, but these errors were encountered: