Cloudaware Cook Book
Customers can leverage CLI to run queries against Cloudaware CMDB. The article provides query examples for common use cases.
- 1 Retrieve a list of EKS deployments using CLI
- 2 Update an application catalog with Cost Center data
- 3 Get a list of current and past public IPs across multiple cloud providers
- 4 Get a list of incidents related to a specific asset and take action
- 5 Query all cloud services used by a specific application
Â
Retrieve a list of EKS deployments using CLI
DevOps teams require complete visibility into Kubernetes infrastructure. Using Cloudaware CLI, DevOps engineers can query all EKS deployments across multiple EKS Clusters, AWS Regions and Accounts with a single query.
sf data query --query "SELECT Name, CA10A1__cluster__r.Name, CA10A1__account__r.Name FROM CA10A1__CaAwsEksClusterDeployment__c" --target-org <Org Alias from Authentication>
Â
Update an application catalog with Cost Center data
Cloudaware maintains a complete application catalog with an entire cloud resource inventory for each application. FinOps teams often customize the application attributes using additional fields such as Cost Center, Product, or Product Line in order to filter and group spending not only by Business Application but also by Business Product or Product Line. Using CLI, FinOps engineers can quickly retrieve and update application attributes and even link applications to other entities in CMDB.
Here is a sample use case:
Get AWS EC2 Instances with Cost Center and Product data attached to a specific Cloudaware Application and save the result in a CSV file on your device:
sf data query --query "SELECT CA10__applicationName__c, (SELECT Name, Id, Cost_Center__c, Product__c FROM CA10__AWS_EC2_Instances__r) FROM CA10__CaApplicationTier__c WHERE CA10__applicationName__c = '<specific application name>'" --target-org <Org Alias from Authentication> --result-format csv > output.csv
Modify the CSV file you have saved the query result in and perform a bulk update using the modified CSV:
sf data upsert bulk --sobject CA10__CaAwsInstance__c --file <your_folder>/UpdatedValues.csv --external-id Id
Â
Get a list of current and past public IPs across multiple cloud providers
Security incident response often begins with an investigation to track down public IP address ownership. Using CLI, SOC team members can quickly search for all public IP addresses currently allocated across three different cloud providers.
Â
Get a list of incidents related to a specific asset and take action
Using Cloudaware CLI, engineers can retrieve incidents related to a specific asset and update incident details. Here are sample queries:
Get an incident related to an AWS Lambda Function and update the incident severity:
WHERE
<specific application name>
- a placeholder of the name of the application that is queried
Â
Update the incident severity to ‘High’.
WHERE
<record_id>
- a placeholder of the record ID for the incident returned from the previous query
Â
Query all cloud services used by a specific application
When a cloud provider is having an outage, Cloudaware assists in establishing immediate business impact. Using CLI, engineers can quickly retrieve a list of computing resources that are unavailable to perform business service recovery in failover region.
Â
1) Use Child Relationship Names in sub-queries
Find a necessary Child Relationship Name by executing the following command for a Parent object:
Â
2) Use the "childRelationships" key in the result to find all Child Relationship Names ("relationshipName") across all listed child objects. Get the cloud inventory of a specific Application:
WHERE
CA10__AWS_EC2_Instances__r
, CA10__AWS_S3_Buckets__r
, CA10__AWS_EBS_Snapshots__r
- application attachable objects (see more here)
<specific application name>
- a placeholder of the name of the application that is queried