quaint-soccer-82419
10/29/2024, 4:43 PMresources
parameter is typed as Optional[Sequence[str]]
, but it accepts Output[str]
at runtime without errors. Example:
table = aws.dynamodb.Table("my-table",
attributes=[aws.dynamodb.TableAttributeArgs(
name="id",
type="S"
)],
hash_key="id",
read_capacity=1,
write_capacity=1
)
policy = aws.iam.get_policy_document(statements=[
aws.iam.GetPolicyDocumentStatementArgs(
effect="Allow",
actions=["dynamodb:GetItem"],
resources=[table.arn] # Works despite IDE warning
)
])
# here I then create iam.Policy, iam.Role and iam.RolePolicyAttachment
I get IDE warning for resources=[table.arn]
but it all works.
What's going on here? Are type annotations wrong? Or should this not work and is it some "special magic case" ?
Any insight appreciated. Thanks!rhythmic-secretary-1287
10/29/2024, 9:47 PM# type: ignore
a lot in our codebase for these cases where:
• is way too hard to solve
• the runtime works despite the typing errorsquaint-soccer-82419
10/30/2024, 9:51 AM