https://pulumi.com logo
Title
e

elegant-dog-76355

02/27/2023, 5:36 PM
I am trying to understand the following code a bit better ... New to
python
and
pulumi
queue = aws.sqs.Queue("queue")
test = aws.sqs.QueuePolicy("test",
queue_url=queue.id,
policy = queue.arn.apply( lambda arn: f"""{{
On the line
policy = queue.arn.apply(lambda arn:
I do not understand what the key words
lambda
and
arn
relate to or what they are doing here ... I know what they are in AWS world but don't understand what there function is here. Any explanation or points to doc would be great.
e

echoing-dinner-19531

02/27/2023, 5:48 PM
That's a lambda expression, or anonymous function. Just a standard part of python, not pulumi specific: https://docs.python.org/3/reference/expressions.html#lambda
e

elegant-dog-76355

02/27/2023, 5:49 PM
ah! thank you, this what i needed but couldn't find
s

sticky-bear-14421

03/01/2023, 1:17 PM
You need these lambda expressions to kind of wait for resources being created. It is the method to cope with the async nature of resources who need a longer time being created.