Step 7 - Utils pipeline¶
This pipeline is created for adding some more functionalities to the infrastsructure for e.g. creating a console user in client's env. This is not necessary to be deployed for the application to work rather it acts as a supportive utility pipeline.
- All the below operations are to be performed under the terraform organization created in the step 2.
- Setting up the workspace
- Create a workspace with name
utilsprefixed with the organization's environment type. For e.g. if env isprodthen the workspace name will beprod-utils. - Choose
/utilsin theterraformgithub repository for version control with default branch pointing tomaster. - Configure the following variables for the workspace
console_user- (HCL)(sensitive) user details and the permissions to attach to the user. setenabletotrue, give a name to the user inusernamefield, attach policies like[admin]and give base64 encoded public key (password protected) to encrypt the credentials generated for the user in the pipeline.
- Create a workspace with name
- Attach this workspace to the respective variable set of the organization created in Step 2.
- Run the pipeline by Actions.
- Click on
Actionsand thenStart new runto start a new run. - Below variables are present in the output
user_details- (sensitive) encrypted details of the user with credentials
- Click on
- To obtain the credentials for the AWS console user we need to first obtain the token and the workspace ID.
- Token is used to authenticate to the terraform cloud. To obtain Token
- click on your profile in terraform cloud
- click on User settings
- click on
Tokens - click on
Create an API token.
- Workspace ID is the unique ID of the workspace.
- go inside your terraform organization.
- Enter your workspace (here:
<ENV>-utils) - Just below the name of the workspace you will find your workspace ID starting with
ws.
- Token is used to authenticate to the terraform cloud. To obtain Token
- To decrypt the
user_detailsin the output above, we need to have the private key for the correspondingpublic keyand its password. - You have your username and password in
CONSOLE_USERNAMEandCONSOLE_USERNAME_PASSWORDenv variables.