Skip to main content

calculated_attribute_definitions

Creates, updates, deletes or gets a calculated_attribute_definition resource or lists calculated_attribute_definitions in a region

Overview

Namecalculated_attribute_definitions
TypeResource
DescriptionA calculated attribute definition for Customer Profiles
Idawscc.customerprofiles.calculated_attribute_definitions

Fields

NameDatatypeDescription
domain_namestringThe unique name of the domain.
calculated_attribute_namestringThe unique name of the calculated attribute.
display_namestringThe display name of the calculated attribute.
descriptionstringThe description of the event trigger.
attribute_detailsobjectMathematical expression and a list of attribute items specified in that expression.
conditionsobjectThe conditions including range, object count, and threshold for the calculated attribute.
statisticstringThe aggregation operation to perform for the calculated attribute.
use_historical_databooleanWhether to use historical data for the calculated attribute.
created_atstringThe timestamp of when the calculated attribute definition was created.
last_updated_atstringThe timestamp of when the calculated attribute definition was most recently edited.
statusstringThe status of the calculated attribute definition.
readinessobjectThe readiness status of the calculated attribute.
tagsarrayAn array of key-value pairs to apply to this resource.
regionstringAWS region.

For more information, see AWS::CustomerProfiles::CalculatedAttributeDefinition.

Methods

NameResourceAccessible byRequired Params
create_resourcecalculated_attribute_definitionsINSERTDomainName, CalculatedAttributeName, AttributeDetails, Statistic, region
delete_resourcecalculated_attribute_definitionsDELETEIdentifier, region
update_resourcecalculated_attribute_definitionsUPDATEIdentifier, PatchDocument, region
list_resourcescalculated_attribute_definitions_list_onlySELECTregion
get_resourcecalculated_attribute_definitionsSELECTIdentifier, region

SELECT examples

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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new calculated_attribute_definition resource, using stack-deploy.

/*+ 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
;

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:

ParameterDescription
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:

profile:CreateCalculatedAttributeDefinition,
profile:TagResource