Skip to main content

rule_groups_namespaces

Creates, updates, deletes, gets or lists a rule_groups_namespaces resource.

Overview

Namerule_groups_namespaces
TypeResource
Idaws.amp.rule_groups_namespaces

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the namespace that the rule group belong to. (pattern: <code>.[0-9A-Za-z][-.0-9A-Z_a-z].*</code>)
arnstringThe ARN of the rule groups namespace. For example, arn:aws:aps:<region>:123456789012:rulegroupsnamespace/ws-example1-1234-abcd-5678-ef90abcd1234/rulesfile1.
created_atstring (date-time)The date and time that the rule groups namespace was created.
datastring (byte)The rule groups namespace data.
modified_atstring (date-time)The date and time that the rule groups namespace was most recently changed.
statusobjectThe current status of the rule groups namespace.
tagsobjectThe list of tag keys and values that are associated with the rule groups namespace.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_rule_groups_namespaceselectworkspace_id, name, regionReturns complete information about one rule groups namespace. To retrieve a list of rule groups namespaces, use ListRuleGroupsNamespaces.
list_rule_groups_namespacesselectworkspace_id, regionname, nextToken, maxResultsReturns a list of rule groups namespaces in a workspace.
create_rule_groups_namespaceinsertworkspace_id, region, name, dataThe CreateRuleGroupsNamespace operation creates a rule groups namespace within a workspace. A rule groups namespace is associated with exactly one rules file. A workspace can have multiple rule groups namespaces. The combined length of a rule group namespace and a rule group name cannot exceed 721 UTF-8 bytes. Use this operation only to create new rule groups namespaces. To update an existing rule groups namespace, use PutRuleGroupsNamespace.
put_rule_groups_namespacereplaceworkspace_id, name, region, dataUpdates an existing rule groups namespace within a workspace. A rule groups namespace is associated with exactly one rules file. A workspace can have multiple rule groups namespaces. The combined length of a rule group namespace and a rule group name cannot exceed 721 UTF-8 bytes. Use this operation only to update existing rule groups namespaces. To create a new rule groups namespace, use CreateRuleGroupsNamespace. You can't use this operation to add tags to an existing rule groups namespace. Instead, use TagResource.
delete_rule_groups_namespacedeleteworkspace_id, name, regionclientTokenDeletes one rule groups namespace and its associated rule groups definition.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
namestringThe name of the rule groups namespace to delete.
regionstringAWS region (default: us-east-1)
workspace_idstringThe ID of the workspace containing the rule groups namespace and definition to delete.
clientTokenstringA unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.
maxResultsintegerThe maximum number of results to return. The default is 100.
namestringUse this parameter to filter the rule groups namespaces that are returned. Only the namespaces with names that begin with the value that you specify are returned.
nextTokenstringThe token for the next set of items to return. You receive this token from a previous call, and use it to get the next page of results. The other parameters must be the same as the initial call. For example, if your initial request has maxResults of 10, and there are 12 rule groups namespaces to return, then your initial request will return 10 and a nextToken. Using the next token in a subsequent call will return the remaining 2 namespaces.

SELECT examples

Returns complete information about one rule groups namespace. To retrieve a list of rule groups namespaces, use ListRuleGroupsNamespaces.

SELECT
name,
arn,
created_at,
data,
modified_at,
status,
tags
FROM aws.amp.rule_groups_namespaces
WHERE workspace_id = '{{ workspace_id }}' -- required
AND name = '{{ name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

The CreateRuleGroupsNamespace operation creates a rule groups namespace within a workspace. A rule groups namespace is associated with exactly one rules file. A workspace can have multiple rule groups namespaces. The combined length of a rule group namespace and a rule group name cannot exceed 721 UTF-8 bytes. Use this operation only to create new rule groups namespaces. To update an existing rule groups namespace, use PutRuleGroupsNamespace.

INSERT INTO aws.amp.rule_groups_namespaces (
name,
data,
clientToken,
tags,
workspace_id,
region
)
SELECT
'{{ name }}' /* required */,
'{{ data }}' /* required */,
'{{ clientToken }}',
'{{ tags }}',
'{{ workspace_id }}',
'{{ region }}'
RETURNING
name,
arn,
status,
tags
;

REPLACE examples

Updates an existing rule groups namespace within a workspace. A rule groups namespace is associated with exactly one rules file. A workspace can have multiple rule groups namespaces. The combined length of a rule group namespace and a rule group name cannot exceed 721 UTF-8 bytes. Use this operation only to update existing rule groups namespaces. To create a new rule groups namespace, use CreateRuleGroupsNamespace. You can't use this operation to add tags to an existing rule groups namespace. Instead, use TagResource.

REPLACE aws.amp.rule_groups_namespaces
SET
data = '{{ data }}',
clientToken = '{{ clientToken }}'
WHERE
workspace_id = '{{ workspace_id }}' --required
AND name = '{{ name }}' --required
AND region = '{{ region }}' --required
AND data = '{{ data }}' --required
RETURNING
name,
arn,
status,
tags;

DELETE examples

Deletes one rule groups namespace and its associated rule groups definition.

DELETE FROM aws.amp.rule_groups_namespaces
WHERE workspace_id = '{{ workspace_id }}' --required
AND name = '{{ name }}' --required
AND region = '{{ region }}' --required
AND clientToken = '{{ clientToken }}'
;