Skip to main content

managed_identities

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

Overview

Namemanaged_identities
TypeResource
Idgoogle.iam.managed_identities

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. The resource name of the managed identity.
descriptionstringOptional. A description of the managed identity. Cannot exceed 256 characters.
disabledbooleanOptional. Whether the managed identity is disabled. If disabled, credentials may no longer be issued for the identity, however existing credentials will still be accepted until they expire.
expireTimestring (google-datetime)Output only. Time after which the managed identity will be permanently purged and cannot be recovered.
statestringOutput only. The state of the managed identity.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, workloadIdentityPoolsId, namespacesId, managedIdentitiesIdGets an individual WorkloadIdentityPoolManagedIdentity.
listselectprojectsId, locationsId, workloadIdentityPoolsId, namespacesIdpageSize, pageToken, showDeletedLists all non-deleted WorkloadIdentityPoolManagedIdentitys in a namespace. If show_deleted is set to true, then deleted managed identities are also listed.
createinsertprojectsId, locationsId, workloadIdentityPoolsId, namespacesIdworkloadIdentityPoolManagedIdentityIdCreates a new WorkloadIdentityPoolManagedIdentity in a WorkloadIdentityPoolNamespace.
patchupdateprojectsId, locationsId, workloadIdentityPoolsId, namespacesId, managedIdentitiesIdupdateMaskUpdates an existing WorkloadIdentityPoolManagedIdentity in a WorkloadIdentityPoolNamespace.
deletedeleteprojectsId, locationsId, workloadIdentityPoolsId, namespacesId, managedIdentitiesIdDeletes a WorkloadIdentityPoolManagedIdentity. You can undelete a managed identity for 30 days. After 30 days, deletion is permanent.
undeleteexecprojectsId, locationsId, workloadIdentityPoolsId, namespacesId, managedIdentitiesIdUndeletes a WorkloadIdentityPoolManagedIdentity, as long as it was deleted fewer than 30 days ago.
set_attestation_rulesexecprojectsId, locationsId, workloadIdentityPoolsId, namespacesId, managedIdentitiesIdSet all AttestationRule on a WorkloadIdentityPoolManagedIdentity. A maximum of 50 AttestationRules can be set.

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

SELECT examples

Gets an individual WorkloadIdentityPoolManagedIdentity.

SELECT
name,
description,
disabled,
expireTime,
state
FROM google.iam.managed_identities
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND workloadIdentityPoolsId = '{{ workloadIdentityPoolsId }}' -- required
AND namespacesId = '{{ namespacesId }}' -- required
AND managedIdentitiesId = '{{ managedIdentitiesId }}' -- required;

INSERT examples

Creates a new WorkloadIdentityPoolManagedIdentity in a WorkloadIdentityPoolNamespace.

INSERT INTO google.iam.managed_identities (
data__name,
data__description,
data__disabled,
projectsId,
locationsId,
workloadIdentityPoolsId,
namespacesId,
workloadIdentityPoolManagedIdentityId
)
SELECT
'{{ name }}',
'{{ description }}',
{{ disabled }},
'{{ projectsId }}',
'{{ locationsId }}',
'{{ workloadIdentityPoolsId }}',
'{{ namespacesId }}',
'{{ workloadIdentityPoolManagedIdentityId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates an existing WorkloadIdentityPoolManagedIdentity in a WorkloadIdentityPoolNamespace.

UPDATE google.iam.managed_identities
SET
data__name = '{{ name }}',
data__description = '{{ description }}',
data__disabled = {{ disabled }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND workloadIdentityPoolsId = '{{ workloadIdentityPoolsId }}' --required
AND namespacesId = '{{ namespacesId }}' --required
AND managedIdentitiesId = '{{ managedIdentitiesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a WorkloadIdentityPoolManagedIdentity. You can undelete a managed identity for 30 days. After 30 days, deletion is permanent.

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

Lifecycle Methods

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

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