Skip to content

create_gateway_rule

Operation

create_gateway_rule

create_gateway_rule(request: CreateGatewayRuleInput | CreateGatewayRuleInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateGatewayRuleInputDict]) -> 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
request CreateGatewayRuleInput | CreateGatewayRuleInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
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
**kwargs Unpack[CreateGatewayRuleInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CreateGatewayRuleOutput

An instance of CreateGatewayRuleOutput.

create_gateway_rule async

create_gateway_rule(request: CreateGatewayRuleInput | CreateGatewayRuleInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateGatewayRuleInputDict]) -> 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
request CreateGatewayRuleInput | CreateGatewayRuleInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
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
**kwargs Unpack[CreateGatewayRuleInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CreateGatewayRuleOutput

An instance of CreateGatewayRuleOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

CreateGatewayRuleInputDict

Bases: TypedDict

Dictionary form of CreateGatewayRuleInput.

Attributes

actions instance-attribute

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 instance-attribute
client_token: str | 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.

This field is autopopulated if not provided.

conditions instance-attribute
conditions: Sequence[Condition | ConditionDict] | None

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

description instance-attribute
description: str | None

The description of the gateway rule.

gateway_identifier instance-attribute
gateway_identifier: Required[str]

The identifier of the gateway to create a rule for.

priority instance-attribute
priority: Required[int]

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.

CreateGatewayRuleInput dataclass

Bases: _SerdeShape

Dataclass for CreateGatewayRuleInput structure.

Attributes

actions class-attribute instance-attribute
actions: list[Action] | 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 = ...

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.

This field is autopopulated if not provided.

conditions class-attribute instance-attribute
conditions: list[Condition] | 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 = ...

The description of the gateway rule.

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

The identifier of the gateway to create a rule for.

priority class-attribute instance-attribute
priority: int | 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

Bases: _SerdeShape

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 = ...

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 = ...

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.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

rule_id instance-attribute
rule_id: str

The unique identifier of the gateway rule.

status instance-attribute
status: str

The current status of the rule.

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

System-managed metadata for rules created by automated processes.