Does somebody have an example of using `Output.all...
# python
c
Does somebody have an example of using
Output.all
with a list? The documentation says that you would use it's
Output
with an
.apply
but I'm uncertain of a practical application for this
f
From our codebase:
Copy code
policy=pulumi.Output.all(*[t.arn for t in tables]).apply(
            lambda arns: json.dumps(
                {
                    "Version": "2012-10-17",
                    "Statement": [
                        {
                            "Effect": "Allow",
                            "Action": [
                                # Read
                                "dynamodb:BatchGetItem",
                                "dynamodb:GetRecords",
                                "dynamodb:GetShardIterator",
                                "dynamodb:Query",
                                "dynamodb:GetItem",
                                "dynamodb:Scan",
                                # Write
                                "dynamodb:BatchWriteItem",
                                "dynamodb:PutItem",
                                "dynamodb:UpdateItem",
                                "dynamodb:DeleteItem",
                            ],
                            "Resource": [a for a in arns],
                        }
                    ],
                }
            )
        ),
Though I suspect that final
[a for a in arns]
is a holdover from a prior refactoring... could probably just be
arns
at this point 😅