Setup Account Resources
Onboard hosting account
-
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>
. -
In the body tab, set
envMgmtRoleArn
parameter to theEnvMgmtRoleArn
value from Deploy the Hosting Account. -
In the body tab, set
hostingAccountHandlerRoleArn
parameter to theHostingAccountHandlerRoleArn
value from Deploy the Hosting Account step. -
Follow these steps to assign a value to
projectAdmin1UserNameParamStorePath
parameter in./integration-tests/config/<STAGE>.yaml
file:-
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.
-
Follow instructions in Create User Step to create a new Project Admin user for the integration tests
-
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.
-
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" }
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" }
-
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.
-
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.
-
To monitor the account status, in RSW Official Postman Collection under hosting account folder choose Get Hosting Account API.
-
In the params tab set
accountId
parameter to the ACCOUNT_ID value from previous step and send request. -
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
In the RSW Official Postman Collection under costCenters folder choose Create Cost Center API.
-
In the body tab set accountId parameter to the ACCOUNT_ID value from Onboard hosting account step.
-
Send a Create Cost Center request
POST {{API_URL}}/costCenters/
{ "name": "<cost center name>", "accountId": "<ACCOUNT_ID>", "description": "<cost center description>" }
-
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
-
In RSW Official Postman Collection under projects folder choose Create project API.
-
In the body tab set costCenterId parameter to the COST_CENTER_ID value from Retrieve Environment Type Id step.
-
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.