mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
fix(autoscaling): reject malformed tag propagation flags (#8079)
This commit is contained in:
1 parent
589e1e58b4
commit
f8e5a883d8
6 files changed
+299
-30
No files matched your search
@@ -0,0 +1,20 @@
|
||||
package io.floci.aws.core.common;
|
||||
|
||||
/** Parses a supplied Query boolean; callers decide how to handle an absent member. */
|
||||
public final class AwsQueryBooleans {
|
||||
|
||||
private AwsQueryBooleans() {
|
||||
}
|
||||
|
||||
public static boolean parse(String raw) {
|
||||
if (raw.isEmpty()) {
|
||||
throw new AwsException("MalformedInput", "missing value for boolean type", 400);
|
||||
}
|
||||
return switch (raw) {
|
||||
case "true", "1" -> true;
|
||||
case "false", "0" -> false;
|
||||
default -> throw new AwsException("MalformedInput",
|
||||
"boolean must follow xsd1.1 definition", 400);
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,9 @@ package io.floci.aws.services.autoscaling;
|
||||
|
||||
import io.floci.aws.core.common.AwsException;
|
||||
import io.floci.aws.core.common.AwsNamespaces;
|
||||
import io.floci.aws.core.common.AwsQueryBooleans;
|
||||
import io.floci.aws.core.common.AwsQueryLists;
|
||||
import io.floci.aws.core.common.AwsQueryLists.IndexedMember;
|
||||
import io.floci.aws.core.common.AwsQueryResponse;
|
||||
import io.floci.aws.core.common.PaginatedResult;
|
||||
import io.floci.aws.core.common.SmithyValidationErrors;
|
||||
@@ -520,7 +523,7 @@ public class AutoScalingQueryHandler {
|
||||
for (int i = 0; i < tags.size(); i++) {
|
||||
if (tags.get(i).propagateAtLaunch() == null) {
|
||||
throw new AwsException("ValidationError",
|
||||
"Tags.member." + (i + 1) + ".PropagateAtLaunch is required", 400);
|
||||
tags.get(i).prefix() + ".PropagateAtLaunch is required", 400);
|
||||
}
|
||||
}
|
||||
for (TagRequest tag : tags) {
|
||||
@@ -1747,33 +1750,34 @@ public class AutoScalingQueryHandler {
|
||||
private ParsedTags parseTags(MultivaluedMap<String, String> p) {
|
||||
Map<String, String> tags = new LinkedHashMap<>();
|
||||
Map<String, Boolean> propagateAtLaunch = new LinkedHashMap<>();
|
||||
for (int i = 1; ; i++) {
|
||||
String key = p.getFirst("Tags.member." + i + ".Key");
|
||||
if (key == null) { break; }
|
||||
String value = p.getFirst("Tags.member." + i + ".Value");
|
||||
tags.put(key, value != null ? value : "");
|
||||
String flag = p.getFirst("Tags.member." + i + ".PropagateAtLaunch");
|
||||
propagateAtLaunch.put(key, flag == null || Boolean.parseBoolean(flag));
|
||||
for (TagRequest tag : parseTagRequests(p)) {
|
||||
tags.put(tag.key(), tag.value());
|
||||
propagateAtLaunch.put(tag.key(), tag.propagateAtLaunch() == null || tag.propagateAtLaunch());
|
||||
}
|
||||
return new ParsedTags(tags, propagateAtLaunch);
|
||||
}
|
||||
|
||||
private List<TagRequest> parseTagRequests(MultivaluedMap<String, String> p) {
|
||||
List<TagRequest> result = new ArrayList<>();
|
||||
for (int i = 1; ; i++) {
|
||||
String key = p.getFirst("Tags.member." + i + ".Key");
|
||||
if (key == null) { break; }
|
||||
String resourceId = p.getFirst("Tags.member." + i + ".ResourceId");
|
||||
String resourceType = p.getFirst("Tags.member." + i + ".ResourceType");
|
||||
String value = p.getFirst("Tags.member." + i + ".Value");
|
||||
String flag = p.getFirst("Tags.member." + i + ".PropagateAtLaunch");
|
||||
Boolean propagateAtLaunch = flag == null ? null : Boolean.parseBoolean(flag);
|
||||
result.add(new TagRequest(resourceId, resourceType, key, value != null ? value : "", propagateAtLaunch));
|
||||
for (IndexedMember member : AwsQueryLists.members(p, "Tags", null)) {
|
||||
String prefix = member.prefix();
|
||||
String flag = p.getFirst(prefix + ".PropagateAtLaunch");
|
||||
Boolean propagateAtLaunch = flag == null ? null : AwsQueryBooleans.parse(flag);
|
||||
String key = p.getFirst(prefix + ".Key");
|
||||
if (key == null) {
|
||||
throw new AwsException("ValidationError", prefix + ".Key is required", 400);
|
||||
}
|
||||
String resourceId = p.getFirst(prefix + ".ResourceId");
|
||||
String resourceType = p.getFirst(prefix + ".ResourceType");
|
||||
String value = p.getFirst(prefix + ".Value");
|
||||
result.add(new TagRequest(prefix, resourceId, resourceType, key,
|
||||
value != null ? value : "", propagateAtLaunch));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private record TagRequest(String resourceId, String resourceType, String key, String value, Boolean propagateAtLaunch) {}
|
||||
private record TagRequest(String prefix, String resourceId, String resourceType,
|
||||
String key, String value, Boolean propagateAtLaunch) {}
|
||||
|
||||
private record ParsedTags(Map<String, String> tags, Map<String, Boolean> propagateAtLaunch) {}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import io.floci.aws.core.common.AwsException;
|
||||
import io.floci.aws.core.common.AwsNamespaces;
|
||||
import io.floci.aws.core.common.AwsQueryBooleans;
|
||||
import io.floci.aws.core.common.AwsQueryResponse;
|
||||
import io.floci.aws.core.common.PaginatedResult;
|
||||
import io.floci.aws.core.common.RegionResolver;
|
||||
@@ -493,18 +494,7 @@ public class SesQueryHandler {
|
||||
*/
|
||||
private static boolean parseXsdBoolean(MultivaluedMap<String, String> params, String name) {
|
||||
String raw = params.getFirst(name);
|
||||
if (raw == null) {
|
||||
return false;
|
||||
}
|
||||
if (raw.isEmpty()) {
|
||||
throw new AwsException("MalformedInput", "missing value for boolean type", 400);
|
||||
}
|
||||
return switch (raw) {
|
||||
case "true", "1" -> true;
|
||||
case "false", "0" -> false;
|
||||
default -> throw new AwsException("MalformedInput",
|
||||
"boolean must follow xsd1.1 definition", 400);
|
||||
};
|
||||
return raw != null && AwsQueryBooleans.parse(raw);
|
||||
}
|
||||
|
||||
private Response handleGetIdentityMailFromDomainAttributes(MultivaluedMap<String, String> params, String region) {
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package io.floci.aws.core.common;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.CsvSource;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
class AwsQueryBooleansTest {
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvSource({"true,true", "1,true", "false,false", "0,false"})
|
||||
void acceptsXsdBooleanLexicalValues(String value, boolean expected) {
|
||||
assertEquals(expected, AwsQueryBooleans.parse(value));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"TRUE", "False", " true", "false ", " ", "yes", "2", "invalid\u0000flag"})
|
||||
void rejectsOtherValuesWithoutEchoingInput(String value) {
|
||||
AwsException error = assertThrows(AwsException.class, () -> AwsQueryBooleans.parse(value));
|
||||
assertEquals("MalformedInput", error.getErrorCode());
|
||||
assertEquals(400, error.getHttpStatus());
|
||||
assertEquals("boolean must follow xsd1.1 definition", error.getMessage());
|
||||
}
|
||||
|
||||
@Test
|
||||
void emptyValueRetainsMissingValueError() {
|
||||
AwsException error = assertThrows(AwsException.class, () -> AwsQueryBooleans.parse(""));
|
||||
assertEquals("MalformedInput", error.getErrorCode());
|
||||
assertEquals(400, error.getHttpStatus());
|
||||
assertEquals("missing value for boolean type", error.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -9,13 +9,16 @@ import jakarta.ws.rs.core.MultivaluedHashMap;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.CsvSource;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static io.floci.aws.services.autoscaling.AutoScalingXmlAssertions.XML_NAMESPACE;
|
||||
import static io.floci.aws.services.autoscaling.AutoScalingXmlAssertions.assertModeledNamespace;
|
||||
@@ -28,6 +31,95 @@ class AutoScalingQueryHandlerTest {
|
||||
|
||||
private static final String REGION = "us-east-1";
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("malformedTagPropagationValues")
|
||||
void malformedTagPropagationIsRejectedBeforeServiceCalls(String action, String flag) {
|
||||
AutoScalingService service = mock(AutoScalingService.class);
|
||||
MultivaluedHashMap<String, String> params = new MultivaluedHashMap<>();
|
||||
params.add("AutoScalingGroupName", "missing");
|
||||
params.add("Tags.member.1.Key", "valid");
|
||||
params.add("Tags.member.1.ResourceId", "missing");
|
||||
params.add("Tags.member.1.PropagateAtLaunch", "true");
|
||||
params.add("Tags.member.2.Key", "invalid");
|
||||
params.add("Tags.member.2.ResourceId", "missing");
|
||||
params.add("Tags.member.2.PropagateAtLaunch", flag);
|
||||
|
||||
Response response = new AutoScalingQueryHandler(service).handle(action, params, REGION);
|
||||
|
||||
assertEquals(400, response.getStatus(), action);
|
||||
assertTrue(response.getEntity().toString().contains("<Code>MalformedInput</Code>"), action);
|
||||
verifyNoInteractions(service);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"CreateAutoScalingGroup", "CreateOrUpdateTags", "DeleteTags"})
|
||||
void sparseMalformedTagPropagationIsRejectedBeforeServiceCalls(String action) {
|
||||
AutoScalingService service = mock(AutoScalingService.class);
|
||||
MultivaluedHashMap<String, String> params = new MultivaluedHashMap<>();
|
||||
params.add("AutoScalingGroupName", "missing");
|
||||
params.add("Tags.member.3.Key", "invalid");
|
||||
params.add("Tags.member.3.PropagateAtLaunch", "yes");
|
||||
|
||||
Response response = new AutoScalingQueryHandler(service).handle(action, params, REGION);
|
||||
|
||||
assertEquals(400, response.getStatus());
|
||||
assertTrue(response.getEntity().toString().contains("<Code>MalformedInput</Code>"));
|
||||
verifyNoInteractions(service);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"CreateAutoScalingGroup", "CreateOrUpdateTags", "DeleteTags"})
|
||||
void controlCharacterFlagReturnsParseableXml(String action) throws Exception {
|
||||
AutoScalingService service = mock(AutoScalingService.class);
|
||||
MultivaluedHashMap<String, String> params = new MultivaluedHashMap<>();
|
||||
params.add("AutoScalingGroupName", "missing");
|
||||
params.add("Tags.member.1.Key", "invalid");
|
||||
params.add("Tags.member.1.PropagateAtLaunch", "invalid" + (char) 0 + (char) 1);
|
||||
|
||||
Response response = new AutoScalingQueryHandler(service).handle(action, params, REGION);
|
||||
|
||||
assertEquals(400, response.getStatus());
|
||||
Element root = assertModeledNamespace(response.getEntity().toString());
|
||||
assertEquals("MalformedInput", root.getElementsByTagNameNS(XML_NAMESPACE, "Code").item(0).getTextContent());
|
||||
verifyNoInteractions(service);
|
||||
}
|
||||
|
||||
@Test
|
||||
void sparseRequiredFlagErrorUsesOriginalMemberIndex() {
|
||||
AutoScalingService service = mock(AutoScalingService.class);
|
||||
MultivaluedHashMap<String, String> params = new MultivaluedHashMap<>();
|
||||
params.add("Tags.member.7.Key", "missing-flag");
|
||||
|
||||
Response response = new AutoScalingQueryHandler(service).handle("CreateOrUpdateTags", params, REGION);
|
||||
|
||||
assertEquals(400, response.getStatus());
|
||||
assertTrue(response.getEntity().toString().contains("Tags.member.7.PropagateAtLaunch is required"));
|
||||
verifyNoInteractions(service);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"CreateAutoScalingGroup", "CreateOrUpdateTags", "DeleteTags"})
|
||||
void memberWithoutKeyIsRejectedBeforeMutation(String action) {
|
||||
AutoScalingService service = mock(AutoScalingService.class);
|
||||
MultivaluedHashMap<String, String> params = new MultivaluedHashMap<>();
|
||||
params.add("AutoScalingGroupName", "missing");
|
||||
params.add("Tags.member.1.Key", "valid");
|
||||
params.add("Tags.member.1.PropagateAtLaunch", "true");
|
||||
params.add("Tags.member.3.PropagateAtLaunch", "false");
|
||||
|
||||
Response response = new AutoScalingQueryHandler(service).handle(action, params, REGION);
|
||||
|
||||
assertEquals(400, response.getStatus());
|
||||
assertTrue(response.getEntity().toString().contains("Tags.member.3.Key is required"));
|
||||
verifyNoInteractions(service);
|
||||
}
|
||||
|
||||
private static Stream<Arguments> malformedTagPropagationValues() {
|
||||
return Stream.of("CreateAutoScalingGroup", "CreateOrUpdateTags", "DeleteTags")
|
||||
.flatMap(action -> Stream.of("", " ", "yes", "TRUE", "true ", " false")
|
||||
.map(flag -> Arguments.of(action, flag)));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(booleans = {false, true})
|
||||
void repeatedDetachMembersCountEachDetachedInstanceOnce(boolean decrementDesiredCapacity) {
|
||||
|
||||
+128
@@ -4,6 +4,7 @@ import io.floci.aws.core.common.RequestScopes;
|
||||
import io.floci.aws.testing.AwsTestClients;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import io.restassured.path.xml.XmlPath;
|
||||
import io.restassured.response.Response;
|
||||
import io.restassured.specification.RequestSpecification;
|
||||
import jakarta.inject.Inject;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -29,6 +30,7 @@ import java.util.function.BiConsumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static io.floci.aws.testing.QueryRequests.request;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
@@ -98,6 +100,132 @@ class AutoScalingTagPropagationIntegrationTest {
|
||||
});
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"", " ", "yes", "TRUE", "true ", " false"})
|
||||
void malformedPropagationLeavesExistingTagsUnchanged(String flag) {
|
||||
withAutoScalingGroup(List.of(Tag.builder().key("existing").value("before")
|
||||
.propagateAtLaunch(true).build()), (client, name) -> {
|
||||
Map<String, TagDescription> before = describeGroupTags(client, name);
|
||||
for (String action : List.of("CreateOrUpdateTags", "DeleteTags")) {
|
||||
request(ACCOUNT, "autoscaling", action)
|
||||
.formParam("Tags.member.1.ResourceId", name)
|
||||
.formParam("Tags.member.1.ResourceType", "auto-scaling-group")
|
||||
.formParam("Tags.member.1.Key", "existing")
|
||||
.formParam("Tags.member.1.Value", "changed")
|
||||
.formParam("Tags.member.1.PropagateAtLaunch", "false")
|
||||
.formParam("Tags.member.2.ResourceId", "missing-group")
|
||||
.formParam("Tags.member.2.ResourceType", "auto-scaling-group")
|
||||
.formParam("Tags.member.2.Key", "invalid")
|
||||
.formParam("Tags.member.2.PropagateAtLaunch", flag)
|
||||
.post("/").then().statusCode(400)
|
||||
.body("ErrorResponse.Error.Code", equalTo("MalformedInput"));
|
||||
assertEquals(before, describeGroupTags(client, name));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"", " ", "yes", "TRUE", "true ", " false"})
|
||||
void malformedPropagationCannotCreateGroup(String flag) {
|
||||
String name = "tag-malformed-" + UUID.randomUUID();
|
||||
try (AutoScalingClient client = AwsTestClients.create(AutoScalingClient.builder(), ACCOUNT, Region.of(REGION))) {
|
||||
try {
|
||||
Response response = request(ACCOUNT, "autoscaling", "CreateAutoScalingGroup")
|
||||
.formParam("AutoScalingGroupName", name)
|
||||
.formParam("LaunchConfigurationName", "missing-configuration")
|
||||
.formParam("MinSize", 0).formParam("MaxSize", 1).formParam("DesiredCapacity", 0)
|
||||
.formParam("AvailabilityZones.member.1", REGION + "a")
|
||||
.formParam("Tags.member.1.Key", "invalid")
|
||||
.formParam("Tags.member.1.PropagateAtLaunch", flag)
|
||||
.post("/");
|
||||
assertTrue(client.describeAutoScalingGroups(r -> r.autoScalingGroupNames(name))
|
||||
.autoScalingGroups().isEmpty());
|
||||
response.then().statusCode(400).body("ErrorResponse.Error.Code", equalTo("MalformedInput"));
|
||||
} finally {
|
||||
if (!client.describeAutoScalingGroups(r -> r.autoScalingGroupNames(name)).autoScalingGroups().isEmpty()) {
|
||||
client.deleteAutoScalingGroup(r -> r.autoScalingGroupName(name).forceDelete(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"yes", "invalid\u0000flag"})
|
||||
void sparseInvalidFlagLeavesExistingTagsUnchanged(String flag) {
|
||||
withAutoScalingGroup(List.of(Tag.builder().key("existing").value("before")
|
||||
.propagateAtLaunch(true).build()), (client, name) -> {
|
||||
Map<String, TagDescription> before = describeGroupTags(client, name);
|
||||
for (String action : List.of("CreateOrUpdateTags", "DeleteTags")) {
|
||||
request(ACCOUNT, "autoscaling", action)
|
||||
.formParam("Tags.member.1.ResourceId", name)
|
||||
.formParam("Tags.member.1.ResourceType", "auto-scaling-group")
|
||||
.formParam("Tags.member.1.Key", "existing")
|
||||
.formParam("Tags.member.1.Value", "changed")
|
||||
.formParam("Tags.member.1.PropagateAtLaunch", "false")
|
||||
.formParam("Tags.member.3.ResourceId", name)
|
||||
.formParam("Tags.member.3.ResourceType", "auto-scaling-group")
|
||||
.formParam("Tags.member.3.Key", "later")
|
||||
.formParam("Tags.member.3.PropagateAtLaunch", flag)
|
||||
.post("/").then().statusCode(400)
|
||||
.body("ErrorResponse.Error.Code", equalTo("MalformedInput"));
|
||||
assertEquals(before, describeGroupTags(client, name));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvSource({"1,true", "0,false"})
|
||||
void numericPropagationFlagsAreAccepted(String flag, boolean expected) {
|
||||
withAutoScalingGroup(List.of(Tag.builder().key("existing").value("before")
|
||||
.propagateAtLaunch(!expected).build()), (client, name) -> {
|
||||
request(ACCOUNT, "autoscaling", "CreateOrUpdateTags")
|
||||
.formParam("Tags.member.1.ResourceId", name)
|
||||
.formParam("Tags.member.1.ResourceType", "auto-scaling-group")
|
||||
.formParam("Tags.member.1.Key", "existing")
|
||||
.formParam("Tags.member.1.PropagateAtLaunch", flag)
|
||||
.post("/").then().statusCode(200);
|
||||
assertEquals(expected, describeGroupTags(client, name).get("existing").propagateAtLaunch());
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void sparseTagsRetainCreateDefaultsUpdateAndDeleteSemantics() {
|
||||
String name = "sparse-tags-" + UUID.randomUUID();
|
||||
try (AutoScalingClient client = AwsTestClients.create(AutoScalingClient.builder(), ACCOUNT, Region.of(REGION))) {
|
||||
try {
|
||||
request(ACCOUNT, "autoscaling", "CreateAutoScalingGroup")
|
||||
.formParam("AutoScalingGroupName", name)
|
||||
.formParam("LaunchConfigurationName", "sparse-configuration")
|
||||
.formParam("MinSize", 0).formParam("MaxSize", 1).formParam("DesiredCapacity", 0)
|
||||
.formParam("AvailabilityZones.member.1", REGION + "a")
|
||||
.formParam("Tags.member.3.Key", "existing")
|
||||
.formParam("Tags.member.3.Value", "before")
|
||||
.post("/").then().statusCode(200);
|
||||
assertEquals("before", describeGroupTags(client, name).get("existing").value());
|
||||
assertTrue(describeGroupTags(client, name).get("existing").propagateAtLaunch());
|
||||
request(ACCOUNT, "autoscaling", "CreateOrUpdateTags")
|
||||
.formParam("Tags.member.7.ResourceId", name)
|
||||
.formParam("Tags.member.7.ResourceType", "auto-scaling-group")
|
||||
.formParam("Tags.member.7.Key", "existing")
|
||||
.formParam("Tags.member.7.Value", "after")
|
||||
.formParam("Tags.member.7.PropagateAtLaunch", "false")
|
||||
.post("/").then().statusCode(200);
|
||||
assertEquals("after", describeGroupTags(client, name).get("existing").value());
|
||||
assertEquals(false, describeGroupTags(client, name).get("existing").propagateAtLaunch());
|
||||
request(ACCOUNT, "autoscaling", "DeleteTags")
|
||||
.formParam("Tags.member.9.ResourceId", name)
|
||||
.formParam("Tags.member.9.ResourceType", "auto-scaling-group")
|
||||
.formParam("Tags.member.9.Key", "existing")
|
||||
.post("/").then().statusCode(200);
|
||||
assertTrue(describeGroupTags(client, name).isEmpty());
|
||||
} finally {
|
||||
if (!client.describeAutoScalingGroups(r -> r.autoScalingGroupNames(name)).autoScalingGroups().isEmpty()) {
|
||||
client.deleteAutoScalingGroup(r -> r.autoScalingGroupName(name).forceDelete(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void deleteTagsAllowsOmittedPropagationFlag() {
|
||||
List<Tag> tags = List.of(
|
||||
|
||||
Reference in new issue
Block a user