Cloud Provider | AWS |
---|---|
Services | AWS Lambda |
Description | Used to perform the given task using the backend logic. Names of all lambda start with 'cmp'. |
Items/names | cmp_auth, cmp_lander, cmp_fetch_data, cmp_mapper, cmp_config_builder, cmp_engine, cmp_outputs_db, cmp_modify, cmp_backup, cmp_discovery, cmp_cmdb_discovery, cmp_target_delete, cmp_get_handler |
Cloud Provider | AWS |
---|---|
Services | AWS Step functions |
Description | Orchestrates different lambda functions based on the use case |
Items/names | CMP |
Cloud Provider | AWS |
---|---|
Services | AWS S3 |
Description | Contains various essential data such as the engine binary, lambda package, templates, configurations, and outputs |
Items/names | Netalytics-demo |
Cloud Provider | AWS |
---|---|
Services | SSM Parameter store |
Description | It contains some constant data, environment-wise details, and VM image information. All information can be edited by the admin here. |
Items/names | parameter starting with “/cmp/” |
Cloud Provider | AWS |
---|---|
Services | API Gateway |
Description | The entry-point to CMP. Routes the requests from the front-end to the lambda authorizer for authentication purposes. |
Items/names | CMP-API-gateway |
Cloud Provider | AWS |
---|---|
Services | AWS Windows EC2 instance(Domain joined) |
Description | Required to run the scripts inside SSM documents for Cyberark and domain disjoin. |
Items/names | CMP_server |
Cloud Provider | AWS |
---|---|
Services | AWS Systems Manager |
Description | Used to run the script on the EC2 instance |
Items/names | SSM Documents: CMP-cyberark, CMP-disjoin |
Cloud Provider | AZURE |
---|---|
Services | Azure blob storage |
Description | Contains the initial scripts to be run on AZURE VMs. Located in Nextgen environment (servicenow-rg) |
Items/names | cmpscript |
CMP Resource Settings and Config:
Lambda Settings:
Step 1:Execution role: cmp_lambda_role
Step 2:
Basic settings and other configurations of each lambda:
Step 1:cmp_auth:
Step 2:
cmp_lander:
Step 1:
Step 2:
cmp_fetch_data:
Step 1:
Step 2:
cmp_mapper:
Step 1:
Step 2:
cmp_config_builder:
Step 1:
Step 2:
cmp_engine:
Step 1:
Step 2:
cmp_outputs_db:
Step 1:
Step 2:
cmp_get_handler:
Step 1:
Step 2:
cmp_backup:
Step 1:
Step 2:
cmp_modify:
Step 1:
Step 2:
cmp_cmdb_discovery:
Step 1:
Step 2:
cmp_discovery:
Step 1:
Step 2:
cmp_target_delete:
Step 1:
Step 2:
Step Functions:
Name | CMP |
---|---|
Execution role | cmp_step_function_role |
ARN of all newly created lambdas to be configured in the json definition of the state machine. |
AWS S3:
Name | netalytics-demo |
---|---|
API Gateway:
Name | CMP-API-gateway |
---|---|
The resources and methods should be recreated with the appropriate lambda endpoints. A new set of keys and usage plans to be created. New keys must be updated in the SSM parameter store and also to be shared with the ServiceNow team. |
Azure Blob Storage:
Name | cmpscript |
---|---|
VM created in any environment must have access to this storage so that the initial scripts can be run. | |
API Details:
CMP API COLLECTION
Function | Single VM Creation |
---|---|
Description | To provision a VM in a particular cloud environment based on the configurations described in the payload. CMDB will be updated on each success case. |
API | |
HTTP Method | POST |
Additional headers | "x-api-key": {API-key} "authorization_token": {auth-token} |
Payload |
|
Response | { “status”: “success”, “Message”: “The request has been approved and is being processed. Further updates will be sent via E-mail”} |
Function | Multiple VM Creation |
---|---|
Description | Multi Cloud -Multi VM Provisioning based on the configurations described in the payload. CMDB will be updated on each success case. |
API | |
HTTP Method | POST |
Additional headers | "x-api-key": {API-key} "authorization_token": {auth-token} |
Payload |
|
Response | { “status”: “success”, “Message”: “The request has been approved and is being processed. Further updates will be sent via e-mail” } |
Function | Modify VM |
---|---|
Description | To modify VM configurations. CMDB will be updated on each success case |
Functionality | Modify instance type(upgrade/ Degrade), upgrade disk size, add new discs |
API | disks.https://cmpuat.mphasis.com/Dev/vm/update |
HTTP Method | POST |
Additional headers | "x-api-key": {API-key} "authorization_token": {auth-token} |
Payload |
|
Response | { “status”: “success”, “Message”: “The request has been approved and is being processed. Further updates will be sent via email” } |
Payload Key Details |
string - ””.
Possible values: compute_size (for modifying the instance_type of a vm) data_disk_add: to add an additional disk upgrade_disk: To upgrade an existing disk For Instance, if u need to update both compute size and upgrade an existing disk you have to pass values in the following manner: "update_actions": ["compute_size","upgrade_disk"]
|
Note:
For Intance: existing disks of a vm: "10,20,30" If the user wants to change disk2 size from 20 to 50 then, Propose_disk_list value will be: "10,50,30" |
Function | VM Decommission |
---|---|
Description | To delete a VM and its sub-resources. CMDB will be updated on each success case |
Functionality | Backup, Retention, Disjoin domain, Destroy VM |
API | |
HTTP Method | POST |
Additional headers | "x-api-key": {API-key} "authorization_token": {auth-token} |
Payload |
|
Payload Key Details | backup (boolean): true | false - true if backup is required else false. backup_disk_ids (list/array): [<disk_ids>] - list of disk IDs which the user wants to backup retention (number): 1 | 3 | 6 | 12 - backup retention period in months |
Response | { “status”: “success”, “Message”: “The request has been approved and is being processed. Further updates will be sent via email” } |
Function | Retry |
---|---|
Description | When clicked failed VM to be initiated to create |
Functionality | Retry function for both Single and Multiple VM |
Payload |
|
Function | Azure Resource group data discovery |
---|---|
Description | To fetch all resource group data from each environment in the Azure cloud. Created for ServiceNow to fetch the data and populate in the user form |
API | |
HTTP METHOD | GET |
Additional headers | "x-api-key": {API-key} "authorization_token": {auth-token} |
Query parameters | None |
Response | Resource group data (name, project name, project code, primary owner, secondary owner) for each environment in JSON format. { “uat”: [ {....}, {....}....,{....}], “nextgen-rd”: [ {....}, {....}....,{....}],......} |
Note: For now this API will provide data for only DEV/UAT and Nextgen-RD environment as we don't have access to other environments as of now. |
Function | Resource name-based Discovery |
---|---|
Description | To fetch the current VM size and disk details of a VM which already exist in CMDB from the cloud and post it back to CMDB. |
API | |
HTTP METHOD | GET |
Additional headers | "x-api-key": {API-key} "authorization_token": {auth-token} |
Query parameters | provider - AWS | AZURE environment - Nextgen-RD | UAT | DEV.. etc resource_name - The hostname of the VM |
Example: { 'environment': 'UAT', 'provider': 'AZURE', 'resource_name': 'SRVAZUCHEAZV032’ } |
Function | To delete a disk Snapshot | |
---|---|---|
Description | This api can be used to delete a disk snapshot after backup retention period expires. | |
API | ||
HTTP Method | POST | Additional headers |
Payload |
| |
Response | { "status": "<success or failure>", "message": "<status-message>" }
example payload and response:
{ "provider": "AWS", "environment": "UAT", "snapshot_id": "snap-0f20b675f9cb56ce9" } response: { "status": "success", "message": "Successfully deleted Snapshot: snap-0f20b675f9cb56ce9" } | |
NOTE: The snapshot_id should be a valid snapshot ID and the trigger should be sent only after the retention period expires. |