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
utils
prefixed with the organization's environment type. For e.g. if env isprod
then the workspace name will beprod-utils
. - Choose
/utils
in theterraform
github 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. setenable
totrue
, give a name to the user inusername
field, 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
Actions
and thenStart new run
to 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_details
in the output above, we need to have the private key for the correspondingpublic key
and its password. - You have your username and password in
CONSOLE_USERNAME
andCONSOLE_USERNAME_PASSWORD
env variables.