Skip to content

Commit

Permalink
feat: Expose route tables info (#138)
Browse files Browse the repository at this point in the history
<!--
  ~ Copyright 2023 StreamNative, Inc.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
-->

<!--
### Contribution Checklist

- Fill out the template below to describe the changes contributed by the
pull request. That will give reviewers the context they need to do the
review.
  
- Each pull request should address only one issue, not mix up code from
multiple issues.
  
  - Each commit in the pull request has a meaningful commit message

- Once all items of the checklist are addressed, remove the above text
and this checklist, leaving only the filled out template below.

**(The sections below can be removed for hotfixes of typos)**
-->



### Motivation


Allow downstream module can obtain route tables info

### Modifications

- Expose route tables info
- Add type tag on route tables resources

### Verifying this change

- [x] Make sure that the change passes the CI checks.

*(Please pick either of the following options)*

This change is a trivial rework / code cleanup without any test
coverage.

*(or)*

This change is already covered by existing tests, such as *(please
describe tests)*.

*(or)*

This change added tests and can be verified as follows:

*(example:)*
- *Added integration tests for end-to-end deployment with large payloads
(10MB)*
  - *Extended integration test for recovery after broker failure*

### Documentation

Check the box below.

Need to update docs? 

- [ ] `doc-required` 
  
  (If you need help on updating docs, create a doc issue)
  
- [x] `no-need-doc` 
  
  (Please explain why)
  
- [ ] `doc` 
  
  (If this PR contains doc changes)
  • Loading branch information
ciiiii authored Sep 10, 2024
1 parent 264e39f commit 13d1412
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ resource "aws_route_table" "public_route_table" {
count = 1

vpc_id = aws_vpc.vpc.id
tags = merge({ "Vendor" = "StreamNative", Name = format("%s-public-rtb", var.vpc_name) }, var.tags)
tags = merge({ "Vendor" = "StreamNative", "Type" = "public", Name = format("%s-public-rtb", var.vpc_name) }, var.tags)

lifecycle {
ignore_changes = [tags]
Expand All @@ -122,7 +122,7 @@ resource "aws_route_table" "private_route_table" {
count = var.disable_nat_gateway ? 0 : local.num_azs

vpc_id = aws_vpc.vpc.id
tags = merge({ "Vendor" = "StreamNative", Name = format("%s-private-rtb-%s", var.vpc_name, count.index) }, var.tags)
tags = merge({ "Vendor" = "StreamNative", "Type" = "private", Name = format("%s-private-rtb-%s", var.vpc_name, count.index) }, var.tags)

lifecycle {
ignore_changes = [tags]
Expand Down
8 changes: 8 additions & 0 deletions modules/vpc/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ output "public_subnet_ids" {
description = "A list of public subnet ID's created by this module"
}

output "private_route_table_ids" {
value = aws_route_table.private_route_table.*.id
}

output "public_route_table_ids" {
value = aws_route_table.public_route_table.*.id
}

output "vpc_id" {
value = aws_vpc.vpc.id
description = "The ID of the VPC created by this module"
Expand Down

0 comments on commit 13d1412

Please sign in to comment.