-
My question is about defaulting indentifiers in Resources. let's say I have an resource s3 now I want to crete a bucket but I do not want to give it an explicit name because I do not care about the name. I would like to have some meta code that will implicitly generate some specificly prefixed name for me.
My motivation is using it for test where user do not care about the names - but since the names will be prefixed then It would be easy to recognize and remove such buckets in teardown. I did not manage to use events for this purpose - should it be possible using them or is there any other way? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
Hi @LadMartin, You mentioned that you did not manage to use |
Beta Was this translation helpful? Give feedback.
-
@LadMartin This worked for me:
|
Beta Was this translation helpful? Give feedback.
-
Hi @LadMartin, The event system while useful in this case will not communicate the ID of the request back to Hope this helps! |
Beta Was this translation helpful? Give feedback.
Hi @LadMartin,
On deeper analysis, I found that a better workaround might be to use UUID to generate a random ID and then append it to the bucket explicitly instead when making a function call.
The event system while useful in this case will not communicate the ID of the request back to
client.create_bucket()
as theBUCKET_NAME
is passed implicitly through events, hence resulting in the bucket being created but the response being printed as empty as thecreate_bucket()
method does not have the request ID to track the appropriate response for the same.Hope this helps!