deployments
Creates, updates, deletes, gets or lists a deployments
resource.
Overview
Name | deployments |
Type | Resource |
Id | google.config.deployments |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. Resource name of the deployment. Format: projects/{project}/locations/{location}/deployments/{deployment} |
annotations | object | Optional. Arbitrary key-value metadata storage e.g. to help client tools identify deployments during automation. See https://google.aip.dev/148#annotations for details on format and size limitations. |
artifactsGcsBucket | string | Optional. User-defined location of Cloud Build logs and artifacts in Google Cloud Storage. Format: gs://{bucket}/{folder} A default bucket will be bootstrapped if the field is not set or empty. Default bucket format: gs://--blueprint-config Constraints: - The bucket needs to be in the same project as the deployment - The path cannot be within the path of gcs_source - The field cannot be updated, including changing its presence |
createTime | string (google-datetime) | Output only. Time when the deployment was created. |
deleteBuild | string | Output only. Cloud Build instance UUID associated with deleting this deployment. |
deleteLogs | string | Output only. Location of Cloud Build logs in Google Cloud Storage, populated when deleting this deployment. Format: gs://{bucket}/{object} . |
deleteResults | object | Output only. Location of artifacts from a DeleteDeployment operation. (id: ApplyResults) |
errorCode | string | Output only. Error code describing errors that may have occurred. |
errorLogs | string | Output only. Location of Terraform error logs in Google Cloud Storage. Format: gs://{bucket}/{object} . |
importExistingResources | boolean | By default, Infra Manager will return a failure when Terraform encounters a 409 code (resource conflict error) during actuation. If this flag is set to true, Infra Manager will instead attempt to automatically import the resource into the Terraform state (for supported resource types) and continue actuation. Not all resource types are supported, refer to documentation. |
labels | object | Optional. User-defined metadata for the deployment. |
latestRevision | string | Output only. Revision name that was most recently applied. Format: projects/{project}/locations/{location}/deployments/{deployment}/ revisions/{revision} |
lockState | string | Output only. Current lock state of the deployment. |
providerConfig | object | Optional. This field specifies the provider configurations. (id: ProviderConfig) |
quotaValidation | string | Optional. Input to control quota checks for resources in terraform configuration files. There are limited resources on which quota validation applies. |
serviceAccount | string | Required. User-specified Service Account (SA) credentials to be used when actuating resources. Format: projects/{projectID}/serviceAccounts/{serviceAccount} |
state | string | Output only. Current state of the deployment. |
stateDetail | string | Output only. Additional information regarding the current state. |
terraformBlueprint | object | A blueprint described using Terraform's HashiCorp Configuration Language as a root module. (id: TerraformBlueprint) |
tfErrors | array | Output only. Errors encountered when deleting this deployment. Errors are truncated to 10 entries, see delete_results and error_logs for full details. |
tfVersion | string | Output only. The current Terraform version set on the deployment. It is in the format of "Major.Minor.Patch", for example, "1.3.10". |
tfVersionConstraint | string | Optional. The user-specified Terraform version constraint. Example: "=1.3.10". |
updateTime | string (google-datetime) | Output only. Time when the deployment was last modified. |
workerPool | string | Optional. The user-specified Cloud Build worker pool resource in which the Cloud Build job will execute. Format: projects/{project}/locations/{location}/workerPools/{workerPoolId} . If this field is unspecified, the default Cloud Build worker pool will be used. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. Resource name of the deployment. Format: projects/{project}/locations/{location}/deployments/{deployment} |
annotations | object | Optional. Arbitrary key-value metadata storage e.g. to help client tools identify deployments during automation. See https://google.aip.dev/148#annotations for details on format and size limitations. |
artifactsGcsBucket | string | Optional. User-defined location of Cloud Build logs and artifacts in Google Cloud Storage. Format: gs://{bucket}/{folder} A default bucket will be bootstrapped if the field is not set or empty. Default bucket format: gs://--blueprint-config Constraints: - The bucket needs to be in the same project as the deployment - The path cannot be within the path of gcs_source - The field cannot be updated, including changing its presence |
createTime | string (google-datetime) | Output only. Time when the deployment was created. |
deleteBuild | string | Output only. Cloud Build instance UUID associated with deleting this deployment. |
deleteLogs | string | Output only. Location of Cloud Build logs in Google Cloud Storage, populated when deleting this deployment. Format: gs://{bucket}/{object} . |
deleteResults | object | Output only. Location of artifacts from a DeleteDeployment operation. (id: ApplyResults) |
errorCode | string | Output only. Error code describing errors that may have occurred. |
errorLogs | string | Output only. Location of Terraform error logs in Google Cloud Storage. Format: gs://{bucket}/{object} . |
importExistingResources | boolean | By default, Infra Manager will return a failure when Terraform encounters a 409 code (resource conflict error) during actuation. If this flag is set to true, Infra Manager will instead attempt to automatically import the resource into the Terraform state (for supported resource types) and continue actuation. Not all resource types are supported, refer to documentation. |
labels | object | Optional. User-defined metadata for the deployment. |
latestRevision | string | Output only. Revision name that was most recently applied. Format: projects/{project}/locations/{location}/deployments/{deployment}/ revisions/{revision} |
lockState | string | Output only. Current lock state of the deployment. |
providerConfig | object | Optional. This field specifies the provider configurations. (id: ProviderConfig) |
quotaValidation | string | Optional. Input to control quota checks for resources in terraform configuration files. There are limited resources on which quota validation applies. |
serviceAccount | string | Required. User-specified Service Account (SA) credentials to be used when actuating resources. Format: projects/{projectID}/serviceAccounts/{serviceAccount} |
state | string | Output only. Current state of the deployment. |
stateDetail | string | Output only. Additional information regarding the current state. |
terraformBlueprint | object | A blueprint described using Terraform's HashiCorp Configuration Language as a root module. (id: TerraformBlueprint) |
tfErrors | array | Output only. Errors encountered when deleting this deployment. Errors are truncated to 10 entries, see delete_results and error_logs for full details. |
tfVersion | string | Output only. The current Terraform version set on the deployment. It is in the format of "Major.Minor.Patch", for example, "1.3.10". |
tfVersionConstraint | string | Optional. The user-specified Terraform version constraint. Example: "=1.3.10". |
updateTime | string (google-datetime) | Output only. Time when the deployment was last modified. |
workerPool | string | Optional. The user-specified Cloud Build worker pool resource in which the Cloud Build job will execute. Format: projects/{project}/locations/{location}/workerPools/{workerPoolId} . If this field is unspecified, the default Cloud Build worker pool will be used. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , deploymentsId | Gets details about a Deployment. | |
list | select | projectsId , locationsId | pageSize , pageToken , filter , orderBy | Lists Deployments in a given project and location. |
create | insert | projectsId , locationsId | deploymentId , requestId | Creates a Deployment. |
patch | update | projectsId , locationsId , deploymentsId | updateMask , requestId | Updates a Deployment. |
delete | delete | projectsId , locationsId , deploymentsId | requestId , force , deletePolicy | Deletes a Deployment. |
export_state | exec | projectsId , locationsId , deploymentsId | Exports Terraform state file from a given deployment. | |
import_state | exec | projectsId , locationsId , deploymentsId | Imports Terraform state file in a given deployment. The state file does not take effect until the Deployment has been unlocked. | |
delete_state | exec | projectsId , locationsId , deploymentsId | Deletes Terraform state file in a given deployment. | |
lock | exec | projectsId , locationsId , deploymentsId | Locks a deployment. | |
unlock | exec | projectsId , locationsId , deploymentsId | Unlocks a locked deployment. | |
export_lock | exec | projectsId , locationsId , deploymentsId | Exports the lock info on a locked deployment. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
deploymentsId | string | |
locationsId | string | |
projectsId | string | |
deletePolicy | string | |
deploymentId | string | |
filter | string | |
force | boolean | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
requestId | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
Gets details about a Deployment.
SELECT
name,
annotations,
artifactsGcsBucket,
createTime,
deleteBuild,
deleteLogs,
deleteResults,
errorCode,
errorLogs,
importExistingResources,
labels,
latestRevision,
lockState,
providerConfig,
quotaValidation,
serviceAccount,
state,
stateDetail,
terraformBlueprint,
tfErrors,
tfVersion,
tfVersionConstraint,
updateTime,
workerPool
FROM google.config.deployments
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND deploymentsId = '{{ deploymentsId }}' -- required;
Lists Deployments in a given project and location.
SELECT
name,
annotations,
artifactsGcsBucket,
createTime,
deleteBuild,
deleteLogs,
deleteResults,
errorCode,
errorLogs,
importExistingResources,
labels,
latestRevision,
lockState,
providerConfig,
quotaValidation,
serviceAccount,
state,
stateDetail,
terraformBlueprint,
tfErrors,
tfVersion,
tfVersionConstraint,
updateTime,
workerPool
FROM google.config.deployments
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}';
INSERT
examples
- create
- Manifest
Creates a Deployment.
INSERT INTO google.config.deployments (
data__terraformBlueprint,
data__name,
data__labels,
data__artifactsGcsBucket,
data__serviceAccount,
data__importExistingResources,
data__workerPool,
data__tfVersionConstraint,
data__quotaValidation,
data__annotations,
data__providerConfig,
projectsId,
locationsId,
deploymentId,
requestId
)
SELECT
'{{ terraformBlueprint }}',
'{{ name }}',
'{{ labels }}',
'{{ artifactsGcsBucket }}',
'{{ serviceAccount }}',
{{ importExistingResources }},
'{{ workerPool }}',
'{{ tfVersionConstraint }}',
'{{ quotaValidation }}',
'{{ annotations }}',
'{{ providerConfig }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ deploymentId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: deployments
props:
- name: projectsId
value: string
description: Required parameter for the deployments resource.
- name: locationsId
value: string
description: Required parameter for the deployments resource.
- name: terraformBlueprint
value: object
description: >
A blueprint described using Terraform's HashiCorp Configuration Language as a root module.
- name: name
value: string
description: >
Identifier. Resource name of the deployment. Format: `projects/{project}/locations/{location}/deployments/{deployment}`
- name: labels
value: object
description: >
Optional. User-defined metadata for the deployment.
- name: artifactsGcsBucket
value: string
description: >
Optional. User-defined location of Cloud Build logs and artifacts in Google Cloud Storage. Format: `gs://{bucket}/{folder}` A default bucket will be bootstrapped if the field is not set or empty. Default bucket format: `gs://--blueprint-config` Constraints: - The bucket needs to be in the same project as the deployment - The path cannot be within the path of `gcs_source` - The field cannot be updated, including changing its presence
- name: serviceAccount
value: string
description: >
Required. User-specified Service Account (SA) credentials to be used when actuating resources. Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
- name: importExistingResources
value: boolean
description: >
By default, Infra Manager will return a failure when Terraform encounters a 409 code (resource conflict error) during actuation. If this flag is set to true, Infra Manager will instead attempt to automatically import the resource into the Terraform state (for supported resource types) and continue actuation. Not all resource types are supported, refer to documentation.
- name: workerPool
value: string
description: >
Optional. The user-specified Cloud Build worker pool resource in which the Cloud Build job will execute. Format: `projects/{project}/locations/{location}/workerPools/{workerPoolId}`. If this field is unspecified, the default Cloud Build worker pool will be used.
- name: tfVersionConstraint
value: string
description: >
Optional. The user-specified Terraform version constraint. Example: "=1.3.10".
- name: quotaValidation
value: string
description: >
Optional. Input to control quota checks for resources in terraform configuration files. There are limited resources on which quota validation applies.
valid_values: ['QUOTA_VALIDATION_UNSPECIFIED', 'ENABLED', 'ENFORCED']
- name: annotations
value: object
description: >
Optional. Arbitrary key-value metadata storage e.g. to help client tools identify deployments during automation. See https://google.aip.dev/148#annotations for details on format and size limitations.
- name: providerConfig
value: object
description: >
Optional. This field specifies the provider configurations.
- name: deploymentId
value: string
- name: requestId
value: string
UPDATE
examples
- patch
Updates a Deployment.
UPDATE google.config.deployments
SET
data__terraformBlueprint = '{{ terraformBlueprint }}',
data__name = '{{ name }}',
data__labels = '{{ labels }}',
data__artifactsGcsBucket = '{{ artifactsGcsBucket }}',
data__serviceAccount = '{{ serviceAccount }}',
data__importExistingResources = {{ importExistingResources }},
data__workerPool = '{{ workerPool }}',
data__tfVersionConstraint = '{{ tfVersionConstraint }}',
data__quotaValidation = '{{ quotaValidation }}',
data__annotations = '{{ annotations }}',
data__providerConfig = '{{ providerConfig }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND deploymentsId = '{{ deploymentsId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
done,
error,
metadata,
response;
DELETE
examples
- delete
Deletes a Deployment.
DELETE FROM google.config.deployments
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND deploymentsId = '{{ deploymentsId }}' --required
AND requestId = '{{ requestId }}'
AND force = '{{ force }}'
AND deletePolicy = '{{ deletePolicy }}';
Lifecycle Methods
- export_state
- import_state
- delete_state
- lock
- unlock
- export_lock
Exports Terraform state file from a given deployment.
EXEC google.config.deployments.export_state
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@deploymentsId='{{ deploymentsId }}' --required
@@json=
'{
"draft": {{ draft }}
}';
Imports Terraform state file in a given deployment. The state file does not take effect until the Deployment has been unlocked.
EXEC google.config.deployments.import_state
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@deploymentsId='{{ deploymentsId }}' --required
@@json=
'{
"lockId": "{{ lockId }}"
}';
Deletes Terraform state file in a given deployment.
EXEC google.config.deployments.delete_state
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@deploymentsId='{{ deploymentsId }}' --required
@@json=
'{
"lockId": "{{ lockId }}"
}';
Locks a deployment.
EXEC google.config.deployments.lock
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@deploymentsId='{{ deploymentsId }}' --required;
Unlocks a locked deployment.
EXEC google.config.deployments.unlock
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@deploymentsId='{{ deploymentsId }}' --required
@@json=
'{
"lockId": "{{ lockId }}"
}';
Exports the lock info on a locked deployment.
EXEC google.config.deployments.export_lock
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@deploymentsId='{{ deploymentsId }}' --required;