I recently set up pyright so I could get proper ty...
# python
d
I recently set up pyright so I could get proper typing on my pulumi code and I’m running into an issue with one of the types: I had this code before to create a provider to assume an awsrole:
Copy code
provider = aws.Provider(
            f"Provider: {account.name}",
            region="us-east-1",
            assume_role={
                "roleArn": pulumi.Output.format(
                    "arn:aws:iam::{0}:role/AWSControlTowerExecution", account.id
                ),
            },
        )
They typed dict wants me to do
role_arn
but that does not end up working with the provider and I get:
Copy code
error: pulumi:providers:aws resource 'Provider: xxx' has a problem: unable to validate AWS credentials.
    Details: Cannot assume IAM Role. IAM Role ARN not set in assume role 1 of 1
a
assume_role
should be a an instance of
ProviderAssumeRoleArgs
or
ProviderAssumeRoleArgsDict
where the key name is
role_arn
and not
roleArn
The following example which demonstrates the usage of args classes and typeddicts passes pyright
Copy code
pyright .
0 errors, 0 warnings, 0 informations
d
When I actually run
pulumi up
with that it doesn’t work. It only works with
roleArn
as a dict key or by using
ProviderAssumeRoleArgs