Skip to main content

rules

Creates, updates, deletes or gets a rule resource or lists rules in a region

Overview

Namerules
TypeResource
DescriptionCreates 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.
Idawscc.vpclattice.rules

Fields

NameDatatypeDescription
actionobject
arnstring
idstring
listener_identifierstring
matchobject
namestring
priorityinteger
service_identifierstring
tagsarray
regionstringAWS region.

For more information, see AWS::VpcLattice::Rule.

Methods

NameResourceAccessible byRequired Params
create_resourcerulesINSERTAction, Match, Priority, region
delete_resourcerulesDELETEIdentifier, region
update_resourcerulesUPDATEIdentifier, PatchDocument, region
list_resourcesrules_list_onlySELECTregion
get_resourcerulesSELECTIdentifier, region

SELECT examples

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 = '{{ region }}' AND
Identifier = '{{ arn }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.vpclattice.rules (
Action,
Match,
Priority,
region
)
SELECT
'{{ action }}',
'{{ match }}',
'{{ priority }}',
'{{ 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 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.vpclattice.rules
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:

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 rules resource, the following permissions are required:

vpc-lattice:CreateRule,
vpc-lattice:GetRule,
vpc-lattice:ListTagsForResource,
vpc-lattice:TagResource