Skip to main content

posture_deployments

Creates, updates, deletes, gets or lists a posture_deployments resource.

Overview

Nameposture_deployments
TypeResource
Idgoogle.securityposture.posture_deployments

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringRequired. Identifier. The name of the posture deployment, in the format organizations/{organization}/locations/global/postureDeployments/{deployment_id}.
annotationsobjectOptional. The user-specified annotations for the posture deployment. For details about the values you can use in an annotation, see AIP-148: Standard fields.
categoriesarrayOutput only. The categories that the posture deployment belongs to, as determined by the Security Posture API.
createTimestring (google-datetime)Output only. The time at which the posture deployment was created.
descriptionstringOptional. A description of the posture deployment.
desiredPostureIdstringOutput only. The posture ID that was specified for the deployment. Present only if the posture deployment is in a failed state.
desiredPostureRevisionIdstringOutput only. The revision ID of the posture that was specified for the deployment. Present only if the deployment is in a failed state.
etagstringOptional. An opaque identifier for the current version of the posture deployment. To prevent concurrent updates from overwriting each other, always provide the etag when you update a posture deployment. You can also provide the etag when you delete a posture deployment, to help ensure that you're deleting the intended posture deployment.
failureMessagestringOutput only. A description of why the posture deployment failed. Present only if the deployment is in a failed state.
postureIdstringRequired. The posture used in the deployment, in the format organizations/{organization}/locations/global/postures/{posture_id}.
postureRevisionIdstringRequired. The revision ID of the posture used in the deployment.
reconcilingbooleanOutput only. Whether the posture deployment is in the process of being updated.
statestringOutput only. The state of the posture deployment.
targetResourcestringRequired. The organization, folder, or project where the posture is deployed. Uses one of the following formats: * organizations/{organization_number} * folders/{folder_number} * projects/{project_number}
updateTimestring (google-datetime)Output only. The time at which the posture deployment was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectorganizationsId, locationsId, postureDeploymentsIdGets details for a PostureDeployment.
listselectorganizationsId, locationsIdpageSize, pageToken, filterLists every PostureDeployment in a project and location.
createinsertorganizationsId, locationsIdpostureDeploymentIdCreates a new PostureDeployment in a given project and location.
patchupdateorganizationsId, locationsId, postureDeploymentsIdupdateMaskUpdates an existing PostureDeployment. To prevent concurrent updates from overwriting each other, always follow the read-modify-write pattern when you update a posture deployment: 1. Call GetPostureDeployment to get the current version of the deployment. 2. Update the fields in the deployment as needed. 3. Call UpdatePostureDeployment to update the deployment. Ensure that your request includes the etag value from the GetPostureDeployment response. Important: If you omit the etag when you call UpdatePostureDeployment, then the updated deployment unconditionally overwrites the existing deployment.
deletedeleteorganizationsId, locationsId, postureDeploymentsIdetagDeletes a PostureDeployment.

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.

NameDatatypeDescription
locationsIdstring
organizationsIdstring
postureDeploymentsIdstring
etagstring
filterstring
pageSizeinteger (int32)
pageTokenstring
postureDeploymentIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets details for a PostureDeployment.

SELECT
name,
annotations,
categories,
createTime,
description,
desiredPostureId,
desiredPostureRevisionId,
etag,
failureMessage,
postureId,
postureRevisionId,
reconciling,
state,
targetResource,
updateTime
FROM google.securityposture.posture_deployments
WHERE organizationsId = '{{ organizationsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND postureDeploymentsId = '{{ postureDeploymentsId }}' -- required;

INSERT examples

Creates a new PostureDeployment in a given project and location.

INSERT INTO google.securityposture.posture_deployments (
data__name,
data__targetResource,
data__postureId,
data__postureRevisionId,
data__description,
data__etag,
data__annotations,
organizationsId,
locationsId,
postureDeploymentId
)
SELECT
'{{ name }}',
'{{ targetResource }}',
'{{ postureId }}',
'{{ postureRevisionId }}',
'{{ description }}',
'{{ etag }}',
'{{ annotations }}',
'{{ organizationsId }}',
'{{ locationsId }}',
'{{ postureDeploymentId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates an existing PostureDeployment. To prevent concurrent updates from overwriting each other, always follow the read-modify-write pattern when you update a posture deployment: 1. Call GetPostureDeployment to get the current version of the deployment. 2. Update the fields in the deployment as needed. 3. Call UpdatePostureDeployment to update the deployment. Ensure that your request includes the etag value from the GetPostureDeployment response. Important: If you omit the etag when you call UpdatePostureDeployment, then the updated deployment unconditionally overwrites the existing deployment.

UPDATE google.securityposture.posture_deployments
SET
data__name = '{{ name }}',
data__targetResource = '{{ targetResource }}',
data__postureId = '{{ postureId }}',
data__postureRevisionId = '{{ postureRevisionId }}',
data__description = '{{ description }}',
data__etag = '{{ etag }}',
data__annotations = '{{ annotations }}'
WHERE
organizationsId = '{{ organizationsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND postureDeploymentsId = '{{ postureDeploymentsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a PostureDeployment.

DELETE FROM google.securityposture.posture_deployments
WHERE organizationsId = '{{ organizationsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND postureDeploymentsId = '{{ postureDeploymentsId }}' --required
AND etag = '{{ etag }}';