From 858648feb8b24f625b5cc2a47a95789aba0e48b1 Mon Sep 17 00:00:00 2001 From: Christopher Christou Date: Fri, 8 Mar 2024 12:57:58 -0800 Subject: [PATCH] Adjust Security Group type hints to show the group name and id --- .../Commands/TypeHints/ExistingSecurityGroupsCommand.cs | 2 +- .../TypeHintCommands/ExistingSecurityGroubsCommandTest.cs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/AWS.Deploy.CLI/Commands/TypeHints/ExistingSecurityGroupsCommand.cs b/src/AWS.Deploy.CLI/Commands/TypeHints/ExistingSecurityGroupsCommand.cs index 1dcd0f39f..3ff382ebd 100644 --- a/src/AWS.Deploy.CLI/Commands/TypeHints/ExistingSecurityGroupsCommand.cs +++ b/src/AWS.Deploy.CLI/Commands/TypeHints/ExistingSecurityGroupsCommand.cs @@ -52,7 +52,7 @@ public async Task GetResources(Recommendation recommendat foreach (var securityGroup in securityGroups.OrderBy(securityGroup => securityGroup.VpcId)) { - var row = new TypeHintResource(securityGroup.GroupId, securityGroup.GroupId); + var row = new TypeHintResource(securityGroup.GroupId, $"{securityGroup.GroupName} ({securityGroup.GroupId})"); row.ColumnValues.Add(securityGroup.GroupName); row.ColumnValues.Add(securityGroup.GroupId); row.ColumnValues.Add(securityGroup.VpcId); diff --git a/test/AWS.Deploy.CLI.UnitTests/TypeHintCommands/ExistingSecurityGroubsCommandTest.cs b/test/AWS.Deploy.CLI.UnitTests/TypeHintCommands/ExistingSecurityGroubsCommandTest.cs index e11f16a19..f36c3af8b 100644 --- a/test/AWS.Deploy.CLI.UnitTests/TypeHintCommands/ExistingSecurityGroubsCommandTest.cs +++ b/test/AWS.Deploy.CLI.UnitTests/TypeHintCommands/ExistingSecurityGroubsCommandTest.cs @@ -68,15 +68,16 @@ public async Task GetResources() { new SecurityGroup() { - GroupId = "group1" + GroupId = "group1-id", + GroupName = "group1-name" } }); var resources = await command.GetResources(appRunnerRecommendation, securityGroupsOptionSetting); Assert.Single(resources.Rows); - Assert.Equal("group1", resources.Rows[0].DisplayName); - Assert.Equal("group1", resources.Rows[0].SystemName); + Assert.Equal("group1-name (group1-id)", resources.Rows[0].DisplayName); + Assert.Equal("group1-id", resources.Rows[0].SystemName); } [Fact]