mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
fix(ec2): remove tags on the default resources deleted with the VPC (#3917)
DeleteVpc already removes the default security group, its rules, the main route table and the default network ACL, but their tags stayed in DescribeTags. Delete them with the resources.
This commit is contained in:
1 parent
ca98384b4a
commit
c5de8331b7
3 files changed
+88
-3
No files matched your search
@@ -3624,6 +3624,7 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider {
|
||||
requireNoVpcDependents(region, vpcId);
|
||||
deleteVpcDefaultResources(region, vpcId);
|
||||
vpcs.delete(key(region, vpcId));
|
||||
tags.delete(vpcId);
|
||||
}
|
||||
if (vpcNetworkManager != null) {
|
||||
vpcNetworkManager.deleteVpcNetwork(region, vpcId);
|
||||
@@ -3672,8 +3673,12 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider {
|
||||
.filter(rule -> group.getGroupId().equals(rule.getGroupId()))
|
||||
.map(SecurityGroupRule::getSecurityGroupRuleId)
|
||||
.toList();
|
||||
ruleIds.forEach(ruleId -> securityGroupRules.delete(key(region, ruleId)));
|
||||
ruleIds.forEach(ruleId -> {
|
||||
securityGroupRules.delete(key(region, ruleId));
|
||||
tags.delete(ruleId);
|
||||
});
|
||||
securityGroups.delete(key(region, group.getGroupId()));
|
||||
tags.delete(group.getGroupId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3684,7 +3689,10 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider {
|
||||
.anyMatch(association -> association.isMain()))
|
||||
.map(RouteTable::getRouteTableId)
|
||||
.toList();
|
||||
mainRouteTableIds.forEach(routeTableId -> routeTables.delete(key(region, routeTableId)));
|
||||
mainRouteTableIds.forEach(routeTableId -> {
|
||||
routeTables.delete(key(region, routeTableId));
|
||||
tags.delete(routeTableId);
|
||||
});
|
||||
|
||||
List<String> defaultNetworkAclIds = networkAcls.scan(k -> k.startsWith(region + "::")).stream()
|
||||
.filter(acl -> region.equals(acl.getRegion()))
|
||||
@@ -3692,7 +3700,10 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider {
|
||||
.filter(acl -> acl.isDefault())
|
||||
.map(NetworkAcl::getNetworkAclId)
|
||||
.toList();
|
||||
defaultNetworkAclIds.forEach(aclId -> networkAcls.delete(key(region, aclId)));
|
||||
defaultNetworkAclIds.forEach(aclId -> {
|
||||
networkAcls.delete(key(region, aclId));
|
||||
tags.delete(aclId);
|
||||
});
|
||||
}
|
||||
|
||||
public void modifyVpcAttribute(String region, String vpcId, String attribute, String value) {
|
||||
|
||||
Reference in new issue
Block a user