Info |
---|
Since Cloudaware is built on force.com, address Salesforce CLI which is a powerful command line interface that simplifies development and build automation when working with your Salesforce instance. |
...
The JWT-based authorization flow requires a digital certificate and the private key used to sign the certificate. You upload the digital certificate to the custom connected app that is also required for JWT-based authorization. This process produces two files:
server.key - The the private key. You specify this file when you authorize an org with the
force:auth:jwt:grant
command.server.crt - The the digital certification. You upload this file when you create the connected app required by the JWT-based flow.
...
openssl genrsa -des3 -passout pass:x xxxx -out server.pass.key 2048
openssl rsa -passin pass:x xxxx -in server.pass.key -out server.key
You can delete the server.pass.key file because as you will no longer need it.
4. Generate a certificate signing request using the server.key file. Store the certificate signing request in a file called server.csr. Enter the information about your company when prompted.
...
5. For the Callback URL enter http://localhost:1717/OauthRedirect
56. Check the box Use digital signatures. Click Choose File and upload the server.crt file that contains your digital certificate.
...
67. In 'Selected OAuth Scopes' add the following OAuth scopes:
Access and manage your data (api)
Perform requests on your behalf at any time (refresh_token, offline_access)
Provide access to your data via the Web (web)
...
78. Click Save → Continue.
...
89. Review Connected App details. Click Manage.
...
910. Click Edit Policies. In the 'OAuth Policies' section, select Admin approved users are pre-authorized for Permitted Users. Click OK in the popup message.
...
1011. Click Save.
1112. Go back to Setup → Build: Create → Apps → select the app. Under 'Profiles' click Manage Profiles to select profiles of those users who will have access to the app. CloudAware Collector Only and CloudAware Administrator should be selected by default. Click Save.
1213. Optional: if you would like to allow all users access the app using their credentials in CLI, select the app → Edit policies → select 'All users may self-authorize' in the 'OAuth Policies' section.
...
Let's execute a sample SOQL query * that will return AWS EC2 instances that are not deleted from AWS with Accounts, Private IP IPs and Public IPIPs:
sfdx force:data:soql:query -q "Select CA10__account__r.Name, CA10__instanceId__c, CA10__privateIpAddress__c, CA10__publicIpAddress__c from CA10__CaAwsInstance__c where CA10__disappearanceTime__c =null" -u ‘text’
...
instanceID | Demo Version |
---|---|
i-XXXXXXXXXXXXXXXXA | 3.4 |
i-XXXXXXXXXXXXXXXXB | 3.7 |
… | … |
i-XXXXXXXXXXXXXXXXZ | 3.2 |
Using CLI, we will now need to extract instanceID and Salesforce ID in order to create a Salesforce-side dataset that will look like this:
...
We will now use sort and merge commands to create a final dataset that will be used to upload the merged dataset. In the this merged dataset, records are matched by instanceID but the actual instanceID does not need to be re-imported.
...