File tree Expand file tree Collapse file tree 4 files changed +22
-8
lines changed Expand file tree Collapse file tree 4 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -34,4 +34,8 @@ module "test" {
34
34
| natgateway | nat gateway list of availability zone to spread | ` list ` | false | yes |
35
35
36
36
## output
37
- vpc_id
37
+ | Name | Description | Type |
38
+ | ------| -------------| ------|
39
+ | vpc-id | the vpc id | string |
40
+ | public-subnet-ids | a map of generated public subnet ids| map |
41
+ | private-subnet-ids | a map of generated private subnet ids| map|
Original file line number Diff line number Diff line change @@ -14,3 +14,10 @@ module "test" {
14
14
c = " 10.17.10.0/23"
15
15
}
16
16
}
17
+
18
+ output "public-subnet-ids" {
19
+ value = module. test . public-subnet-ids
20
+ }
21
+ output "a-private-subnet-id" {
22
+ value = module. test . private-subnet-ids [" a" ]
23
+ }
Original file line number Diff line number Diff line change 1
1
provider "aws" {
2
- # i am using environment variables locally
3
- region = " us-east-1"
4
- # access_key = "AKIAZGWEKBAWRKPVLRIL"
5
- # secret_key = "my-secret-key"
6
2
default_tags {
7
3
tags = {
8
4
Provisioner = " Terraform"
9
5
Project = " POC"
10
- OWNER = " ops"
11
6
}
12
7
}
13
8
}
Original file line number Diff line number Diff line change 1
- output "vpc_id" {
2
- value = aws_vpc. vpc . id
1
+ output "vpc-id" {
2
+ value = aws_vpc. vpc . id
3
+ }
4
+
5
+ output "public-subnet-ids" {
6
+ value = { for k , v in aws_subnet . public-subnet : k => v . id }
7
+ }
8
+
9
+ output "private-subnet-ids" {
10
+ value = { for k , v in aws_subnet . private-subnet : k => v . id }
3
11
}
You can’t perform that action at this time.
0 commit comments