Setup Account Resources - Research Service Workbench on AWS

Setup Account Resources

Onboard hosting account

  1. In the RSW Official Postman Collection under the hosting account folder, choose the Create Hosting Account API to onboard a hosting account. Remember to fill in the correct values for your account. Custom values you need to provide will be in chevrons: <example>.

  2. In the body tab, set envMgmtRoleArn parameter to the EnvMgmtRoleArn value from Deploy the Hosting Account.

  3. In the body tab, set hostingAccountHandlerRoleArn parameter to the HostingAccountHandlerRoleArn value from Deploy the Hosting Account step.

  4. Follow these steps to assign a value to projectAdmin1UserNameParamStorePath parameter in ./integration-tests/config/<STAGE>.yaml file:

    1. Uncomment projectAdmin1UserNameParamStorePath and provide a name for a SSM parameter that will contain a Project Admin user's email address, e.g. /rsw/<STAGE>/PA/email.

    2. Follow instructions in Create User Step to create a new Project Admin user for the integration tests

    3. Follow instructions in to create a SSM Parameter in your main account and set the name as the assigned value in projectAdmin1UserNameParamStorePath and the value as the created Project Admin's email.

  5. Send a Create Hosting Account request.

    POST {{API_URL}}/aws-accounts
    { "name": "<Unique account name>", "awsAccountId": "<Hosting Account 12 Digit ID>", "envMgmtRoleArn": "<CFN_OUTPUT.EnvMgmtRoleArn>", "hostingAccountHandlerRoleArn": "<CFN_OUTPUT.HostingAccountHandlerRoleArn>", "externalId": "workbench" }
  6. Once the request excecute successfully a response with the following format will be displayed:

    { "id": "acc-########-####-####-####-############", "name": "<Unique account name>", "awsAccountId": "<Hosting Account 12 Digit ID>", "envMgmtRoleArn": "<CFN_OUTPUT.EnvMgmtRoleArn>", "hostingAccountHandlerRoleArn": "<CFN_OUTPUT.HostingAccountHandlerRoleArn>", "externalId": "workbench", "status": "PENDING", "updatedAt": "2023-03-17T13:45:46.195Z", "createdAt": "2023-03-07T22:31:40.783Z" }
  7. Take note of the id that was returned. We'll need it for the next step. We'll refer to this value as ACCOUNT_ID.

  8. Wait for account handler to run. It runs once every 5 minutes. You'll know that it's completed when the account status is listed as CURRENT.

  9. To monitor the account status, in RSW Official Postman Collection under hosting account folder choose Get Hosting Account API.

  10. In the params tab set accountId parameter to the ACCOUNT_ID value from previous step and send request.

  11. A response with the status property will be displayed:

    { "id": "acc-########-####-####-####-############", "name": "<Unique account name>", "awsAccountId": "<Hosting Account 12 Digit ID>", "status": "PENDING" }

    You can also find cloudwatch logs for the account handler in the Main account at aws/lambda/rsw-<stage>-<awsRegionShortName>-accountHandlerLambda.

Setup Cost Center

  1. In the RSW Official Postman Collection under costCenters folder choose Create Cost Center API.

  2. In the body tab set accountId parameter to the ACCOUNT_ID value from Onboard hosting account step.

  3. Send a Create Cost Center request

    POST {{API_URL}}/costCenters/
    { "name": "<cost center name>", "accountId": "<ACCOUNT_ID>", "description": "<cost center description>" }
  4. Take note of the id from the Create Cost Center response. We'll need it for the next step. We'll refer to this value as COST_CENTER_ID.

Setup Project

  1. In RSW Official Postman Collection under projects folder choose Create project API.

  2. In the body tab set costCenterId parameter to the COST_CENTER_ID value from Retrieve Environment Type Id step.

  3. Send a Create project request

    POST {{API_URL}}/projects
    { "name": "<project name>", "description": "<project description>", "costCenterId": "<COST_CENTER_ID>", }

    In the response take note of the id that was returned. We'll refer to this value as PROJECT_ID.