Skip to main content

workloads

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

Overview

Nameworkloads
TypeResource
Idgoogle.assuredworkloads.workloads

Fields

NameDatatypeDescription
namestringOptional. The resource name of the workload. Format: organizations/{organization}/locations/{location}/workloads/{workload} Read-only.
billingAccountstringOptional. The billing account used for the resources which are direct children of workload. This billing account is initially associated with the resources created as part of Workload creation. After the initial creation of these resources, the customer can change the assigned billing account. The resource name has the form billingAccounts/{billing_account_id}. For example, billingAccounts/012345-567890-ABCDEF.
complianceRegimestringRequired. Immutable. Compliance Regime associated with this workload.
complianceStatusobjectRepresents the Compliance Status of this workload
compliantButDisallowedServicesarrayOutput only. Urls for services which are compliant for this Assured Workload, but which are currently disallowed by the ResourceUsageRestriction org policy. Invoke RestrictAllowedResources endpoint to allow your project developers to use these services in their environment.
createTimestringOutput only. Immutable. The Workload creation timestamp.
displayNamestringRequired. The user-assigned display name of the Workload. When present it must be between 4 to 30 characters. Allowed characters are: lowercase and uppercase letters, numbers, hyphen, and spaces. Example: My Workload
ekmProvisioningResponseobjectExternal key management systems(EKM) Provisioning response
enableSovereignControlsbooleanOptional. Indicates the sovereignty status of the given workload. Currently meant to be used by Europe/Canada customers.
etagstringOptional. ETag of the workload, it is calculated on the basis of the Workload contents. It will be used in Update & Delete operations.
kajEnrollmentStatestringOutput only. Represents the KAJ enrollment state of the given workload.
kmsSettingsobjectSettings specific to the Key Management Service.
labelsobjectOptional. Labels applied to the workload.
partnerstringOptional. Partner regime associated with this workload.
partnerPermissionsobjectPermissions granted to the AW Partner SA account for the customer workload
partnerServicesBillingAccountstringOptional. Billing account necessary for purchasing services from Sovereign Partners. This field is required for creating SIA/PSN/CNTXT partner workloads. The caller should have 'billing.resourceAssociations.create' IAM permission on this billing-account. The format of this string is billingAccounts/AAAAAA-BBBBBB-CCCCCC
provisionedResourcesParentstringInput only. The parent resource for the resources managed by this Assured Workload. May be either empty or a folder resource which is a child of the Workload parent. If not specified all resources are created under the parent organization. Format: folders/{folder_id}
resourceMonitoringEnabledbooleanOutput only. Indicates whether resource monitoring is enabled for workload or not. It is true when Resource feed is subscribed to AWM topic and AWM Service Agent Role is binded to AW Service Account for resource Assured workload.
resourceSettingsarrayInput only. Resource properties that are used to customize workload resources. These properties (such as custom project id) will be used to create workload resources if possible. This field is optional.
resourcesarrayOutput only. The resources associated with this workload. These resources will be created when creating the workload. If any of the projects already exist, the workload creation will fail. Always read only.
saaEnrollmentResponseobjectSigned Access Approvals (SAA) enrollment response.
violationNotificationsEnabledbooleanOptional. Indicates whether the e-mail notification for a violation is enabled for a workload. This value will be by default True, and if not present will be considered as true. This should only be updated via updateWorkload call. Any Changes to this field during the createWorkload call will not be honored. This will always be true while creating the workload.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, organizationsId, workloadsIdGets Assured Workload associated with a CRM Node
listSELECTlocationsId, organizationsIdLists Assured Workloads under a CRM Node.
createINSERTlocationsId, organizationsIdCreates Assured Workload.
deleteDELETElocationsId, organizationsId, workloadsIdDeletes the workload. Make sure that workload's direct children are already in a deleted state, otherwise the request will fail with a FAILED_PRECONDITION error. In addition to assuredworkloads.workload.delete permission, the user should also have orgpolicy.policy.set permission on the deleted folder to remove Assured Workloads OrgPolicies.
patchUPDATElocationsId, organizationsId, workloadsIdUpdates an existing workload. Currently allows updating of workload display_name and labels. For force updates don't set etag field in the Workload. Only one update operation per workload can be in progress.
analyze_workload_moveEXEClocationsId, organizationsId, workloadsIdAnalyzes a hypothetical move of a source resource to a target workload to surface compliance risks. The analysis is best effort and is not guaranteed to be exhaustive.
enable_resource_monitoringEXEClocationsId, organizationsId, workloadsIdEnable resource violation monitoring for a workload.
mutate_partner_permissionsEXEClocationsId, organizationsId, workloadsIdUpdate the permissions settings for an existing partner workload. For force updates don't set etag field in the Workload. Only one update operation per workload can be in progress.
restrict_allowed_resourcesEXEClocationsId, organizationsId, workloadsIdRestrict the list of resources allowed in the Workload environment. The current list of allowed products can be found at https://cloud.google.com/assured-workloads/docs/supported-products In addition to assuredworkloads.workload.update permission, the user should also have orgpolicy.policy.set permission on the folder resource to use this functionality.

