Skip to content

Commit

Permalink
Modified Code
Browse files Browse the repository at this point in the history
  • Loading branch information
nitin-das committed Jan 10, 2020
1 parent 985b034 commit 8fe2fca
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,34 +112,17 @@ The variables required in order for the module to be successfully called from th


### Usage
In order for the variables to be accessed on module level please use the syntax below:
_In order for the variables to be accessed on module level please use the syntax below:_

```tf
module.<module_name>.<output_variable_name>
```

If an output variable needs to be exposed on root level in order to be accessed through terraform state file follow the steps below:

- Include the syntax above in the network layer output terraform file.
- Add the code snippet below to the variables/global_variables file.

```tf
data "terraform_remote_state" "<module_name>" {
backend = "s3"
config {
bucket = <bucket_name> (i.e. "s3-webstack-terraform-state")
key = <state_file_relative_path> (i.e. "env:/${terraform.workspace}/4_Networking/terraform.tfstate")
region = <bucket_region> (i.e. "eu-central-1")
}
}
```

- The output variable is able to be accessed through terraform state file using the syntax below:
_The output variable is able to be accessed through terraform state file using the syntax below:_

```tf
"${data.terraform_remote_state.<module_name>.<output_variable_name>}"
```

## Authors
Module maintained by Module maintained by the - **_Nitin Das_**
_Module maintained by Module maintained by the_ - **_Nitin Das_**

0 comments on commit 8fe2fca

Please sign in to comment.