I am trying to understand the following code a bit...
# python
e
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
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
ah! thank you, this what i needed but couldn't find
s
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.