Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Amazon VPC Lattice - VPC Lattice service examples

This example shows how you can use the VPC Lattice module to create VPC Lattice services. The following examples are covered:

  1. VPC Lattice service configured with a custom domain name and no auth policy. Access logs are configured for CloudWatch logs, S3, and Data Firehose.
  2. VPC Lattice service configured with auth type "AWS_IAM".
  3. VPC Lattice services associated to a service network.
  4. VPC Lattice service with HTTP listener.
    • Default action fixed-response (404)
    • Rule 1 (priority 10) - If prefix "/lambda", sends all the traffic to target1
    • Rule 2 (priority 20) - If header "target = instance", sends a fixed-response (404)
  5. VPC Lattice service with HTTPS listener (forward default action)

In the outputs.tf file, you can see an example on how to obtain VPC Lattice service attributes, associations' information, access log subscriptions' information, listeners and rules.

Requirements

Name Version
terraform >= 1.3.0
aws >= 4.66.0

Providers

Name Version
aws >= 4.66.0
random n/a

Modules

Name Source Version
service_associations ../.. n/a
service_auth ../.. n/a
service_customdomainname_noauth ../.. n/a
service_httplistener ../.. n/a
service_httpslistener ../.. n/a
service_network ../.. n/a

Resources

Name Type
aws_cloudwatch_log_group.service_network_loggroup resource
aws_iam_role.firehose_role resource
aws_kinesis_firehose_delivery_stream.service_network_deliverystream resource
aws_s3_bucket.service_network_logbucket resource
random_string.random resource
aws_iam_policy_document.firehose_assume_role data source

Inputs

Name Description Type Default Required
aws_region AWS Region to use. string "eu-west-1" no

Outputs

Name Description
service_attributes VPC Lattice Service ID.
service_listener_rules VPC Lattice listener rules.
service_listeners VPC Lattice listeners.
service_log_subscriptions VPC Lattice service log subscriptions.
service_sn_association VPC Lattice service association.