SELECT examples

Lists Assured Workloads under a CRM Node.

SELECT
name,
billingAccount,
complianceRegime,
complianceStatus,
compliantButDisallowedServices,
createTime,
displayName,
ekmProvisioningResponse,
enableSovereignControls,
etag,
kajEnrollmentState,
kmsSettings,
labels,
partner,
partnerPermissions,
partnerServicesBillingAccount,
provisionedResourcesParent,
resourceMonitoringEnabled,
resourceSettings,
resources,
saaEnrollmentResponse,
violationNotificationsEnabled
FROM google.assuredworkloads.workloads
WHERE locationsId = '{{ locationsId }}'
AND organizationsId = '{{ organizationsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new workloads resource.

/*+ create */
INSERT INTO google.assuredworkloads.workloads (
locationsId,
organizationsId,
billingAccount,
partnerPermissions,
violationNotificationsEnabled,
partnerServicesBillingAccount,
kmsSettings,
complianceRegime,
etag,
provisionedResourcesParent,
displayName,
enableSovereignControls,
labels,
partner,
name,
resourceSettings
)
SELECT
'{{ locationsId }}',
'{{ organizationsId }}',
'{{ billingAccount }}',
'{{ partnerPermissions }}',
{{ violationNotificationsEnabled }},
'{{ partnerServicesBillingAccount }}',
'{{ kmsSettings }}',
'{{ complianceRegime }}',
'{{ etag }}',
'{{ provisionedResourcesParent }}',
'{{ displayName }}',
{{ enableSovereignControls }},
'{{ labels }}',
'{{ partner }}',
'{{ name }}',
'{{ resourceSettings }}'
;

UPDATE example

Updates a workloads resource.

/*+ update */
UPDATE google.assuredworkloads.workloads
SET
billingAccount = '{{ billingAccount }}',
partnerPermissions = '{{ partnerPermissions }}',
violationNotificationsEnabled = true|false,
partnerServicesBillingAccount = '{{ partnerServicesBillingAccount }}',
kmsSettings = '{{ kmsSettings }}',
complianceRegime = '{{ complianceRegime }}',
etag = '{{ etag }}',
provisionedResourcesParent = '{{ provisionedResourcesParent }}',
displayName = '{{ displayName }}',
enableSovereignControls = true|false,
labels = '{{ labels }}',
partner = '{{ partner }}',
name = '{{ name }}',
resourceSettings = '{{ resourceSettings }}'
WHERE
locationsId = '{{ locationsId }}'
AND organizationsId = '{{ organizationsId }}'
AND workloadsId = '{{ workloadsId }}';

DELETE example

Deletes the specified workloads resource.

/*+ delete */
DELETE FROM google.assuredworkloads.workloads
WHERE locationsId = '{{ locationsId }}'
AND organizationsId = '{{ organizationsId }}'
AND workloadsId = '{{ workloadsId }}';