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 = 'us-east-1' 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 = 'us-east-1';
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 }}';
/*+ 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 }}';
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.customerprofiles.calculated_attribute_definitions
WHERE
Identifier = '{{ domain_name }}|{{ calculated_attribute_name }}' AND
region = 'us-east-1';
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