From 34a793adcc510f1a794b40d5605857848ad47609 Mon Sep 17 00:00:00 2001 From: Thomas Carmet <8408330+tcarmet@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:30:15 -0700 Subject: [PATCH] PTFE-1577 Ensure ec2 instance volume are tagged accordingly (#566) --- runner_manager/models/backend.py | 6 +++++- tests/unit/backend/test_aws.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/runner_manager/models/backend.py b/runner_manager/models/backend.py index cfef4918..cb0f8592 100644 --- a/runner_manager/models/backend.py +++ b/runner_manager/models/backend.py @@ -178,7 +178,11 @@ def configure_instance(self, runner: Runner) -> AwsInstance: TagSpecificationTypeDef( ResourceType="instance", Tags=tags, - ) + ), + TagSpecificationTypeDef( + ResourceType="volume", + Tags=tags, + ), ] return AwsInstance( ImageId=self.image, diff --git a/tests/unit/backend/test_aws.py b/tests/unit/backend/test_aws.py index 802144b2..0ffcbfd0 100644 --- a/tests/unit/backend/test_aws.py +++ b/tests/unit/backend/test_aws.py @@ -56,6 +56,7 @@ def test_aws_instance_config(runner: Runner): assert TagTypeDef(Key="test", Value="test") in tags assert TagTypeDef(Key="Name", Value=runner.name) in tags assert runner.encoded_jit_config in instance["UserData"] + assert instance["TagSpecifications"][1]["ResourceType"] == "volume" @mark.skipif(not os.getenv("AWS_ACCESS_KEY_ID"), reason="AWS credentials not found")