deployments
Creates, updates, deletes, gets or lists a deployments
resource.
Overview
Name | deployments |
Type | Resource |
Id | google.config.deployments |
Fields
Name | Datatype | Description |
---|---|---|
name | string | 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 | 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 | Outputs and artifacts from applying a deployment. |
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 | 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. |
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 | Optional. 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 | TerraformBlueprint describes the source of a Terraform root module which describes the resources and configs to be deployed. |
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 | 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
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | deploymentsId, locationsId, projectsId | Gets details about a Deployment. |
list | SELECT | locationsId, projectsId | Lists Deployments in a given project and location. |
create | INSERT | locationsId, projectsId | Creates a Deployment. |
delete | DELETE | deploymentsId, locationsId, projectsId | Deletes a Deployment. |
patch | UPDATE | deploymentsId, locationsId, projectsId | Updates a Deployment. |
export_lock | EXEC | deploymentsId, locationsId, projectsId | Exports the lock info on a locked deployment. |
export_state | EXEC | deploymentsId, locationsId, projectsId | Exports Terraform state file from a given deployment. |
import_state | EXEC | deploymentsId, locationsId, projectsId | Imports Terraform state file in a given deployment. The state file does not take effect until the Deployment has been unlocked. |
lock | EXEC | deploymentsId, locationsId, projectsId | Locks a deployment. |
unlock | EXEC | deploymentsId, locationsId, projectsId | Unlocks a locked deployment. |
SELECT
examples
Lists Deployments in a given project and location.
SELECT
name,
annotations,
artifactsGcsBucket,
createTime,
deleteBuild,
deleteLogs,
deleteResults,
errorCode,
errorLogs,
importExistingResources,
labels,
latestRevision,
lockState,
quotaValidation,
serviceAccount,
state,
stateDetail,
terraformBlueprint,
tfErrors,
tfVersion,
tfVersionConstraint,
updateTime,
workerPool
FROM google.config.deployments
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new deployments
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.config.deployments (
locationsId,
projectsId,
terraformBlueprint,
name,
labels,
artifactsGcsBucket,
serviceAccount,
importExistingResources,
workerPool,
tfVersionConstraint,
quotaValidation,
annotations
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ terraformBlueprint }}',
'{{ name }}',
'{{ labels }}',
'{{ artifactsGcsBucket }}',
'{{ serviceAccount }}',
{{ importExistingResources }},
'{{ workerPool }}',
'{{ tfVersionConstraint }}',
'{{ quotaValidation }}',
'{{ annotations }}'
;
- name: your_resource_model_name
props:
- name: terraformBlueprint
value:
- name: gcsSource
value: string
- name: gitSource
value:
- name: repo
value: string
- name: directory
value: string
- name: ref
value: string
- name: inputValues
value: object
- name: name
value: string
- name: createTime
value: string
- name: updateTime
value: string
- name: labels
value: object
- name: state
value: string
- name: latestRevision
value: string
- name: stateDetail
value: string
- name: errorCode
value: string
- name: deleteResults
value:
- name: content
value: string
- name: artifacts
value: string
- name: outputs
value: object
- name: deleteBuild
value: string
- name: deleteLogs
value: string
- name: tfErrors
value:
- - name: resourceAddress
value: string
- name: httpResponseCode
value: integer
- name: errorDescription
value: string
- name: error
value:
- name: code
value: integer
- name: message
value: string
- name: details
value:
- object
- name: errorLogs
value: string
- name: artifactsGcsBucket
value: string
- name: serviceAccount
value: string
- name: importExistingResources
value: boolean
- name: workerPool
value: string
- name: lockState
value: string
- name: tfVersionConstraint
value: string
- name: tfVersion
value: string
- name: quotaValidation
value: string
- name: annotations
value: object
UPDATE
example
Updates a deployments
resource.
/*+ update */
UPDATE google.config.deployments
SET
terraformBlueprint = '{{ terraformBlueprint }}',
name = '{{ name }}',
labels = '{{ labels }}',
artifactsGcsBucket = '{{ artifactsGcsBucket }}',
serviceAccount = '{{ serviceAccount }}',
importExistingResources = true|false,
workerPool = '{{ workerPool }}',
tfVersionConstraint = '{{ tfVersionConstraint }}',
quotaValidation = '{{ quotaValidation }}',
annotations = '{{ annotations }}'
WHERE
deploymentsId = '{{ deploymentsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';
DELETE
example
Deletes the specified deployments
resource.
/*+ delete */
DELETE FROM google.config.deployments
WHERE deploymentsId = '{{ deploymentsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';