previews
Creates, updates, deletes, gets or lists a previews
resource.
Overview
Name | previews |
Type | Resource |
Id | google.config.previews |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. Resource name of the preview. Resource name can be user provided or server generated ID if unspecified. Format: projects/{project}/locations/{location}/previews/{preview} |
annotations | object | Optional. Arbitrary key-value metadata storage e.g. to help client tools identify preview 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, artifacts, and 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 If omitted and deployment resource ref provided has artifacts_gcs_bucket defined, that artifact bucket is used. |
build | string | Output only. Cloud Build instance UUID associated with this preview. |
createTime | string (google-datetime) | Output only. Time the preview was created. |
deployment | string | Optional. Optional deployment reference. If specified, the preview will be performed using the provided deployment's current state and use any relevant fields from the deployment unless explicitly specified in the preview create request. |
errorCode | string | Output only. Code describing any errors that may have occurred. |
errorLogs | string | Output only. Link to tf-error.ndjson file, which contains the full list of the errors encountered during a Terraform preview. Format: gs://{bucket}/{object} . |
errorStatus | object | Output only. Additional information regarding the current state. (id: Status) |
labels | object | Optional. User-defined labels for the preview. |
logs | string | Output only. Location of preview logs in gs://{bucket}/{object} format. |
previewArtifacts | object | Output only. Artifacts from preview. (id: PreviewArtifacts) |
previewMode | string | Optional. Current mode of preview. |
providerConfig | object | Optional. This field specifies the provider configurations. (id: ProviderConfig) |
serviceAccount | string | Required. User-specified Service Account (SA) credentials to be used when previewing resources. Format: projects/{projectID}/serviceAccounts/{serviceAccount} |
state | string | Output only. Current state of the preview. |
terraformBlueprint | object | The terraform blueprint to preview. (id: TerraformBlueprint) |
tfErrors | array | Output only. Summary of errors encountered during Terraform preview. It has a size limit of 10, i.e. only top 10 errors will be summarized here. |
tfVersion | string | Output only. The current Terraform version set on the preview. 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". |
workerPool | string | Optional. The user-specified 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. If omitted and deployment resource ref provided has worker_pool defined, that worker pool is used. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. Resource name of the preview. Resource name can be user provided or server generated ID if unspecified. Format: projects/{project}/locations/{location}/previews/{preview} |
annotations | object | Optional. Arbitrary key-value metadata storage e.g. to help client tools identify preview 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, artifacts, and 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 If omitted and deployment resource ref provided has artifacts_gcs_bucket defined, that artifact bucket is used. |
build | string | Output only. Cloud Build instance UUID associated with this preview. |
createTime | string (google-datetime) | Output only. Time the preview was created. |
deployment | string | Optional. Optional deployment reference. If specified, the preview will be performed using the provided deployment's current state and use any relevant fields from the deployment unless explicitly specified in the preview create request. |
errorCode | string | Output only. Code describing any errors that may have occurred. |
errorLogs | string | Output only. Link to tf-error.ndjson file, which contains the full list of the errors encountered during a Terraform preview. Format: gs://{bucket}/{object} . |
errorStatus | object | Output only. Additional information regarding the current state. (id: Status) |
labels | object | Optional. User-defined labels for the preview. |
logs | string | Output only. Location of preview logs in gs://{bucket}/{object} format. |
previewArtifacts | object | Output only. Artifacts from preview. (id: PreviewArtifacts) |
previewMode | string | Optional. Current mode of preview. |
providerConfig | object | Optional. This field specifies the provider configurations. (id: ProviderConfig) |
serviceAccount | string | Required. User-specified Service Account (SA) credentials to be used when previewing resources. Format: projects/{projectID}/serviceAccounts/{serviceAccount} |
state | string | Output only. Current state of the preview. |
terraformBlueprint | object | The terraform blueprint to preview. (id: TerraformBlueprint) |
tfErrors | array | Output only. Summary of errors encountered during Terraform preview. It has a size limit of 10, i.e. only top 10 errors will be summarized here. |
tfVersion | string | Output only. The current Terraform version set on the preview. 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". |
workerPool | string | Optional. The user-specified 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. If omitted and deployment resource ref provided has worker_pool defined, that worker pool is used. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , previewsId | Gets details about a Preview. | |
list | select | projectsId , locationsId | pageSize , pageToken , filter , orderBy | Lists Previews in a given project and location. |
create | insert | projectsId , locationsId | previewId , requestId | Creates a Preview. |
delete | delete | projectsId , locationsId , previewsId | requestId | Deletes a Preview. |
export | exec | projectsId , locationsId , previewsId | Export Preview results. |
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 |
---|---|---|
locationsId | string | |
previewsId | string | |
projectsId | string | |
filter | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
previewId | string | |
requestId | string |
SELECT
examples
- get
- list
Gets details about a Preview.
SELECT
name,
annotations,
artifactsGcsBucket,
build,
createTime,
deployment,
errorCode,
errorLogs,
errorStatus,
labels,
logs,
previewArtifacts,
previewMode,
providerConfig,
serviceAccount,
state,
terraformBlueprint,
tfErrors,
tfVersion,
tfVersionConstraint,
workerPool
FROM google.config.previews
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND previewsId = '{{ previewsId }}' -- required;
Lists Previews in a given project and location.
SELECT
name,
annotations,
artifactsGcsBucket,
build,
createTime,
deployment,
errorCode,
errorLogs,
errorStatus,
labels,
logs,
previewArtifacts,
previewMode,
providerConfig,
serviceAccount,
state,
terraformBlueprint,
tfErrors,
tfVersion,
tfVersionConstraint,
workerPool
FROM google.config.previews
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 Preview.
INSERT INTO google.config.previews (
data__terraformBlueprint,
data__name,
data__labels,
data__deployment,
data__previewMode,
data__serviceAccount,
data__artifactsGcsBucket,
data__workerPool,
data__tfVersionConstraint,
data__annotations,
data__providerConfig,
projectsId,
locationsId,
previewId,
requestId
)
SELECT
'{{ terraformBlueprint }}',
'{{ name }}',
'{{ labels }}',
'{{ deployment }}',
'{{ previewMode }}',
'{{ serviceAccount }}',
'{{ artifactsGcsBucket }}',
'{{ workerPool }}',
'{{ tfVersionConstraint }}',
'{{ annotations }}',
'{{ providerConfig }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ previewId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: previews
props:
- name: projectsId
value: string
description: Required parameter for the previews resource.
- name: locationsId
value: string
description: Required parameter for the previews resource.
- name: terraformBlueprint
value: object
description: >
The terraform blueprint to preview.
- name: name
value: string
description: >
Identifier. Resource name of the preview. Resource name can be user provided or server generated ID if unspecified. Format: `projects/{project}/locations/{location}/previews/{preview}`
- name: labels
value: object
description: >
Optional. User-defined labels for the preview.
- name: deployment
value: string
description: >
Optional. Optional deployment reference. If specified, the preview will be performed using the provided deployment's current state and use any relevant fields from the deployment unless explicitly specified in the preview create request.
- name: previewMode
value: string
description: >
Optional. Current mode of preview.
valid_values: ['PREVIEW_MODE_UNSPECIFIED', 'DEFAULT', 'DELETE']
- name: serviceAccount
value: string
description: >
Required. User-specified Service Account (SA) credentials to be used when previewing resources. Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
- name: artifactsGcsBucket
value: string
description: >
Optional. User-defined location of Cloud Build logs, artifacts, and 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` If omitted and deployment resource ref provided has artifacts_gcs_bucket defined, that artifact bucket is used.
- name: workerPool
value: string
description: >
Optional. The user-specified 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. If omitted and deployment resource ref provided has worker_pool defined, that worker pool is used.
- name: tfVersionConstraint
value: string
description: >
Optional. The user-specified Terraform version constraint. Example: "=1.3.10".
- name: annotations
value: object
description: >
Optional. Arbitrary key-value metadata storage e.g. to help client tools identify preview 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: previewId
value: string
- name: requestId
value: string
DELETE
examples
- delete
Deletes a Preview.
DELETE FROM google.config.previews
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND previewsId = '{{ previewsId }}' --required
AND requestId = '{{ requestId }}';
Lifecycle Methods
- export
Export Preview results.
EXEC google.config.previews.export
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@previewsId='{{ previewsId }}' --required;