rules
Creates, updates, deletes or gets a rule resource or lists rules in a region
Overview
| Name | rules |
| Type | Resource |
| Description | Creates a listener rule. Each listener has a default rule for checking connection requests, but you can define additional rules. Each rule consists of a priority, one or more actions, and one or more conditions. |
| Id | awscc.vpclattice.rules |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
action | object | |
arn | string | |
id | string | |
listener_identifier | string | |
match | object | |
name | string | |
priority | integer | |
service_identifier | string | |
tags | array | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | |
region | string | AWS region. |
For more information, see AWS::VpcLattice::Rule.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | rules | INSERT | Action, Match, Priority, region |
delete_resource | rules | DELETE | Identifier, region |
update_resource | rules | UPDATE | Identifier, PatchDocument, region |
list_resources | rules_list_only | SELECT | region |
get_resource | rules | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual rule.
SELECT
region,
action,
arn,
id,
listener_identifier,
match,
name,
priority,
service_identifier,
tags
FROM awscc.vpclattice.rules
WHERE
region = 'us-east-1' AND
Identifier = '{{ arn }}';
Lists all rules in a region.
SELECT
region,
arn
FROM awscc.vpclattice.rules_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new rule resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.vpclattice.rules (
Action,
Match,
Priority,
region
)
SELECT
'{{ action }}',
'{{ match }}',
'{{ priority }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.vpclattice.rules (
Action,
ListenerIdentifier,
Match,
Name,
Priority,
ServiceIdentifier,
Tags,
region
)
SELECT
'{{ action }}',
'{{ listener_identifier }}',
'{{ match }}',
'{{ name }}',
'{{ priority }}',
'{{ service_identifier }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: rule
props:
- name: action
value:
forward:
target_groups:
- target_group_identifier: '{{ target_group_identifier }}'
weight: '{{ weight }}'
fixed_response:
status_code: '{{ status_code }}'
- name: listener_identifier
value: '{{ listener_identifier }}'
- name: match
value:
http_match:
method: '{{ method }}'
path_match:
match:
exact: '{{ exact }}'
prefix: '{{ prefix }}'
case_sensitive: '{{ case_sensitive }}'
header_matches:
- name: '{{ name }}'
match:
exact: '{{ exact }}'
prefix: '{{ prefix }}'
contains: '{{ contains }}'
case_sensitive: '{{ case_sensitive }}'
- name: name
value: '{{ name }}'
- name: priority
value: '{{ priority }}'
- name: service_identifier
value: '{{ service_identifier }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a rule resource, using stack-deploy.
/*+ update */
UPDATE awscc.vpclattice.rules
SET PatchDocument = string('{{ {
"Action": action,
"Match": match,
"Priority": priority,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
DELETE example
/*+ delete */
DELETE FROM awscc.vpclattice.rules
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';
Permissions
To operate on the rules resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
vpc-lattice:CreateRule,
vpc-lattice:GetRule,
vpc-lattice:ListTagsForResource,
vpc-lattice:TagResource
vpc-lattice:GetRule,
vpc-lattice:ListTagsForResource
vpc-lattice:UpdateRule,
vpc-lattice:GetRule,
vpc-lattice:TagResource,
vpc-lattice:UntagResource,
vpc-lattice:ListTagsForResource
vpc-lattice:DeleteRule,
vpc-lattice:UntagResource
vpc-lattice:ListRules