Skip to content

Luscii/terraform-aws-load-balancer

Repository files navigation

terraform-module-template

Template for creating Terraform modules

Examples

module "this" {
  source = ""
}

Configuration

Requirements

Name Version
terraform >= 1.3
aws >= 4.9

Providers

Name Version
aws 5.97.0

Modules

Name Source Version
access_logs_label cloudposse/label/null 0.25.0
label cloudposse/label/null 0.25.0

Resources

Name Type
aws_lb.this resource
aws_lb_listener.http_redirect resource
aws_s3_bucket.access_logs resource
aws_s3_bucket_ownership_controls.access_logs resource
aws_s3_bucket_policy.access_logs resource
aws_s3_bucket_public_access_block.access_logs resource
aws_s3_bucket_server_side_encryption_configuration.access_logs resource
aws_s3_bucket_versioning.access_logs resource
aws_caller_identity.current data source
aws_iam_policy_document.access_logs data source
aws_region.current data source

Inputs

Name Description Type Default Required
access_logs_bucket_config Configuration for the S3 bucket for access logs.
The name is used to generate the bucket name.
The KMS master key ID and SSE algorithm are used for server-side encryption.
object({
name = optional(string)
kms_master_key_id = optional(string)
sse_algorithm = optional(string, "aws:kms")
})
{
"kms_master_key_id": null,
"name": "access-logs",
"sse_algorithm": "AES256"
}
no
access_logs_bucket_name Name of existing S3 bucket for access logs.
Enables access logs for the load balancer, but does not create the bucket.
If create_access_logs_bucket is true, this variable is ignored.
string null no
access_logs_prefix Prefix for the access logs in the S3 bucket. string null no
context Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as null to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional_tag_map, which are merged.
any
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {},
"tenant": null
}
no
create_access_logs_bucket Whether to create an S3 bucket for access logs. bool true no
enable_access_logs Whether to enable writing access logs to the configured S3 bucket is enabled.
Only when create_access_logs_bucket is true, or access_logs_bucket_name is set.
bool false no
enable_deletion_protection Whether to enable deletion protection for the load balancer. bool false no
idle_timeout Idle timeout for the load balancer in seconds. number 60 no
internal Whether the load balancer is internal or internet-facing. bool false no
name Name of the resource to be labeled. This is used to generate the label key and value. string n/a yes
redirect_http_to_https Whether to redirect HTTP traffic to HTTPS. bool false no
security_groups_ids List of security group IDs to associate with the load balancer. list(string) n/a yes
subnet_ids List of subnet IDs to associate with the load balancer. list(string) n/a yes
use_legacy_access_log_principal Use the legacy access log principal for the region. See: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/enable-access-logging.html bool false no

Outputs

Name Description
access_logs_bucket_arn ARN of the S3 bucket for access logs
access_logs_bucket_id ID of the S3 bucket for access logs
access_logs_bucket_policy IAM policy document for the access logs bucket
arn ARN of the load balancer
arn_suffix ARN suffix of the load balancer
dns_name DNS name of the load balancer
id ID of the load balancer
zone_id Zone ID of the load balancer

About

Setup a Load Balancer in AWS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages