Hey all I'm starting to get a new error with a new...
# python
g
Hey all I'm starting to get a new error with a newer AWS provider, but it's only affecting my testing framework, dry_run is enabled:
Copy code
~ version: "6.48.0" => "6.56.1"
ERROR tests.py - AssertionError: get can only be used with classes decorated with @input_type or @output_type
the call in question returns this:
Copy code
return AwaitableGetPolicyDocumentResult(
        id=pulumi.get(__ret__, 'id'),
from:
pulumi_aws.iam.get_policy_document(
Untitled.py
Is there a reason why this behavior had to change? it breaks unit testing it seems... even though I'm mocking things:
Copy code
class MyMocks(pulumi.runtime.Mocks):
    def new_resource(self, args: pulumi.runtime.MockResourceArgs):
        outputs = args.inputs
        return [args.name + "_id", outputs]

    def call(self, args: pulumi.runtime.MockCallArgs):
        match args.token:
            case "aws:index/getCallerIdentity:getCallerIdentity":
                return {"id": "000"}
            case "aws:index/getRegion:getRegion":
                return {"name": "us-gov-west-1"}
            case "aws:iam/getPolicy:getPolicy":
                return {"arn": "arn:aws-us-gov:iam::000:policy/fake"}
            case "aws:iam/getPolicyDocument:getPolicyDocument":
                return {"json": "", "source_json": "{}"}
            case "aws:eks/getCluster:getCluster":
                return {"identities": [{"oidcs": [{"issuer": ""}]}]}
        return {}
I changed this to
get_policy_document_output
which returns an Output, not the Awaitable class; so hopefully this doesn't break things elsewhere...
e
Can you help us out here and file an issue with a repro in
pulumi/pulumi-aws
? We look at regressions very actively. Sorry this is happening!