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:

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. (STATE_UNSPECIFIED, ACTIVE, DELETED)

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.
set_attestation_rulesexecprojectsId, locationsId, workloadIdentityPoolsId, namespacesId, managedIdentitiesIdSet all AttestationRule on a WorkloadIdentityPoolManagedIdentity. A maximum of 50 AttestationRules can be set.
undeleteexecprojectsId, locationsId, workloadIdentityPoolsId, namespacesId, managedIdentitiesIdUndeletes a WorkloadIdentityPoolManagedIdentity, 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
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__description,
data__disabled,
data__name,
projectsId,
locationsId,
workloadIdentityPoolsId,
namespacesId,
workloadIdentityPoolManagedIdentityId
)
SELECT
'{{ description }}',
{{ disabled }},
'{{ name }}',
'{{ 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__description = '{{ description }}',
data__disabled = {{ disabled }},
data__name = '{{ name }}'
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​

Set all AttestationRule on a WorkloadIdentityPoolManagedIdentity. A maximum of 50 AttestationRules can be set.

EXEC google.iam.managed_identities.set_attestation_rules
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@workloadIdentityPoolsId='{{ workloadIdentityPoolsId }}' --required,
@namespacesId='{{ namespacesId }}' --required,
@managedIdentitiesId='{{ managedIdentitiesId }}' --required
@@json=
'{
"attestationRules": "{{ attestationRules }}"
}'
;