variables
Creates, updates, deletes or gets a variable resource or lists variables in a region
Overview
| Name | variables |
| Type | Resource |
| Description | A resource schema for a Variable in Amazon Fraud Detector. |
| Id | awscc.frauddetector.variables |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the variable. |
data_source | string | The source of the data. |
data_type | string | The data type. |
default_value | string | The default value for the variable when no value is received. |
description | string | The description. |
tags | array | Tags associated with this variable. |
variable_type | string | The variable type. For more information see https://docs.aws.amazon.com/frauddetector/latest/ug/create-a-variable.html#variable-types |
arn | string | The ARN of the variable. |
created_time | string | The time when the variable was created. |
last_updated_time | string | The time when the variable was last updated. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The ARN of the variable. |
region | string | AWS region. |
For more information, see AWS::FraudDetector::Variable.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | variables | INSERT | DataType, DataSource, DefaultValue, Name, region |
delete_resource | variables | DELETE | Identifier, region |
update_resource | variables | UPDATE | Identifier, PatchDocument, region |
list_resources | variables_list_only | SELECT | region |
get_resource | variables | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual variable.
SELECT
region,
name,
data_source,
data_type,
default_value,
description,
tags,
variable_type,
arn,
created_time,
last_updated_time
FROM awscc.frauddetector.variables
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
Lists all variables in a region.
SELECT
region,
arn
FROM awscc.frauddetector.variables_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new variable resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.frauddetector.variables (
Name,
DataSource,
DataType,
DefaultValue,
region
)
SELECT
'{{ name }}',
'{{ data_source }}',
'{{ data_type }}',
'{{ default_value }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.frauddetector.variables (
Name,
DataSource,
DataType,
DefaultValue,
Description,
Tags,
VariableType,
region
)
SELECT
'{{ name }}',
'{{ data_source }}',
'{{ data_type }}',
'{{ default_value }}',
'{{ description }}',
'{{ tags }}',
'{{ variable_type }}',
'{{ 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: variable
props:
- name: name
value: '{{ name }}'
- name: data_source
value: '{{ data_source }}'
- name: data_type
value: '{{ data_type }}'
- name: default_value
value: '{{ default_value }}'
- name: description
value: '{{ description }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: variable_type
value: '{{ variable_type }}'
UPDATE example
Use the following StackQL query and manifest file to update a variable resource, using stack-deploy.
/*+ update */
UPDATE awscc.frauddetector.variables
SET PatchDocument = string('{{ {
"DataSource": data_source,
"DataType": data_type,
"DefaultValue": default_value,
"Description": description,
"Tags": tags,
"VariableType": variable_type
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.frauddetector.variables
WHERE
Identifier = '{{ arn }}' 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 variables resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
frauddetector:GetVariables,
frauddetector:CreateVariable,
frauddetector:ListTagsForResource,
frauddetector:TagResource
frauddetector:GetVariables,
frauddetector:ListTagsForResource
frauddetector:GetVariables,
frauddetector:UpdateVariable,
frauddetector:ListTagsForResource,
frauddetector:TagResource,
frauddetector:UntagResource
frauddetector:GetVariables,
frauddetector:DeleteVariable
frauddetector:GetVariables,
frauddetector:ListTagsForResource