Skip to content

Latest commit

 

History

History

lattice-service-listener

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

lattice-service-listener

This module creates following resources.

  • aws_vpclattice_listener
  • aws_vpclattice_listener_rule (optional)

Requirements

Name Version
terraform >= 1.5
aws >= 5.21

Providers

Name Version
aws 5.22.0

Modules

Name Source Version
resource_group tedilabs/misc/aws//modules/resource-group ~> 0.10.0

Resources

Name Type
aws_vpclattice_listener.this resource
aws_vpclattice_listener_rule.this resource

Inputs

Name Description Type Default Required
default_action_type (Required) The type of default routing action. Default action apply to traffic that does not meet the conditions of rules on your listener. Rules can be configured after the listener is created. Valid values are FORWARD, FIXED_RESPONSE. string n/a yes
name (Required) The name of the service listener. The name must be unique within the service. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen. string n/a yes
protocol (Required) The protocol for the service listener. Valid values are HTTP and HTTPS. string n/a yes
service (Required) The ID or ARN (Amazon Resource Name) of the VPC Lattice service. string n/a yes
default_action_parameters (Optional) The configuration for the parameters of the default routing action. default_action_parameters block as defined below.
(Optional) status_code - Custom HTTP status code to drop client requests and return a custom HTTP response. Valid values are 404. Only supported if default_action_type is FIXED_RESPONSE.
(Optional) destinations - A list of one or more target groups to route traffic. Only supported if default_action_type is FORWARD. Each item of destinations block as defined below.
(Required) target_group - The ID or ARN of the target group to which to route traffic.
(Optional) weight - The weight to use routing traffic to target_group. how requests are distributed to the target group. Only required if you specify multiple target groups for a forward action. For example, if you specify two target groups, one with a weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group. Valid value is 0 to 999. Defaults to 100.
object({
status_code = optional(number, 404)
destinations = optional(list(object({
target_group = string
weight = optional(number, 100)
})), [])
})
{} no
module_tags_enabled (Optional) Whether to create AWS Resource Tags for the module informations. bool true no
port (Optional) The number of port on which the listener of the service is listening. Valid values are from 1 to 65535. If port is not specified and protocol is HTTP, the value will default to 80. If port is not specified and protocol is HTTPS, the value will default to 443. number null no
resource_group_description (Optional) The description of Resource Group. string "Managed by Terraform." no
resource_group_enabled (Optional) Whether to create Resource Group to find and group AWS resources which are created by this module. bool true no
resource_group_name (Optional) The name of Resource Group. A Resource Group name can have a maximum of 127 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with AWS or aws. string "" no
rules (Optional) A list of rules to enable content-based routing to the target groups that make up the service. Each rule consists of a priority, one or more actions, and one or more conditions. Each block of rules block as defined below.
(Required) priority - The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
(Optional) name - A rule name can describe the purpose of the rule or the type of traffic it is intended to handle. Rule names can't be changed after creation. Defaults to $(service)-$(priority).
(Required) conditions - The rule conditions. conditions block as defined below.
(Optional) method - The condition of HTTP request method. Valid values are GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH.
(Required) path - The condition of HTTP request path. path block as defined below.
(Required) value - The path pattern. The pattern must start with /.
(Optional) operator - The operator that you want to use to determine whether an HTTP request path matches the conditions. Valid values are EXACT, PREFIX. Defaults to PREFIX.
(Optional) case_sensitive - Whether to match the value condition using a case-sensitive match. Defaults to false.
(Optional) headers - The condition of HTTP request headers. Each block of headers as defined below.
(Required) name - The name of the HTTP header field.
(Required) value - The value of the HTTP header field.
(Optional) operator - The operator that you want to use to determine whether an HTTP header matches the conditions. Valid values are EXACT, PREFIX, CONTAINS. Defaults to EXACT.
(Optional) case_sensitive - Whether to match the value condition using a case-sensitive match. Defaults to false.
(Required) action_type - The action type for the rule of the service. Valid values are FORWARD, FIXED_RESPONSE.
(Optional) action_parameters - The configuration for the parameters of the routing action. action_parameters block as defined below.
(Optional) status_code - Custom HTTP status code to drop client requests and return a custom HTTP response. Valid values are 404. Only supported if action_type is FIXED_RESPONSE.
(Optional) destinations - A list of one or more target groups to route traffic. Only supported if action_type is FORWARD. Each item of destinations block as defined below.
(Required) target_group - The ID or ARN of the target group to which to route traffic.
(Optional) weight - The weight to use routing traffic to target_group. how requests are distributed to the target group. Only required if you specify multiple target groups for a forward action. For example, if you specify two target groups, one with a weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group. Valid value is 0 to 999. Defaults to 100.
list(object({
priority = number
name = optional(string)

conditions = object({
method = optional(string)
path = object({
value = string
operator = optional(string, "PREFIX")
case_sensitive = optional(bool, false)
})
headers = optional(list(object({
name = string
value = string
operator = optional(string, "EXACT")
case_sensitive = optional(bool, false)
})), [])
})

action_type = string
action_parameters = optional(object({
status_code = optional(number, 404)
destinations = optional(list(object({
target_group = string
weight = optional(number, 100)
})), [])
}), {})
}))
[] no
tags (Optional) A map of tags to add to all resources. map(string) {} no

Outputs

Name Description
arn The ARN of the service listener.
created_at Date and time that the listener was created, specified in ISO-8601 format.
default_action The configuration for default routing action of the service listener.
type - The type of default routing action.
parameters - The configuration for the parameters of the default routing action. default_action_parameters block as defined below.
id The ID of the service listener.
name The name of the service listener.
port The number of port on which the listener of the service is listening.
protocol The protocol for the service listener.
rules The list of rules to enable content-based routing to the target groups that make up the service.
id - Unique identifier for the listener rule.
arn - The ARN for the listener rule.
priority - The priority assigned to the listener rule.
name - The rule name to describe the purpose of the listener rule.
conditions - The rule conditions.
method - The condition of HTTP request method.
path - The condition of HTTP request path.
headers - The condition of HTTP request headers.
action - The action for the listener rule.
type - The action type for the rule of the service.
parameters - The configuration for the parameters of the routing action.
service The associated VPC Lattice service.
updated_at Date and time that the listener was last updated, specified in ISO-8601 format.