Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Provisioning through Service Catalog is in Beta as of 2020-05-28.

The following provides instructions on how to log on to the AWS scipoolprod account using your synapse credentials, and how to use the products provided in the AWS Service Catalog to setup or modify EC2 instances and S3 buckets.

...

The AWS SSM allows direct access to private instances from your own computer terminal. To setup access with the AWS SSM we need to create a special Synapse personal access token (PAT) that will work with the Sage Service Catalog. This is special PAT that can only be created using this workflow, creating a PAT from the Synapse personal token manager web page will NOT work.

  1. Request a Synapse PAT by opening https://sc.sageit.org/personalaccesstoken (You may need to login to Synapse). If you have already created a PAT through this mechanism and are repeating the process you must first visit the token management page in Synapse and delete the existing one with the same name.

  2. After logging into Synapse a file containing the PAT, which is a long character string (i.e. eyJ0eXAiOiJ...Z8t9Eg), is returned to you. Save the file to your local machine and note the location where you saved it to then close the browser session.

...

  • If you encounter errors try running the AWS start-session command with the --debug option.

  • If you use an invalid personal access token you will get an error like

    Code Block
    ➜ aws ssm start-session --profile service-catalog \
                            --target i-0fd5c9ff0ef675ceb
    
    Expecting value: line 1 column 1 (char 0)

    To check whether your token is valid run the following command

    Code Block
    ➜ curl -I --location-trusted \
          -H Authorization:"Bearer ${SYNAPSE_PAT}" https://sc.sageit.org/ststoken

    If the HTTP response status is 2xx then the PAT is valid. If the PAT is invalid the response will be 4xx

  • If continue to have similar errors to Expecting value: line X column X (char X) then it could mean that either your synapse_creds.sh or ~/.aws/config files are not valid file is invalid. Try verifying your synapse_creds.sh script independently of the AWS command by executing just the script. A successful execution should return a valid json and look something like this

    Code Block
    ➜ ~/synapse_creds.sh "https://sc.sageit.org" "eyJ0eXAiO...2GLQg"
    {"SessionToken":"FwoGZXIvYXdzEN7//////////wEaDP2imuwAK+...13GnBrJc9SlOW6uY=","Version":1,"AccessKeyId":"XXXXXXX","SecretAccessKey":"XXXXXXXXXXXXXXXX","Expiration":"2021-07-21T22:02:17Z"}
  • Another problem could be that your ~/.aws/config file is invalid. For debugging we recommend backing up your current config file and creating a new one with just the one service-catalog profile and then try re-running the start-session command.

SSM access with custom commands

...

  1. Setup profile for SSM access

  2. Run an application on the EC2 (i.e. docker run -p 80:80 httpd)

  3. To provide access to that app an SC user can use the port forwarding feature to gain access to the app by running the AWS SSM CLI command

...

Using the update action allows you to change parameters or update to a new version of the product. WARNING: changes to configuration parameters usually result in a recreation (“replacement”) of the instance, any data saved on the instance will be lost, and the nature of the update by Amazon is difficult to predict. We recommend that you save any important data to S3, provision a new instance and terminate the original.

Terminate

The terminate action deletes the instance permanently.

...