Skip to content

Commit

Permalink
update tag formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
idanovinda committed Feb 13, 2024
1 parent 42787bf commit 33fc301
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions postgres-appliance/scripts/callback_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ def main():

instance = get_instance(ec2, instance_id)

tags = {'Role': role}
tags = [{'Key': 'Role', 'Value': role}]
tag_resource(ec2, instance_id, tags)

tags.update({'Instance': instance_id})
tags.append({'Key': 'Instance', 'Value': instance_id})

volumes = list_volumes(ec2, instance_id)
for v in volumes['Volumes']:
Expand All @@ -81,9 +81,9 @@ def main():
volume_device = 'root'
else:
volume_device = 'data'
tags_to_update = dict(tags, Name='spilo_{}_{}'.format(cluster, volume_device))
tags_to_update = tags + [{'Key': 'Name', 'Value': 'spilo_{}_{}'.format(cluster, volume_device)}]

tag_resource(ec2, v.id, tags_to_update)
tag_resource(ec2, v.get('VolumeId'), tags_to_update)


if __name__ == '__main__':
Expand Down

0 comments on commit 33fc301

Please sign in to comment.