An unofficial Terraform provider for Instant Proxy API
Hashicorp provider repo: https://registry.terraform.io/providers/dthung1602/instant-proxy/latest
Installation: see usage below
terraform {
required_providers {
instantproxy = {
version = "0.1.2"
source = "dthung1602/instant-proxy"
}
}
}
provider "instantproxy" {
/**
For testing you can use the fake instant proxy server available at
https://github.com/dthung1602/instant-proxy-api-client
Not providing endpoint or setting it to empty string will cause
the provider make real requests to InstantProxy server
*/
endpoint = "http://localhost:3000"
username = "username"
password = "password"
}
/** Get list of all available proxies for this account*/
data "instantproxy_proxies" "proxies" {}
/** Sample output:
proxies = {
"id" = "1655031199"
"proxies" = tolist([
{
"address" = "67.123.80.92:8800"
"ip" = "67.123.80.92"
"port" = 8800
},
{
"address" = "145.37.250.71:8800"
"ip" = "145.37.250.71"
"port" = 8800
}
])
}
*/
output "proxies" {
value = data.instantproxy_proxies.proxies
}
/** Get list of all authorized ips */
data "instantproxy_authorized_ips" "data_auth_ips" {}
/** Sample output:
data_auth_ips = {
"id" = "1655031201"
"value" = tolist([
"1.1.1.1",
"127.0.0.1",
])
}
*/
output "data_auth_ips" {
value = data.instantproxy_authorized_ips.data_auth_ips
}
/** Set value for authorized ips */
resource "instantproxy_authorized_ips" "res_auth_ips" {
value = ["127.0.0.1", "8.8.8.8"]
}
/** Sample output:
data_auth_ips = {
"id" = "1655031201"
"value" = tolist([
"127.0.0.1",
"8.8.8.8",
])
}
*/
output "res_auth_ips" {
value = resource.instantproxy_authorized_ips.res_auth_ips
}
- Clone repo:
git clone https://github.com/dthung1602/terraform-provider-instant-proxy.git
- Go to
Makefile
and changeOS_ARCH
to match your operating system and architecture - Run
go mod tidy
to install golang dependencies - Make sure you have terraform >= 0.14 installed on your system
- When any changes are make to source code:
- Run
make install
to build & make your provider available in your system - Clear terraform lock file
.terraform.lock.hcl
- Run
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Duong Thanh Hung - dthung1602@gmail.com
Project Link: https://github.com/dthung1602/terraform-provider-instant-proxy