calculated_attribute_definitions
Creates, updates, deletes or gets a calculated_attribute_definition resource or lists calculated_attribute_definitions in a region
Overview
| Name | calculated_attribute_definitions |
| Type | Resource |
| Description | A calculated attribute definition for Customer Profiles |
| Id | awscc.customerprofiles.calculated_attribute_definitions |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
domain_name | string | The unique name of the domain. |
calculated_attribute_name | string | The unique name of the calculated attribute. |
display_name | string | The display name of the calculated attribute. |
description | string | The description of the event trigger. |
attribute_details | object | Mathematical expression and a list of attribute items specified in that expression. |
conditions | object | The conditions including range, object count, and threshold for the calculated attribute. |
statistic | string | The aggregation operation to perform for the calculated attribute. |
use_historical_data | boolean | Whether to use historical data for the calculated attribute. |
created_at | string | The timestamp of when the calculated attribute definition was created. |
last_updated_at | string | The timestamp of when the calculated attribute definition was most recently edited. |
status | string | The status of the calculated attribute definition. |
readiness | object | The readiness status of the calculated attribute. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
domain_name | string | The unique name of the domain. |
calculated_attribute_name | string | The unique name of the calculated attribute. |
region | string | AWS region. |
For more information, see AWS::CustomerProfiles::CalculatedAttributeDefinition.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | calculated_attribute_definitions | INSERT | DomainName, CalculatedAttributeName, AttributeDetails, Statistic, region |
delete_resource | calculated_attribute_definitions | DELETE | Identifier, region |
update_resource | calculated_attribute_definitions | UPDATE | Identifier, PatchDocument, region |
list_resources | calculated_attribute_definitions_list_only | SELECT | region |
get_resource | calculated_attribute_definitions | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual calculated_attribute_definition.
SELECT
region,
domain_name,
calculated_attribute_name,
display_name,
description,
attribute_details,
conditions,
statistic,
use_historical_data,
created_at,
last_updated_at,
status,
readiness,
tags
FROM awscc.customerprofiles.calculated_attribute_definitions
WHERE
region = '{{ region }}' AND
Identifier = '{{ domain_name }}|{{ calculated_attribute_name }}';
Lists all calculated_attribute_definitions in a region.
SELECT
region,
domain_name,
calculated_attribute_name
FROM awscc.customerprofiles.calculated_attribute_definitions_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new calculated_attribute_definition resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.customerprofiles.calculated_attribute_definitions (
DomainName,
CalculatedAttributeName,
AttributeDetails,
Statistic,
region
)
SELECT
'{{ domain_name }}',
'{{ calculated_attribute_name }}',
'{{ attribute_details }}',
'{{ statistic }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.customerprofiles.calculated_attribute_definitions (
DomainName,
CalculatedAttributeName,
DisplayName,
Description,
AttributeDetails,
Conditions,
Statistic,
UseHistoricalData,
Tags,
region
)
SELECT
'{{ domain_name }}',
'{{ calculated_attribute_name }}',
'{{ display_name }}',
'{{ description }}',
'{{ attribute_details }}',
'{{ conditions }}',
'{{ statistic }}',
'{{ use_historical_data }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: calculated_attribute_definition
props:
- name: domain_name
value: '{{ domain_name }}'
- name: calculated_attribute_name
value: '{{ calculated_attribute_name }}'
- name: display_name
value: '{{ display_name }}'
- name: description
value: '{{ description }}'
- name: attribute_details
value:
attributes:
- name: '{{ name }}'
expression: '{{ expression }}'
- name: conditions
value:
range:
value: '{{ value }}'
unit: '{{ unit }}'
value_range:
start: '{{ start }}'
end: '{{ end }}'
timestamp_source: '{{ timestamp_source }}'
timestamp_format: '{{ timestamp_format }}'
object_count: '{{ object_count }}'
threshold:
value: '{{ value }}'
operator: '{{ operator }}'
- name: statistic
value: '{{ statistic }}'
- name: use_historical_data
value: '{{ use_historical_data }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a calculated_attribute_definition resource, using stack-deploy.
/*+ update */
UPDATE awscc.customerprofiles.calculated_attribute_definitions
SET PatchDocument = string('{{ {
"DisplayName": display_name,
"Description": description,
"AttributeDetails": attribute_details,
"Statistic": statistic,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ domain_name }}|{{ calculated_attribute_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.customerprofiles.calculated_attribute_definitions
WHERE
Identifier = '{{ domain_name }}|{{ calculated_attribute_name }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the calculated_attribute_definitions resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
profile:CreateCalculatedAttributeDefinition,
profile:TagResource
profile:GetCalculatedAttributeDefinition
profile:GetCalculatedAttributeDefinition,
profile:UpdateCalculatedAttributeDefinition,
profile:UntagResource,
profile:TagResource
profile:DeleteCalculatedAttributeDefinition
profile:ListCalculatedAttributeDefinitions