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 | aws.customerprofiles.calculated_attribute_definitions |
Fields
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 calculated attribute. |
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. |
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. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | DomainName, CalculatedAttributeName, AttributeDetails, Statistic, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all calculated_attribute_definitions
in a region.
SELECT
region,
domain_name,
calculated_attribute_name,
display_name,
description,
attribute_details,
conditions,
statistic,
created_at,
last_updated_at,
tags
FROM aws.customerprofiles.calculated_attribute_definitions
WHERE region = 'us-east-1';
Gets all properties from an individual calculated_attribute_definition
.
SELECT
region,
domain_name,
calculated_attribute_name,
display_name,
description,
attribute_details,
conditions,
statistic,
created_at,
last_updated_at,
tags
FROM aws.customerprofiles.calculated_attribute_definitions
WHERE region = 'us-east-1' AND data__Identifier = '<DomainName>|<CalculatedAttributeName>';
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 aws.customerprofiles.calculated_attribute_definitions (
DomainName,
CalculatedAttributeName,
AttributeDetails,
Statistic,
region
)
SELECT
'{{ DomainName }}',
'{{ CalculatedAttributeName }}',
'{{ AttributeDetails }}',
'{{ Statistic }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.customerprofiles.calculated_attribute_definitions (
DomainName,
CalculatedAttributeName,
DisplayName,
Description,
AttributeDetails,
Conditions,
Statistic,
Tags,
region
)
SELECT
'{{ DomainName }}',
'{{ CalculatedAttributeName }}',
'{{ DisplayName }}',
'{{ Description }}',
'{{ AttributeDetails }}',
'{{ Conditions }}',
'{{ Statistic }}',
'{{ 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: DomainName
value: '{{ DomainName }}'
- name: CalculatedAttributeName
value: '{{ CalculatedAttributeName }}'
- name: DisplayName
value: '{{ DisplayName }}'
- name: Description
value: '{{ Description }}'
- name: AttributeDetails
value:
Attributes:
- Name: '{{ Name }}'
Expression: '{{ Expression }}'
- name: Conditions
value:
Range:
Value: '{{ Value }}'
Unit: '{{ Unit }}'
ObjectCount: '{{ ObjectCount }}'
Threshold:
Value: '{{ Value }}'
Operator: '{{ Operator }}'
- name: Statistic
value: '{{ Statistic }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.customerprofiles.calculated_attribute_definitions
WHERE data__Identifier = '<DomainName|CalculatedAttributeName>'
AND region = 'us-east-1';
Permissions
To operate on the calculated_attribute_definitions
resource, the following permissions are required:
Create
profile:CreateCalculatedAttributeDefinition,
profile:TagResource
Read
profile:GetCalculatedAttributeDefinition
Update
profile:GetCalculatedAttributeDefinition,
profile:UpdateCalculatedAttributeDefinition,
profile:UntagResource,
profile:TagResource
Delete
profile:DeleteCalculatedAttributeDefinition
List
profile:ListCalculatedAttributeDefinitions