Skip to main content
Skip table of contents

Cloudaware Cook Book

Customers can use the CLI to run queries against the Cloudaware CMDB. This guide provides query examples for common use cases.

Retrieve a list of EKS deployments

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 command.

CODE
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 that includes the full cloud resource inventory for each application. FinOps teams often extend application attributes with fields such as Cost Center, Product, or Product Line to group and filter spending by Business Product and 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:

  • Retrieve AWS EC2 instances with Cost Center and Product data for a specific Cloudaware application, and save the results as a CSV file:

NONE
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 saved CSV file with updated values

  • Perform a bulk update using the modified CSV:

CODE
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 identifying public IP ownership. Using CLI, SOC analysts can quickly retrieve all allocated public IPs across AWS, Azure, and Google Cloud.

AWS

  • EC2 Elastic IPs:

    CODE
    sf data query --query "SELECT Name, CA10__instanceId2__c, CA10__account__r.Name, CA10__regionName__c FROM CA10__CaAwsElasticIp__c WHERE CA10__instanceId2__c != NULL AND CA10__type__c = 'Public IP'" --target-org <Org Alias from Authentication>
  • EC2 Public IPs:

    CODE
    sf data query --query -q "SELECT CA10__publicIpAddress__c, Name, CA10__instanceId__c, CA10__account__r.Name, CA10__stateName__c, CA10__regionName__c FROM CA10__CaAwsInstance__c WHERE CA10__publicIpAddress__c != NULL" --target-org <Org Alias from Authentication>

Azure

CODE
sf data query --query -q "SELECT Name, CA10__associatedResourceId__c, CA10__associatedResourceType__c FROM CA10__CaAzurePublicIpAddress__c" --target-org <Org Alias from Authentication>


GCP

CODE
sf data query --query -q "SELECT CA10__address__c, Name, CA10__googleId__c, CA10__project__r.Name, CA10__regionName__c FROM CA10__CaGoogleGceStaticAddress__c" --target-org <Org Alias from Authentication>

Get a list of incidents related to a specific asset and take action

Using Cloudaware CLI, engineers can retrieve incidents linked to a specific asset and update incident details. Here are sample queries:

  • Get the incident related to an AWS Lambda Function:

    CODE
    sf data query --query "SELECT Id, CA10__incidentId__c, CA10__severity__c FROM CA10__CaIncident__c WHERE CA10__awsLambdaFunctionArn__c = '<lambda_function_arn>' LIMIT 1"

    WHERE <lambda_function_arn> – placeholder for the Lambda function ARN

  • Update the incident severity to High:

    CODE
    sf data update record --sobject CA10__CaIncident__c --record-id <record_id> --values "CA10__severity__c=High"

    WHERE <record_id> – placeholder for the incident record ID

Query all cloud services used by a specific application

During provider outages, Cloudaware helps assess business impact by listing application services affected. Using CLI, engineers can quickly retrieve a list of computing resources that are unavailable to perform business service recovery in failover region.

  • Use Child Relationship Names in sub-queries. Find a necessary Child Relationship Name by executing the following command for a Parent object:

    CODE
    sfdx force:schema:sobject:describe -s <Parent Object's API Name> -u <Org Alias from Authentication>

  • 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:

    CODE
    sf data query --query "SELECT CA10__applicationName__c, (SELECT Name FROM CA10__AWS_EC2_Instances__r), (SELECT Name FROM CA10__AWS_S3_Buckets__r), (SELECT Name FROM CA10__AWS_EBS_Snapshots__r) FROM CA10__CaApplicationTier__c WHERE CA10__applicationName__c = '<specific application name>'" --target-org <Org Alias from Authentication>

    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> – placeholder of the name of the application that is queried

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.