This module may be used to create Execute shell command resources in AWS cloud provider..
This module needs Terraform 0.12.18 or newer. You can download the latest Terraform version from here.
This module deploys aws services details are in respective feature branches.
Below we are able to check the resources that are being created as part of this module call:
- Execute shell command (Terraform 12 supported code)
- Execute shell command
To use this module, add the following call to your code:
module "<layer>-local-exec-<AccountID>" {
source = "git::https://github.com/nitinda/terraform-module-aws-local-exec.git?ref=master"
providers = {
aws = aws.services
}
}
The variables required in order for the module to be successfully called from the deployment repository are the following:
Variable | Description | Type | Argument Status |
---|---|---|---|
cmd | The command used to create the resource | string | Required |
destroy_cmd | The command used to destroy the resource | string | Required |
role | The role to assume in order to run the cli command. | string | Optional |
triggers_ids | IDs or ARNs of any resources that are a dependency | any | Optional |
- id
In order for the variables to be accessed on module level please use the syntax below:
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.
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:
"${data.terraform_remote_state.<module_name>.<output_variable_name>}"
Module maintained by Module maintained by the - Nitin Das