Skip to main content

workload_identity_pools

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

Overview

Nameworkload_identity_pools
TypeResource
Idgoogle.iam.workload_identity_pools

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name of the pool.
descriptionstringOptional. A description of the pool. Cannot exceed 256 characters.
disabledbooleanOptional. Whether the pool is disabled. You cannot use a disabled pool to exchange tokens, or use existing tokens to access resources. If the pool is re-enabled, existing tokens grant access again.
displayNamestringOptional. A display name for the pool. Cannot exceed 32 characters.
expireTimestring (google-datetime)Output only. Time after which the workload identity pool will be permanently purged and cannot be recovered.
inlineCertificateIssuanceConfigobjectOptional. Defines the Certificate Authority (CA) pool resources and configurations required for issuance and rotation of mTLS workload certificates. (id: InlineCertificateIssuanceConfig)
inlineTrustConfigobjectOptional. Represents config to add additional trusted trust domains. (id: InlineTrustConfig)
modestringImmutable. The mode the pool is operating in.
statestringOutput only. The state of the pool.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, workloadIdentityPoolsIdGets an individual WorkloadIdentityPool.
listselectprojectsId, locationsIdpageSize, pageToken, showDeletedLists all non-deleted WorkloadIdentityPools in a project. If show_deleted is set to true, then deleted pools are also listed.
createinsertprojectsId, locationsIdworkloadIdentityPoolIdCreates a new WorkloadIdentityPool. You cannot reuse the name of a deleted pool until 30 days after deletion.
patchupdateprojectsId, locationsId, workloadIdentityPoolsIdupdateMaskUpdates an existing WorkloadIdentityPool.
deletedeleteprojectsId, locationsId, workloadIdentityPoolsIdDeletes a WorkloadIdentityPool. You cannot use a deleted pool to exchange external credentials for Google Cloud credentials. However, deletion does not revoke credentials that have already been issued. Credentials issued for a deleted pool do not grant access to resources. If the pool is undeleted, and the credentials are not expired, they grant access again. You can undelete a pool for 30 days. After 30 days, deletion is permanent. You cannot update deleted pools. However, you can view and list them.
undeleteexecprojectsId, locationsId, workloadIdentityPoolsIdUndeletes a WorkloadIdentityPool, as long as it was deleted fewer than 30 days ago.

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
projectsIdstring
workloadIdentityPoolsIdstring
pageSizeinteger (int32)
pageTokenstring
showDeletedboolean
updateMaskstring (google-fieldmask)
workloadIdentityPoolIdstring

SELECT examples

Gets an individual WorkloadIdentityPool.

SELECT
name,
description,
disabled,
displayName,
expireTime,
inlineCertificateIssuanceConfig,
inlineTrustConfig,
mode,
state
FROM google.iam.workload_identity_pools
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND workloadIdentityPoolsId = '{{ workloadIdentityPoolsId }}' -- required;

INSERT examples

Creates a new WorkloadIdentityPool. You cannot reuse the name of a deleted pool until 30 days after deletion.

INSERT INTO google.iam.workload_identity_pools (
data__displayName,
data__description,
data__disabled,
data__mode,
data__inlineCertificateIssuanceConfig,
data__inlineTrustConfig,
projectsId,
locationsId,
workloadIdentityPoolId
)
SELECT
'{{ displayName }}',
'{{ description }}',
{{ disabled }},
'{{ mode }}',
'{{ inlineCertificateIssuanceConfig }}',
'{{ inlineTrustConfig }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ workloadIdentityPoolId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates an existing WorkloadIdentityPool.

UPDATE google.iam.workload_identity_pools
SET
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__disabled = {{ disabled }},
data__mode = '{{ mode }}',
data__inlineCertificateIssuanceConfig = '{{ inlineCertificateIssuanceConfig }}',
data__inlineTrustConfig = '{{ inlineTrustConfig }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND workloadIdentityPoolsId = '{{ workloadIdentityPoolsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a WorkloadIdentityPool. You cannot use a deleted pool to exchange external credentials for Google Cloud credentials. However, deletion does not revoke credentials that have already been issued. Credentials issued for a deleted pool do not grant access to resources. If the pool is undeleted, and the credentials are not expired, they grant access again. You can undelete a pool for 30 days. After 30 days, deletion is permanent. You cannot update deleted pools. However, you can view and list them.

DELETE FROM google.iam.workload_identity_pools
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND workloadIdentityPoolsId = '{{ workloadIdentityPoolsId }}' --required;

Lifecycle Methods

Undeletes a WorkloadIdentityPool, as long as it was deleted fewer than 30 days ago.

EXEC google.iam.workload_identity_pools.undelete 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@workloadIdentityPoolsId='{{ workloadIdentityPoolsId }}' --required;