latestOpenAPI 3.0.02026-08-10221235717.8 KB

e21ad140ec3c

public
ResourceDefinition

Update a Resource Definition.

put/orgs/{orgId}/resources/defs/{defId}

Path parameters

orgIdstring required

The Organization ID.

defIdstring required

The Resource Definition ID.

Request body

driver_typestring

(Optional) The driver to be used to create the resource.

driver_accountstring

(Optional) Security account required by the driver.

in_place_driver_changeboolean

(Optional) If true, the Operator will not delete resources provisioned by the previous driver when driver_type changes on a later update; the new driver takes over the existing infrastructure in place. Applies to the Operator provisioning path only.

namestring required

The display name.

provisionobject

(Optional) A map where the keys are resType#resId (if resId is omitted, the same id of the current resource definition is used) of the resources that should be provisioned when the current resource is provisioned. This also specifies if the resources have a dependency on the current resource or if they have the same dependent resources.

proposedboolean

(Optional) If true, the new definition version should be created as "proposed" version (not active).

Example request

{
  "driver_type": "humanitec/terraform",
  "driver_account": "gcp-dev-cloudsql",
  "driver_inputs": {
    "secret_refs": {
      "dbcredentials": {
        "password": {
          "ref": "path--to--password",
          "store": "my-store",
          "version": "1"
        },
        "username": {
          "value": "***"
        }
      }
    },
    "values": {
      "instance": "my-dev-project:my-region:dev-db"
    }
  },
  "name": "Dev Postgres Instance",
  "provision": {
    "aws-policy": {
      "is_dependent": false
    },
    "dns#my-dns": {}
  }
}

Response

The updated Resource Definition.

created_atstring date-time required

The timestamp of when this record has been created.

created_bystring required

The user who created this record.

updated_atstring date-time

The timestamp of when this record has been updated.

updated_bystring

The user who updated this record.

driver_accountstring

(Optional) Security account required by the driver.

driver_typestring required

The driver to be used to create the resource.

idstring required

The Resource Definition ID.

active_version_idstring required

The active Resource Definition Version ID.

in_place_driver_changeboolean required

If true, the Operator will not delete resources provisioned by the previous driver when driver_type changes on a later update; the new driver takes over the existing infrastructure in place. Applies to the Operator provisioning path only.

is_defaultboolean required

Indicates this definition is a built-in one (provided by Humanitec).

is_deletedboolean required

Indicates if this record has been marked for deletion. The Resource Definition that has been marked for deletion cannot be used to provision new resources.

namestring required

The display name.

org_idstring required

The Organization ID.

provisionobject

(Optional) A map where the keys are resType#resId (if resId is omitted, the same id of the current resource definition is used) of the resources that should be provisioned when the current resource is provisioned. This also specifies if the resources have a dependency on the current resource.

typestring required

The Resource Type.

Example response

{
  "created_at": "2020-05-23T12:32:16Z",
  "created_by": "a.user@example.com",
  "criteria": [
    {
      "env_type": "development",
      "id": "123456"
    }
  ],
  "driver_account": "gcp-dev-cloudsql",
  "driver_inputs": {
    "secret_refs": {
      "credentials": {
        "password": {
          "value": "<secret>"
        },
        "user": {
          "ref": "vault/path/to/data/secrets/user",
          "store": "my-external-vault",
          "version": "1"
        }
      }
    },
    "values": {
      "instance": "my-dev-project:my-region:dev-db"
    }
  },
  "driver_type": "humanitec/postgres-cloudsql",
  "id": "dev-postgres",
  "is_default": false,
  "is_deleted": false,
  "name": "Dev Postgres Instance",
  "org_id": "test-org",
  "provision": {
    "aws-policy": {
      "is_dependent": false,
      "match_dependents": false
    },
    "dns#my-dns": {}
  },
  "type": "postgres"
}