Hello, Having error on creating AutoScaling Group...
# aws
q
Hello, Having error on creating AutoScaling Group in pulumi when using ### With Latest Version Of Launch Template Error says "Attribute must be a list. Examine values at asg.tags" and actual error message is as below Error message :
Diagnostics:
aws:autoscaling:Group (my-auto-scaling-group):
error: aws:autoscaling/group:Group resource 'my-auto-scaling-group' has a problem: Attribute must be a list. Examine values at 'my-auto-scaling-group.tags'.
my code looks like this from screenshot below and displaying the error message below. I am using Pulumi with Typescript. Any help to resolve the error is much appreciated. I did upgrade sdk using latest version of aws sdk (npm install -g @nice-addition-43900/aws@latest )
f
this works for me:
Copy code
tags: [{
            key: "environment",
            value: "test",
            propagateAtLaunch: true,
        }]
image.png
if this is still happening, could you provide a
pulumi about
d
ah yeah, I got this too… I don’t have any tags specified and I’m getting this error
something related to autotagging?
f
curious what your
pulumi
and
pulumi-aws
versions are
d
Copy code
self.asg = aws.autoscaling.Group(
            f"{name}-asg",
            desired_capacity=2,
            max_size=3,
            min_size=2,
            launch_template=aws.autoscaling.GroupLaunchTemplateArgs(
                id=launch_template.id,
                version="$Latest",
            ),
            vpc_zone_identifiers=[args.vpc_private_subnet_ids],
            health_check_type="EC2",
            health_check_grace_period=300,
            opts=ResourceOptions(parent=self),
        )
Copy code
error: aws:autoscaling/group:Group resource 'ssh-bastion-asg' has a problem: Attribute must be a list. Examine values at 'ssh-bastion-asg.tags'.
Copy code
poetry run pulumi version  
v3.134.1

poetry show pulumi-aws
 name         : pulumi-aws                                                                            
 version      : 6.40.0

poetry show pulumi    
 name         : pulumi              
 version      : 3.120.0
(upgrading now and checking again)
(ok lol now a different error… trying to debug)
🤔
Copy code
Diagnostics:
  pulumi:pulumi:Stack (claimhelper-resources-dev):
    error: Program failed with an unhandled exception:
    Traceback (most recent call last):
      File "/opt/homebrew/bin/pulumi-language-python-exec", line 192, in <module>
        loop.run_until_complete(coro)
      File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
        return future.result()
               ^^^^^^^^^^^^^^^
      File "/Users/me/Library/Caches/pypoetry/virtualenvs/infra-jqilnyNa-py3.12/lib/python3.12/site-packages/pulumi/runtime/stack.py", line 142, in run_in_stack
        await run_pulumi_func(run)
      File "/Users/me/Library/Caches/pypoetry/virtualenvs/infra-jqilnyNa-py3.12/lib/python3.12/site-packages/pulumi/runtime/stack.py", line 56, in run_pulumi_func
        await wait_for_rpcs()
      File "/Users/me/Library/Caches/pypoetry/virtualenvs/infra-jqilnyNa-py3.12/lib/python3.12/site-packages/pulumi/runtime/stack.py", line 89, in wait_for_rpcs
        raise exn from cause
      File "/Users/me/Library/Caches/pypoetry/virtualenvs/infra-jqilnyNa-py3.12/lib/python3.12/site-packages/pulumi/runtime/rpc_manager.py", line 71, in rpc_wrapper
        result = await rpc
                 ^^^^^^^^^
      File "/Users/me/Library/Caches/pypoetry/virtualenvs/infra-jqilnyNa-py3.12/lib/python3.12/site-packages/pulumi/runtime/resource.py", line 935, in do_register
        resolver = await prepare_resource(res, ty, custom, remote, props, opts, typ)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/me/Library/Caches/pypoetry/virtualenvs/infra-jqilnyNa-py3.12/lib/python3.12/site-packages/pulumi/runtime/resource.py", line 197, in prepare_resource
        serialized_props = await rpc.serialize_properties(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/me/Library/Caches/pypoetry/virtualenvs/infra-jqilnyNa-py3.12/lib/python3.12/site-packages/pulumi/runtime/rpc.py", line 217, in serialize_properties
        result = await serialize_property(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/me/Library/Caches/pypoetry/virtualenvs/infra-jqilnyNa-py3.12/lib/python3.12/site-packages/pulumi/runtime/rpc.py", line 373, in serialize_property
        await serialize_property(
      File "/Users/me/Library/Caches/pypoetry/virtualenvs/infra-jqilnyNa-py3.12/lib/python3.12/site-packages/pulumi/runtime/rpc.py", line 542, in serialize_property
        value = await serialize_property(
                ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/me/Library/Caches/pypoetry/virtualenvs/infra-jqilnyNa-py3.12/lib/python3.12/site-packages/pulumi/runtime/rpc.py", line 520, in serialize_property
        return await serialize_property(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/me/Library/Caches/pypoetry/virtualenvs/infra-jqilnyNa-py3.12/lib/python3.12/site-packages/pulumi/runtime/rpc.py", line 369, in serialize_property
        element_type = _get_list_element_type(typ)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/me/Library/Caches/pypoetry/virtualenvs/infra-jqilnyNa-py3.12/lib/python3.12/site-packages/pulumi/runtime/rpc.py", line 169, in _get_list_element_type
        raise AssertionError(f"Unexpected type. Expected 'list' got '{typ}'")
    AssertionError: Unexpected type. Expected 'list' got '<class 'str'>'
wtf…?
ok so I think I know what was going on in the first place—we’re using https://github.com/tlinhart/pulumi-aws-tags and I didn’t realize
so that was setting tags
now that I’ve upgraded everything I think it’s just a different error that I’m getting
(with a horrible, unhelpful stacktrace)
f
that is uh... yeah, that's a lot 🙂
d
Ok fixed that error… it was either my version of pulumi or probably more likely an outdated version of pulumi-aws-tags
f
innnnnnteresting! so you're all good now that everything's upgraded, including
pulumi-aws-tags
?
d
yup! thank you… well at least I can run
pulumi preview
… hopefully
up
will work too, but if it doesn’t it certainly won’t be because of this tags issue 🙂 thank you for your help!
f
bwahahahahhaaaargh 😄
d
yup I guess other people ran into it… makes sense since the Group has a concept of “propagate_at_launch”
f
hey @quiet-painter-19715 perhaps this was your issue as well?
aha, yeah, it's not a simple key/value
q
Hello @future-hairdresser-70637 Its the similar issue I am having, but I added a work around when tags are coming from aws:asg
f
👍 Glad you got it working!
q
But I am still wondering why autoscaling group tags have to marked unsupported tags _UNSUPPORTED_RESOURCE_TYPES = {"awsautoscaling/groupGroup"}
f
I think it's because it's not a typical key/value set; there's an additional property
propagate_at_launch
which complicates matters for providers. I haven't looked deeply at it though
d
so most resources take tags like:
{"foo_key": "bar_value"}
. ASGs take it like
{"key": "foo_key", "value": "bar_value", "propagate_at_launch": true}
.
pulumi-aws-tags
doesn’t handle the case. I opened an issue to discuss better handling: https://github.com/tlinhart/pulumi-aws-tags/issues/37
I think it’d make sense for there to be a configuration option to handle this if you do want your ASGs to use auto tags
q
Yeah I agree if we can make it as a configuration option