Hi all. I’m having troubles using `tags` on AWS re...
# python
m
Hi all. I’m having troubles using
tags
on AWS resource, and the error seems to be related the RPC python implementation…
pulumi up
fails with:
Copy code
File "/<path-redacted>/python3.8/site-packages/pulumi/runtime/rpc.py", line 451, in translate_output_properties
        raise AssertionError(f"Unexpected type. Expected 'list' got '{typ}'")
    AssertionError: Unexpected type. Expected 'list' got '<class 'str'>'
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
With this,
pulumi up
works:
Copy code
for zone in zones.names:
    vpc_subnet = ec2.Subnet(
        f'vpc-subnet-{zone}',
        assign_ipv6_address_on_creation=False,
        vpc_id=vpc.id,
        map_public_ip_on_launch=True,
        cidr_block=f'10.100.{len(subnet_ids)}.0/24',
        availability_zone= zone,
        tags={
            'Name' : f'pulumi-sn-{zone}'
        }
    )
With this, it doesn’t:
Copy code
for zone in zones.names:
    vpc_subnet = ec2.Subnet(
        f'vpc-subnet-{zone}',
        assign_ipv6_address_on_creation=False,
        vpc_id=vpc.id,
        map_public_ip_on_launch=True,
        cidr_block=f'10.100.{len(subnet_ids)}.0/24',
        availability_zone= zone,
        tags={
            'Name' : f'pulumi-sn-{zone}',
            'new-tag': 'new-value'  # <---- this is the only change
        }
    )
Any ideas/suggestions on what might be going on here?
Actually.. even if I just change the tag value (from
f'pulumi-sn-{zone}'
to
test
),
pulumi up
fails with that error…
seems to happen on any changes to a Vpc, actually
i destroyed my stack, created a new one. deleted ALL my resources except the Vpc, and it’s still failing. if I comment out the Vpc, everything works just fine
m
Hi @many-psychiatrist-74327, I’ve reproduced the problem. It looks like it’s due to some extra type checks we added in the
pulumi
Python SDK in v2.9.0, which fails when certain values come back from the engine that aren’t expected. I’m going to open an issue and work on a fix. In the meantime, you can workaround by downgrading you Python package dependencies to
pulumi
v2.8.2 and
pulumi_aws
v3.1.0.
m
Hi @microscopic-pilot-97530! Thanks for taking a look!
I also cross-posted this to #general, and found another person who ran into the same issue
m
Thanks, also posting responses there.
The fix has been released in version 
2.9.2
 of the 
pulumi
 package, which will work with 
pulumi-aws
 version 
3.2.1
.