From 8c7908eb4a01d388576beb2ed14471a2eee4d595 Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Wed, 21 Aug 2024 22:24:47 +0000 Subject: [PATCH] Remove aws internal tags --- sky/provision/aws/instance.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sky/provision/aws/instance.py b/sky/provision/aws/instance.py index 664439dfe88..8bf94c595b0 100644 --- a/sky/provision/aws/instance.py +++ b/sky/provision/aws/instance.py @@ -324,9 +324,13 @@ def _create_node_tag(target_instance, is_head: bool = True) -> str: 'Key': 'Name', 'Value': f'sky-{cluster_name_on_cloud}-worker' }) + # Remove AWS internal tags, as they are not allowed to be set by users. + target_instance_tags = [ + tag for tag in target_instance.tags if not tag['Key'].startswith('aws:') + ] ec2.meta.client.create_tags( Resources=[target_instance.id], - Tags=target_instance.tags + node_tag, + Tags=target_instance_tags + node_tag, ) return target_instance.id