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
I am using AWS CDK on Python and would like to create SQS which has dead letter queue and want to add redrive allow policy to let only associated queue and redrive it.
Here is my sample code
fromaws_cdkimportsqsfromconstructsimportConstructclassMyStack(Stack):
def__init__(
self,
scope: Construct,
construct_id: str,
**kwargs,
) ->None:
super().__init__(scope, construct_id, **kwargs)
dead_letter_queue=sqs.Queue(
self,
dead_letter_queue_name,
queue_name=f"{dead_letter_queue_name}",
redrive_allow_policy=sqs.RedriveAllowPolicy(
redrive_permission=sqs.RedrivePermission.BY_QUEUE,
source_queues=[queue], # Require source IQueue (source queue) to be created first
),
)
queue=sqs.Queue(
self,
queue_name,
queue_name=f"{queue_name}",
dead_letter_queue=sqs.DeadLetterQueue(
max_receive_count=3,
queue=dead_letter_queue, # Require dead letter queue to be created first
),
)
Both of them require each other to be created first, I am just newbie on CDK so how can I solve this problem.
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
-
I am using AWS CDK on Python and would like to create SQS which has dead letter queue and want to add redrive allow policy to let only associated queue and redrive it.
Here is my sample code
Both of them require each other to be created first, I am just newbie on CDK so how can I solve this problem.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions