diff --git a/todo.org b/todo.org index 8b267586..efff6ce6 100644 --- a/todo.org +++ b/todo.org @@ -58,11 +58,24 @@ * TODO patch clients (sandbox-list, mark_for_cleanup script, etc) to use the sandbox-API instead of dynamodb * TODO documentation coverage * TODO move handlers per version? +* DONE mark sandbox for cleanup once migrate from prod to dev * Post MVP ** TODO unit tests and fixture/functional tests ** TODO prometheus endpoint and metrics ** TODO Encrypt IAM secret key using AWS KMS instead of ansible-vault. Use and support both while transitioning ** TODO aws lambda function to replicate changes from dynamoDB to postgresql ** TODO add POST /refresh to get new access token +** TODO Prometheus endpoint ** TODO rename env variable: prefix with DYNAMODB_ for anything related to dynamodb access - +** TODO Reservations +*** DONE functional tests (hurl) +*** sandbox-api +**** DONE Update OpenAPI schema to support passing the group parameter +**** TODO patch handlers +***** TODO safeguard: do not allow reservation if capacity (after reservation) is <20% +*** TODO conan: preserve group info when cleaning up +*** TODO update AWS sandbox prometheus endpoint to show group information +*** TODO update sandbox-list: add group column +*** TODO patch legacy scripts to filter out accounts that are in a group +*** TODO expiration +**** make sure a comment is added to accounts when their expiration expires, so we can find them back. diff --git a/tools/migrate_aws_account_dynamodb_prod_to_dev.py b/tools/migrate_aws_account_dynamodb_prod_to_dev.py old mode 100644 new mode 100755 index 64dcde6b..728dea61 --- a/tools/migrate_aws_account_dynamodb_prod_to_dev.py +++ b/tools/migrate_aws_account_dynamodb_prod_to_dev.py @@ -104,6 +104,29 @@ } ) + # Mark new item for cleanup (dev) + response = dynamodb_dev.update_item( + TableName='accounts-dev', + Key={ + 'name': { + 'S': sandbox + } + }, + UpdateExpression="set to_cleanup = :a, #c = :c", + ExpressionAttributeNames={ + '#c': 'comment' + }, + ExpressionAttributeValues={ + ':a': { + 'BOOL': True + }, + ':c': { + 'S': 'Migrating from prod to dev' + } + }, + ConditionExpression=" #c = :c", + ) + except Exception as e: print(e) sys.exit(1)