Igor Cicimov wrote:
>On Tuesday, April 26, 2016 at 1:43:29 AM UTC+10, Andrew Hodgson wrote:
>> Hi,
>>
>> I am defining a few routing tables like so:
>>
>> variable "nat_count" {
>> default= 2
>> }
>>
>> resource "aws_route_table" "public" {
>> count = "${var.nat_count}"
>> vpc_id = "${
aws_vpc.vpc.id}"
>> }
>>
>> resource "aws_route_table" "private" {
>> count = "${var.nat_count}"
>> vpc_id = "${
aws_vpc.vpc.id}"
>> }
>>
>>
>> I now want to create an S3 endpoint for the VPC and assign it to the 4 custom routing tables I have created:
>>
>> resource "aws_vpc_endpoint" "s3" {
>> vpc_id = "${
aws_vpc.vpc.id}"
>> service_name = "com.amazonaws.eu-west-1.s3"
>> route_table_ids = ["${element(aws_route_table.private.*.id,
>> var.nat_count.index)}", "${element(aws_route_table.public.*.id,
>> var.nat_count.index)}"] }
>You are missing count = "${var.nat_count}" here
Thanks for that. I did that this morning, it works fine but gives me an extra S3 endpoint. I wanted to get the single S3 endpoint associated with the 4 route tables, but am happy to live with things as they are now.