From 33fc3015de9ee7f81c7eaf263e032c235e6498d3 Mon Sep 17 00:00:00 2001 From: idanovinda Date: Tue, 13 Feb 2024 09:46:05 +0100 Subject: [PATCH] update tag formatting --- postgres-appliance/scripts/callback_aws.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/postgres-appliance/scripts/callback_aws.py b/postgres-appliance/scripts/callback_aws.py index b9b7c8f2a..5082ae52d 100755 --- a/postgres-appliance/scripts/callback_aws.py +++ b/postgres-appliance/scripts/callback_aws.py @@ -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']: @@ -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__':