Skip to content

Bedrock Agentcore Control  >  Operations  >  create_gateway_rule

create_gateway_rule

Operation

create_gateway_rule async

create_gateway_rule(input: CreateGatewayRuleInput, plugins: list[Plugin] | None = None) -> CreateGatewayRuleOutput

Creates a rule for a gateway. Rules define conditions and actions that control how requests are routed and processed through the gateway, including principal-based access control and path-based routing.

Parameters:

Name Type Description Default
input CreateGatewayRuleInput

An instance of CreateGatewayRuleInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
CreateGatewayRuleOutput

An instance of CreateGatewayRuleOutput.

Input

CreateGatewayRuleInput dataclass

Dataclass for CreateGatewayRuleInput structure.

Attributes

actions class-attribute instance-attribute
actions: list[Action] | None = None

The actions to take when the rule conditions are met. Actions can route to a specific target or apply a configuration bundle override.

client_token class-attribute instance-attribute
client_token: str | None = None

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see Ensuring idempotency.

conditions class-attribute instance-attribute
conditions: list[Condition] | None = None

The conditions that must be met for the rule to apply. Conditions can match on principals (IAM ARNs) or request paths.

description class-attribute instance-attribute
description: str | None = None

The description of the gateway rule.

gateway_identifier class-attribute instance-attribute
gateway_identifier: str | None = None

The identifier of the gateway to create a rule for.

priority class-attribute instance-attribute
priority: int | None = None

The priority of the rule. Rules are evaluated in order of priority, with lower numbers evaluated first. Must be between 1 and 1,000,000.

Output

CreateGatewayRuleOutput dataclass

Dataclass for CreateGatewayRuleOutput structure.

Attributes

actions instance-attribute
actions: list[Action]

The actions to take when the rule conditions are met.

conditions class-attribute instance-attribute
conditions: list[Condition] | None = None

The conditions that must be met for the rule to apply.

created_at instance-attribute
created_at: datetime

The timestamp when the rule was created.

description class-attribute instance-attribute
description: str | None = None

The description of the gateway rule.

gateway_arn instance-attribute
gateway_arn: str

The Amazon Resource Name (ARN) of the gateway that the rule belongs to.

priority instance-attribute
priority: int

The priority of the rule. Rules are evaluated in order of priority, with lower numbers evaluated first.

rule_id instance-attribute
rule_id: str

The unique identifier of the gateway rule.

status instance-attribute

The current status of the rule.

system class-attribute instance-attribute
system: SystemManagedBlock | None = None

System-managed metadata for rules created by automated processes.