RLOpenCatalyst / Service_Workbench_Templates

Templates for AWS Service Workbench from Relevance Lab
7 stars 13 forks source link

fix: rstudio create script bugs #9

Closed maghirardelli closed 2 years ago

maghirardelli commented 2 years ago

There are a few bugs I found while using the python create rstudio script:

  1. If you have multiple stage files (or just any files that end with .yml or .yaml), the script loops through all of them and arbitrarily uses the last one as the fileName later on. If your stage file is not the last one alphabetically, this will cause issues.
  2. The script assumes the user will be using the default AWS profile even though the configuration file and stage file asks for the AWS Profile name and region. We should use the values from the file to account for the case that the user is not using the default profile.
  3. The check on stack status is broken. The second if statement in describeStack would always evaluated to true with how the conditions were listed. In the weird case that the stack is not yet in create_complete state when that method is called, the second if statement would trigger the deleting of that stack. If the stack was still in create_in_progress, this would try to delete the stack before it has finished, which should fail.

After changing the script, I tested that: