File tree Expand file tree Collapse file tree 14 files changed +238
-0
lines changed
v1.10.x/docs/cli/commands
v1.11.x/docs/cli/commands
v1.12.x/docs/cli/commands
v1.13.x/docs/cli/commands
v1.14.x (beta)/docs/cli/commands Expand file tree Collapse file tree 14 files changed +238
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,23 @@ instance_ips = [
9393]
9494```
9595
96+ The ` terraform output ` command only displays outputs defined in the root module.
97+ To display outputs from child modules, define an ` output ` block in your
98+ root module using the value of an output from a child module. The example
99+ below uses a child module named ` loadbalancer ` that defines an output named
100+ ` lb_address ` . It then defines an output in the root module named ` address `
101+ to access the value when you run ` terraform output ` .
102+
103+ ``` hcl
104+ module "loadbalancer" {
105+ source = "./modules/loadbalancer"
106+ }
107+
108+ output "address" {
109+ value = module.loadbalancer.lb_address
110+ }
111+ ```
112+
96113## Use in automation
97114
98115The ` terraform output ` command by default displays in a human-readable format,
Original file line number Diff line number Diff line change @@ -94,6 +94,23 @@ instance_ips = [
9494]
9595```
9696
97+ The ` terraform output ` command only displays outputs defined in the root module.
98+ To display outputs from child modules, define an ` output ` block in your
99+ root module using the value of an output from a child module. The example
100+ below uses a child module named ` loadbalancer ` that defines an output named
101+ ` lb_address ` . It then defines an output in the root module named ` address `
102+ to access the value when you run ` terraform output ` .
103+
104+ ``` hcl
105+ module "loadbalancer" {
106+ source = "./modules/loadbalancer"
107+ }
108+
109+ output "address" {
110+ value = module.loadbalancer.lb_address
111+ }
112+ ```
113+
97114## Use in automation
98115
99116The ` terraform output ` command by default displays in a human-readable format,
Original file line number Diff line number Diff line change @@ -92,6 +92,23 @@ instance_ips = [
9292]
9393```
9494
95+ The ` terraform output ` command only displays outputs defined in the root module.
96+ To display outputs from child modules, define an ` output ` block in your
97+ root module using the value of an output from a child module. The example
98+ below uses a child module named ` loadbalancer ` that defines an output named
99+ ` lb_address ` . It then defines an output in the root module named ` address `
100+ to access the value when you run ` terraform output ` .
101+
102+ ``` hcl
103+ module "loadbalancer" {
104+ source = "./modules/loadbalancer"
105+ }
106+
107+ output "address" {
108+ value = module.loadbalancer.lb_address
109+ }
110+ ```
111+
95112## Use in automation
96113
97114The ` terraform output ` command by default displays in a human-readable format,
Original file line number Diff line number Diff line change @@ -92,6 +92,23 @@ instance_ips = [
9292]
9393```
9494
95+ The ` terraform output ` command only displays outputs defined in the root module.
96+ To display outputs from child modules, define an ` output ` block in your
97+ root module using the value of an output from a child module. The example
98+ below uses a child module named ` loadbalancer ` that defines an output named
99+ ` lb_address ` . It then defines an output in the root module named ` address `
100+ to access the value when you run ` terraform output ` .
101+
102+ ``` hcl
103+ module "loadbalancer" {
104+ source = "./modules/loadbalancer"
105+ }
106+
107+ output "address" {
108+ value = module.loadbalancer.lb_address
109+ }
110+ ```
111+
95112## Use in automation
96113
97114The ` terraform output ` command by default displays in a human-readable format,
Original file line number Diff line number Diff line change @@ -92,6 +92,23 @@ instance_ips = [
9292]
9393```
9494
95+ The ` terraform output ` command only displays outputs defined in the root module.
96+ To display outputs from child modules, define an ` output ` block in your
97+ root module using the value of an output from a child module. The example
98+ below uses a child module named ` loadbalancer ` that defines an output named
99+ ` lb_address ` . It then defines an output in the root module named ` address `
100+ to access the value when you run ` terraform output ` .
101+
102+ ``` hcl
103+ module "loadbalancer" {
104+ source = "./modules/loadbalancer"
105+ }
106+
107+ output "address" {
108+ value = module.loadbalancer.lb_address
109+ }
110+ ```
111+
95112## Use in automation
96113
97114The ` terraform output ` command by default displays in a human-readable format,
Original file line number Diff line number Diff line change @@ -92,6 +92,23 @@ instance_ips = [
9292]
9393```
9494
95+ The ` terraform output ` command only displays outputs defined in the root module.
96+ To display outputs from child modules, define an ` output ` block in your
97+ root module using the value of an output from a child module. The example
98+ below uses a child module named ` loadbalancer ` that defines an output named
99+ ` lb_address ` . It then defines an output in the root module named ` address `
100+ to access the value when you run ` terraform output ` .
101+
102+ ``` hcl
103+ module "loadbalancer" {
104+ source = "./modules/loadbalancer"
105+ }
106+
107+ output "address" {
108+ value = module.loadbalancer.lb_address
109+ }
110+ ```
111+
95112## Use in automation
96113
97114The ` terraform output ` command by default displays in a human-readable format,
Original file line number Diff line number Diff line change @@ -93,6 +93,23 @@ instance_ips = [
9393]
9494```
9595
96+ The ` terraform output ` command only displays outputs defined in the root module.
97+ To display outputs from child modules, define an ` output ` block in your
98+ root module using the value of an output from a child module. The example
99+ below uses a child module named ` loadbalancer ` that defines an output named
100+ ` lb_address ` . It then defines an output in the root module named ` address `
101+ to access the value when you run ` terraform output ` .
102+
103+ ``` hcl
104+ module "loadbalancer" {
105+ source = "./modules/loadbalancer"
106+ }
107+
108+ output "address" {
109+ value = module.loadbalancer.lb_address
110+ }
111+ ```
112+
96113## Use in automation
97114
98115The ` terraform output ` command by default displays in a human-readable format,
Original file line number Diff line number Diff line change @@ -93,6 +93,23 @@ instance_ips = [
9393]
9494```
9595
96+ The ` terraform output ` command only displays outputs defined in the root module.
97+ To display outputs from child modules, define an ` output ` block in your
98+ root module using the value of an output from a child module. The example
99+ below uses a child module named ` loadbalancer ` that defines an output named
100+ ` lb_address ` . It then defines an output in the root module named ` address `
101+ to access the value when you run ` terraform output ` .
102+
103+ ``` hcl
104+ module "loadbalancer" {
105+ source = "./modules/loadbalancer"
106+ }
107+
108+ output "address" {
109+ value = module.loadbalancer.lb_address
110+ }
111+ ```
112+
96113## Use in automation
97114
98115The ` terraform output ` command by default displays in a human-readable format,
Original file line number Diff line number Diff line change @@ -93,6 +93,23 @@ instance_ips = [
9393]
9494```
9595
96+ The ` terraform output ` command only displays outputs defined in the root module.
97+ To display outputs from child modules, define an ` output ` block in your
98+ root module using the value of an output from a child module. The example
99+ below uses a child module named ` loadbalancer ` that defines an output named
100+ ` lb_address ` . It then defines an output in the root module named ` address `
101+ to access the value when you run ` terraform output ` .
102+
103+ ``` hcl
104+ module "loadbalancer" {
105+ source = "./modules/loadbalancer"
106+ }
107+
108+ output "address" {
109+ value = module.loadbalancer.lb_address
110+ }
111+ ```
112+
96113## Use in automation
97114
98115The ` terraform output ` command by default displays in a human-readable format,
Original file line number Diff line number Diff line change @@ -93,6 +93,23 @@ instance_ips = [
9393]
9494```
9595
96+ The ` terraform output ` command only displays outputs defined in the root module.
97+ To display outputs from child modules, define an ` output ` block in your
98+ root module using the value of an output from a child module. The example
99+ below uses a child module named ` loadbalancer ` that defines an output named
100+ ` lb_address ` . It then defines an output in the root module named ` address `
101+ to access the value when you run ` terraform output ` .
102+
103+ ``` hcl
104+ module "loadbalancer" {
105+ source = "./modules/loadbalancer"
106+ }
107+
108+ output "address" {
109+ value = module.loadbalancer.lb_address
110+ }
111+ ```
112+
96113## Use in automation
97114
98115The ` terraform output ` command by default displays in a human-readable format,
You can’t perform that action at this time.
0 commit comments