Skip to content

Allow optional creation of S3 endpoint association for database subnets #607

@grozdz

Description

@grozdz

Currenly, VPC module allows to create S3 endpoint for private and public subnets (optionally). It would be great to add possibility to create such endpoint (route table association) for database subnets as well. This could be very useful for enabling S3 access from RDS via S3 endpoint like described here: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Integrating.SaveIntoS3.html
and there:
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Integrating.Authorizing.Network.html

I think it could be done by simple code like:

  count = var.create_vpc && var.enable_s3_endpoint && var.enable_database_s3_endpoint && length(var.database_subnets) > 0 && var.s3_endpoint_type == "Gateway" ? local.nat_gateway_count : 0

  vpc_endpoint_id = aws_vpc_endpoint.s3[0].id
  route_table_id  = element(aws_route_table.database.*.id, count.index)
}

in vpc-endpoints.tf.

BR
Grzegorz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions