see modules/users
- content
├── README.md
├── init.tpl
├── main.tf
├── outputs.tf
└── variables.tf
- include module block code
module "users" {
source = "./modules/users"
username = "dddddemo"
consul_host ="http://127.0.0.1:8500"
}
- get local module
terraform get
- init
terraform init
- view plan
terraform plan
- apply
terraform apply
- output result file
like below
#!/bin/bash
curl -X POST \
http://127.0.0.1:8500 \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"name":"dddddemo",
"age": "444",
"platform":"mobile",
"id":"d288df44-c939-1ca3-0bb6-b8998b9305ca"
}'