Error while applying tags into Autoscaling resources
See original GitHub issueDescribe 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:
- Created 2 years ago
- Comments:11 (4 by maintainers)
Top GitHub Comments
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.
This really should be set to required, it’s just bitten me too.