How to Collect DigitalOcean Resource Data
The DigitalOcean collector is configured within the Fix Inventory Worker configuration via the config
command in Fix Inventory Shell.
Prerequisites​
This guide assumes that you have already installed Fix Inventory.
Directions​
1. Enable the DigitalOcean Collector​
-
Open the Fix Inventory Worker configuration via the
config
command in Fix Inventory Shell:> config edit fix.worker
-
Add
digitalocean
to the list of collectors by modifying the configuration as follows:fixworker:
...
# List of collectors to run
collector:
- 'digitalocean'
...
...
2. Authenticate with DigitalOcean​
DigitalOcean uses access tokens to authenticate API requests. You can provide access tokens to Fix Inventory via the Fix Inventory Worker configuration or environment variables.
- Fix Inventory Worker Configuration
- Environment Variables
-
Open the Fix Inventory Worker configuration via the
config
command in Fix Inventory Shell:> config edit fix.worker
-
Modify the
digitalocean
section of the configuration as follows, adding your API tokens and/or access keys:digitalocean:
# DigitalOcean API tokens for the teams to be collected
api_tokens:
- 'dop_v1_e5c759260e6a43f003f3b53e2cfec79cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
# DigitalOcean Spaces access keys for the teams to be collected, separated by colons
spaces_access_keys: []
...
Instead of specifying API tokens or secret access keys in the Fix Inventory Worker configuration directly, it is possible to define them using the --override
flag or FIXWORKER_OVERRIDE
environment variable.
-
Set the
FIXWORKER_OVERRIDE
environment variable:-
Add a environment variable definition to the
fixworker
service indocker-compose.yaml
:docker-compose.yamlservices:
...
fixworker:
environment:
- FIXWORKER_OVERRIDE="digitalocean.api_tokens=dop_v1_e5c759260e6a43f003f3b53e2cfec79cxxxxxxxxxxxxxxxxxxxxxxxx"
...
... -
Recreate the
fixworker
container with the updated service definition:$ docker-compose up -d
noteDocker Compose V2 integrated compose functions in to the Docker platform.
In Docker Compose V2, the command is
docker compose
(no hyphen) instead ofdocker-compose
.
-
3. Trigger Resource Collection​
-
By default, Fix Inventory performs resource collection each hour. To immediately trigger a collect run, use the
workflow run
command in Fix Inventory Shell:> workflow run collect
-
Once the collect run completes, you can view a summary of collected DigitalOcean resources using the following search:
> search is(digitalocean_resource) | count kind