fix(codedeploy): match any on-premises deployment tag filter (#8032)

This commit is contained in:
Jimmy Liu Jia authored and GitHub committed 2026-11-11 13:06:20 -04:00
1 parent 9f8593a062
commit d09ac7ff34
2 files changed
+38 -17

No files matched your search

@@ -112,6 +112,31 @@ class CodeDeployServiceTest {
Set.copyOf(service.listDeploymentTargets(REGION, deploymentId)));
}
@Test
void deploymentGroupMatchesAnyOnPremisesTagFilterWithoutChangingListFiltering() {
for (String name : List.of("team-only", "role-only", "both", "neither")) {
service.registerOnPremisesInstance(REGION, name, null, null);
}
service.addTagsToOnPremisesInstances(REGION, List.of("team-only", "both"),
List.of(Map.of("Key", "team", "Value", "red")));
service.addTagsToOnPremisesInstances(REGION, List.of("role-only", "both"),
List.of(Map.of("Key", "role", "Value", "web")));
List<Map<String, String>> filters = List.of(
Map.of("Key", "team", "Value", "red", "Type", "KEY_AND_VALUE"),
Map.of("Key", "role", "Value", "web", "Type", "KEY_AND_VALUE"));
assertEquals(Set.of("both"), Set.copyOf(service.listOnPremisesInstances(REGION, null, filters)));
service.createApplication(REGION, "any-filter-app", "Server", null);
service.createDeploymentGroup(REGION, "any-filter-app", "group", null, ROLE_ARN,
Map.of("onPremisesInstanceTagFilters", filters), null);
String deploymentId = service.createDeployment(REGION, "any-filter-app", "group", null,
Map.of("appSpecContent", Map.of("content", "os: linux")), null);
assertEquals(Set.of("team-only", "role-only", "both"),
Set.copyOf(service.listDeploymentTargets(REGION, deploymentId)));
}
// ---- Server platform (SSM) hooks ---------------------------------------------------
@Test