question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error while applying tags into Autoscaling resources

See original GitHub issue

Describe the bug I’m trying to create or update tags to autoscaling resources and Values are not beign detected,as soon as I run my code output goes: “errorMessage”: "An error occurred (ValidationError) when calling the CreateOrUpdateTags operation: Incomplete tags information for these tags. Tag - ‘Key:Lab,PropagateAtLaunch:true,ResourceId:tfetest-tfe-asg,ResourceType:null’ , ",

Steps to reproduce

autoScaling_client = session.client('autoscaling')
resource_id = search for: ['AutoScalingGroupName']
resource_tags = dict()
resource_tags['Lab'] = 'Value'

def resource_tagging_autoscaling(autoScaling_client, resource_id, resource_tags):
    tags = resource_tags.items()
    for (k, v) in tags:
        autoScaling_client.create_or_update_tags(
            Tags=[
                {
                    'ResourceId': resource_id,
                    'Key': k,
                    'Value': v,
                    'PropagateAtLaunch': True
                },
            ]
        )

Expected behavior Tags be applied into resources

“stackTrace”: [ " File "/var/task/lambda_function.py", line 187, in lambda_handler\n resource_tagging_autoscaling(autoScaling_client, asg[‘AutoScalingGroupName’], tagging)\n", " File "/var/task/lambda_function.py", line 41, in resource_tagging_autoscaling\n autoScaling_client.create_or_update_tags(\n", " File "/var/runtime/botocore/client.py", line 386, in _api_call\n return self._make_api_call(operation_name, kwargs)\n", " File "/var/runtime/botocore/client.py", line 705, in _make_api_call\n raise error_class(parsed_response, operation_name)\n" ]

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kdailycommented, Jan 14, 2022

Hmm, you’re right, it’s listed as not required. Give it a try and see what happens! We’ll look into it further too.

https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_Tag.html

Further, as @stobrien89 suggested, we need to see what’s being sent in the request as well to rule out other issues.

0reactions
ElvenSpellmakercommented, Jul 1, 2022

This really should be set to required, it’s just bitten me too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tag Auto Scaling groups and instances - AWS Documentation
When an Auto Scaling group launches instances, it adds tags to the instances during resource creation rather than after the resource is created....
Read more >
aws.autoscaling.Tag - Pulumi
Documentation for the aws.autoscaling.Tag resource with examples, input properties, output properties, lookup functions, and supporting types.
Read more >
CreateOrUpdateTags - Amazon EC2 Auto Scaling
Creates or updates tags for the specified Auto Scaling group. When you specify a tag with a key that already exists, the operation...
Read more >
Attaching "Application Load Balancer" to "Auto Scaling Group ...
Remove the target_group_arns argument from the aws_autoscaling_group resource, remove use the elb argument from the aws_autoscaling_attachment ...
Read more >
Searching AWS AutoScalingGroup resources by tags
However, this results in the error: Unsupported service=autoscaling in ResourceTypeFilter . It works fine for other resource type filters such ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found