-
Notifications
You must be signed in to change notification settings - Fork 189
Fix installer delete for v2 #279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5083172 to
e2e1006
Compare
This commit adds the Tenant service delete function to the private api for use by the installer and improves the installer delete functionality for deleting ECR images from all service repositories, properly deleting tenants (and only active tenants), and deleting Active Directory resources when created.
e2e1006 to
d429f92
Compare
| } | ||
| } | ||
| default: { | ||
| outputMessage("Unexpected stackStatus " + stackStatus + " while waiting for " + tenantStackId + " to finish deleting."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly unexpected since the application services stacks must finish deleting before the base stack for the tenant will start deleting.
We should probably have some sort of maximum wait timeout.
| outputMessage("Deleting AWS SaaS Boost stack: " + this.stackName); | ||
| deleteCloudFormationStack(this.stackName); | ||
|
|
||
| // Delete the ActiveDirectory Password in SSM if it exists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should just delete any parameter under /saas-boost/${ENVIRONMENT}/*
| .values("/saas-boost/" + this.envName + "/") | ||
| .build())) | ||
| .parameters().stream().map(meta -> meta.name()).collect(Collectors.toList()); | ||
| ssm.deleteParameters(request -> request.names(parameterNamesToDelete)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember that SSM will only let you delete 10 parameters in a single call, so you may have to batch this.
| LOGGER.debug("Deleting active tenant", tenant); | ||
| deleteProvisionedTenant(tenant); | ||
| } else { | ||
| LOGGER.debug("Not deleting inactive tenant: ", tenant); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should call delete for all tenants regardless of their active status. If a tenant as been "disabled" by an admin, their infrastructure is still provisioned and we need to clean it up before we can delete the rest of the environment.
| LOGGER.debug("got response back: {}", response); | ||
| // wait for tenant to reach deleted | ||
| final String DELETED = "deleted"; | ||
| LocalDateTime timeout = LocalDateTime.now().plus(30, ChronoUnit.MINUTES); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this timeout be 60 minutes -- remember we're waiting for CloudFormation to delete multiple stacks and potentially are dealing with RDS instances and FSx file systems which can take a very long time to delete.
brtrvn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For completeness with the new updates to include the Util helper functions, we should update the API calls.
brtrvn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
This commit adds the Tenant service delete function to the private api
for use by the installer and improves the installer delete functionality
for deleting ECR images from all service repositories, properly deleting
tenants (and only active tenants), and deleting Active Directory
resources when created.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license