-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement account deletion API endpoint (#54)
* Implement account deletion API endpoint This change to the SandboxAPI, focuses on the implementation of a new account deletion API endpoint (DeleteAccountHandler). Steps are: 1. Pre-conditions are met 2. Close the account 3. Delete the sandbox from DynamoDB table 4. Insert line into the resources_events table for logging New Account Deletion Endpoint: A new DELETE /accounts/{kind}/{account} endpoint has been added to the sandbox API. This endpoint allows for the deletion of AWS sandbox accounts, enforcing specific preconditions before an account can be deleted. These preconditions include: - the account being marked for cleanup - at least three cleanup attempts of the account have been tried - ensuring that no cleanup process is currently in progress Modifications to `accounts.go` in the internal/dynamodb package include the introduction of a Delete function, which encapsulates the logic for deleting an account from DynamoDB. This function is called post-validation in the DeleteAccountHandler. Additionally, the AwsAccountDynamoDB struct has been updated to include a new ConanCleanupCount field, reflecting the number of cleanup attempts for an account. Model Updates: The aws_account.go file in the internal/models package has been updated to include logic for closing an AWS account via the AWS Organizations API, represented by the CloseAccount function. This addition supports the deletion process by ensuring that the account is properly closed before its deletion from the DynamoDB table. Also: - Swagger Documentation: Updates to the Swagger documentation (swagger.yaml) to add the new endpoint - Go Module and Sum File Updates - migrate script: fix condition to work with failed cleanup * Update go modules
- Loading branch information
Showing
11 changed files
with
442 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.