workloads
Creates, updates, deletes, gets or lists a workloads
resource.
Overview
Name | workloads |
Type | Resource |
Id | google.assuredworkloads.workloads |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Optional. The resource name of the workload. Format: organizations/{organization}/locations/{location}/workloads/{workload} Read-only. |
billingAccount | string | Optional. 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 . |
complianceRegime | string | Required. Immutable. Compliance Regime associated with this workload. |
complianceStatus | object | Represents the Compliance Status of this workload |
compliantButDisallowedServices | array | Output 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. |
createTime | string | Output only. Immutable. The Workload creation timestamp. |
displayName | string | Required. 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 |
ekmProvisioningResponse | object | External key management systems(EKM) Provisioning response |
enableSovereignControls | boolean | Optional. Indicates the sovereignty status of the given workload. Currently meant to be used by Europe/Canada customers. |
etag | string | Optional. ETag of the workload, it is calculated on the basis of the Workload contents. It will be used in Update & Delete operations. |
kajEnrollmentState | string | Output only. Represents the KAJ enrollment state of the given workload. |
kmsSettings | object | Settings specific to the Key Management Service. |
labels | object | Optional. Labels applied to the workload. |
partner | string | Optional. Partner regime associated with this workload. |
partnerPermissions | object | Permissions granted to the AW Partner SA account for the customer workload |
partnerServicesBillingAccount | string | Optional. 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 |
provisionedResourcesParent | string | Input 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} |
resourceMonitoringEnabled | boolean | Output 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. |
resourceSettings | array | Input 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. |
resources | array | Output 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. |
saaEnrollmentResponse | object | Signed Access Approvals (SAA) enrollment response. |
violationNotificationsEnabled | boolean | Optional. 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
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | locationsId, organizationsId, workloadsId | Gets Assured Workload associated with a CRM Node |
list | SELECT | locationsId, organizationsId | Lists Assured Workloads under a CRM Node. |
create | INSERT | locationsId, organizationsId | Creates Assured Workload. |
delete | DELETE | locationsId, organizationsId, workloadsId | Deletes 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. |
patch | UPDATE | locationsId, organizationsId, workloadsId | Updates 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_move | EXEC | locationsId, organizationsId, workloadsId | Analyzes 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_monitoring | EXEC | locationsId, organizationsId, workloadsId | Enable resource violation monitoring for a workload. |
mutate_partner_permissions | EXEC | locationsId, organizationsId, workloadsId | Update 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_resources | EXEC | locationsId, organizationsId, workloadsId | Restrict 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.
- All Properties
- Manifest
/*+ 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 }}'
;
- name: your_resource_model_name
props:
- name: resources
value:
- - name: resourceId
value: string
- name: resourceType
value: string
- name: billingAccount
value: string
- name: partnerPermissions
value:
- name: accessTransparencyLogsSupportCaseViewer
value: boolean
- name: dataLogsViewer
value: boolean
- name: serviceAccessApprover
value: boolean
- name: assuredWorkloadsMonitoring
value: boolean
- name: violationNotificationsEnabled
value: boolean
- name: partnerServicesBillingAccount
value: string
- name: kajEnrollmentState
value: string
- name: saaEnrollmentResponse
value:
- name: setupStatus
value: string
- name: setupErrors
value:
- string
- name: kmsSettings
value:
- name: rotationPeriod
value: string
- name: nextRotationTime
value: string
- name: complianceRegime
value: string
- name: etag
value: string
- name: ekmProvisioningResponse
value:
- name: ekmProvisioningErrorDomain
value: string
- name: ekmProvisioningState
value: string
- name: ekmProvisioningErrorMapping
value: string
- name: provisionedResourcesParent
value: string
- name: displayName
value: string
- name: enableSovereignControls
value: boolean
- name: labels
value: object
- name: complianceStatus
value:
- name: acknowledgedResourceViolationCount
value: integer
- name: acknowledgedViolationCount
value: integer
- name: activeViolationCount
value: integer
- name: activeResourceViolationCount
value: integer
- name: resourceMonitoringEnabled
value: boolean
- name: partner
value: string
- name: name
value: string
- name: resourceSettings
value:
- - name: displayName
value: string
- name: resourceId
value: string
- name: resourceType
value: string
- name: compliantButDisallowedServices
value:
- string
- name: createTime
value: string
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 }}';