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 | aws.vpclattice.rules |
Fields
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. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Action, Match, Priority, 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 rules
in a region.
SELECT
region,
action,
arn,
id,
listener_identifier,
match,
name,
priority,
service_identifier,
tags
FROM aws.vpclattice.rules
WHERE region = 'us-east-1';
Gets all properties from an individual rule
.
SELECT
region,
action,
arn,
id,
listener_identifier,
match,
name,
priority,
service_identifier,
tags
FROM aws.vpclattice.rules
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';
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 aws.vpclattice.rules (
Action,
Match,
Priority,
region
)
SELECT
'{{ Action }}',
'{{ Match }}',
'{{ Priority }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.vpclattice.rules (
Action,
ListenerIdentifier,
Match,
Name,
Priority,
ServiceIdentifier,
Tags,
region
)
SELECT
'{{ Action }}',
'{{ ListenerIdentifier }}',
'{{ Match }}',
'{{ Name }}',
'{{ Priority }}',
'{{ ServiceIdentifier }}',
'{{ 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:
TargetGroups:
- TargetGroupIdentifier: '{{ TargetGroupIdentifier }}'
Weight: '{{ Weight }}'
FixedResponse:
StatusCode: '{{ StatusCode }}'
- name: ListenerIdentifier
value: '{{ ListenerIdentifier }}'
- name: Match
value:
HttpMatch:
Method: '{{ Method }}'
PathMatch:
Match:
Exact: '{{ Exact }}'
Prefix: '{{ Prefix }}'
CaseSensitive: '{{ CaseSensitive }}'
HeaderMatches:
- Name: '{{ Name }}'
Match:
Exact: '{{ Exact }}'
Prefix: '{{ Prefix }}'
Contains: '{{ Contains }}'
CaseSensitive: '{{ CaseSensitive }}'
- name: Name
value: '{{ Name }}'
- name: Priority
value: '{{ Priority }}'
- name: ServiceIdentifier
value: '{{ ServiceIdentifier }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.vpclattice.rules
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';
Permissions
To operate on the rules
resource, the following permissions are required:
Create
vpc-lattice:CreateRule,
vpc-lattice:GetRule,
vpc-lattice:ListTagsForResource,
vpc-lattice:TagResource
Read
vpc-lattice:GetRule,
vpc-lattice:ListTagsForResource
Update
vpc-lattice:UpdateRule,
vpc-lattice:GetRule,
vpc-lattice:TagResource,
vpc-lattice:UntagResource
Delete
vpc-lattice:DeleteRule
List
vpc-lattice:ListRules