Importing existing services
Many applications rely on existing cloud resources or dependencies before adopting a structured service framework. With nullplatform, you can bring these resources into the service schema to build a service catalog that includes both pre-existing and newly created elements.
Building a service catalog:
- Helps identify which resources are used by which applications.
- Makes it easier to monitor and manage resource usage.
- Simplifies managing service parameters for applications.
Import via API
When you create a service instance in nullplatform, it triggers a provisioning action. However, this is not needed for resources that already exist. To import an existing resource, use the service creation API with these settings:
- Set the
imported
value totrue
within theselectors
field if the service specification is intended only for importing existing resources, - Set the status to
active
. - Provide all required attributes defined in the service schema and ensure they meet the specifications.
Here's an example request
- CLI
- cURL
np service create \
--body '{
"name": "OpenWeather",
"status": "active",
"type": "dependency",
"linkable_to": [
"organization=1:account=2:namespace=3:application=4"
],
"dimensions": {
"environment": {
"required": true,
"values": ["dev", "stage"]
},
"country": {
"required": true
}
},
"dimensions": { "country": { "required": true } },
"entity_nrn": "organization=1:account=2:namespace=3:application=4",
"specification_id": "d33316ff-61e0-45d1-88d8-9e689e3859a4",
"attributes": {
"schema": {
"type": "object",
"required": [
"api_key"
],
"properties": {
"api_key": {
"type": "string",
"export": {
"secret": true
},
"readOnly": true
}
},
"additionalProperties": false
},
"values": {}
},
"selectors": {
"category": "SaaS",
"imported": true,
"provider": "OpenWeather",
"sub_category": "Weather"
}
}
curl -L 'https://api.nullplatform.com/service' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"name": "OpenWeather",
"status": "active",
"type": "dependency",
"linkable_to": [
"organization=1:account=2:namespace=3:application=4"
],
"dimensions": {
"environment": {
"required": true,
"values": ["dev", "stage"]
},
"country": {
"required": true
}
},
"entity_nrn": "organization=1:account=2:namespace=3:application=4",
"specification_id": "d33316ff-61e0-45d1-88d8-9e689e3859a4",
"attributes": {
"schema": {
"type": "object",
"required": [
"api_key"
],
"properties": {
"api_key": {
"type": "string",
"export": {
"secret": true
},
"readOnly": true
}
},
"additionalProperties": false
},
"values": {}
},
"selectors": {
"category": "SaaS",
"imported": true,
"provider": "OpenWeather",
"sub_category": "Weather"
}
}
Import using IaC tools
If you use infrastructure-as-code (IaC) tools like Terraform or OpenTofu, you can use our dedicated plugin to import configure services. This integration helps you with:
- Importing existing services.
- Creating links between services and nullplatform entities.
This integration makes it easier to get started and create a service catalog quickly.