Skip to content

Commit

Permalink
PTFE-1577 Ensure ec2 instance volume are tagged accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarmet committed Apr 2, 2024
1 parent 87e8ea2 commit fb0b01a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion runner_manager/models/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,17 @@ def configure_instance(self, runner: Runner) -> AwsInstance:
VolumeType=self.volume_type,
VolumeSize=self.disk_size_gb,
DeleteOnTermination=True,
),
)
)
]
tags_specification: Sequence[TagSpecificationTypeDef] = [
TagSpecificationTypeDef(
ResourceType="instance",
Tags=tags,
),
TagSpecificationTypeDef(
ResourceType="volume",
Tags=tags,
)
]
return AwsInstance(
Expand Down
1 change: 1 addition & 0 deletions tests/unit/backend/test_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit fb0b01a

Please sign in to comment.