Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jackall3n/terraform-provider-render
A terraform provider for render.com
https://github.com/jackall3n/terraform-provider-render
render terraform terraform-provider
Last synced: 15 days ago
JSON representation
A terraform provider for render.com
- Host: GitHub
- URL: https://github.com/jackall3n/terraform-provider-render
- Owner: jackall3n
- License: mpl-2.0
- Created: 2022-10-26T11:13:32.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-04T12:23:51.000Z (8 months ago)
- Last Synced: 2024-10-22T05:21:35.327Z (16 days ago)
- Topics: render, terraform, terraform-provider
- Language: Go
- Homepage: https://registry.terraform.io/providers/jackall3n/render
- Size: 81.1 KB
- Stars: 22
- Watchers: 1
- Forks: 9
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Render Provider
The Render provider is used to interact with https://render.com
Use the navigation to the left to read about the available resources.
## Supported Service Types
* Web Service
* Private Service
* Static Site## Example Usage
Do not keep your authentication password in HCL for production environments, use Terraform environment variables.
**Setup environment**
```terraform
terraform {
required_providers {
render = {
version = "1.1.1"
source = "render.com/terraform/render"
}
}
}provider "render" {
# api_key = "" // Uses env.RENDER_API_KEY, if not supplied
# email = "" // Uses env.RENDER_EMAIL, if not supplied
}resource "render_service" "client" {
name = "client"
repo = "https://github.com/render-examples/nextjs-hello-world"
type = "static_site"static_site_details = {
build_command = "yarn; yarn build; yarn next export"
publish_path = "out"
}
}resource "render_service" "api" {
name = "api"
repo = "https://github.com/render-examples/hapi-quick-start"
type = "web_service"web_service_details = {
env = "node"native = {
build_command = "npm install"
start_command = "node server.js"
}
}
}resource "render_service" "db" {
name = "db"
repo = "https://github.com/render-examples/mongodb"
type = "private_service"private_service_details = {
env = "docker"
disk = {
name = "db"
mount_path = "/data/db"
size_gb = 10
}
}
}resource "render_service_custom_domain" "client-domain" {
service_id = render_service.client.id
domain_name = "client.acme.com"
}resource "render_service_environment" "api" {
service = render_service.api.idvariables = [{
key = "DATABASE_URL"
value = render_service.db.private_service_details.url
}]
}resource "render_service_environment" "client" {
service = render_service.client.idvariables = [{
key = "API_URL"
value = render_service.api.web_service_details.url
}]
}
```**Create web / private / static services**
```terraform
provider "render" {
apiKey = "your-api-key"
email = "your-render-email"
}resource "render_service" "nextjs" {
name = "nextjs"
repo = "https://github.com/render-examples/nextjs-hello-world"
type = "web_service"
branch = "master"web_service_details = {
env = "node"
region = "frankfurt"
plan = "starter"
native = {
build_command = "yarn; yarn build"
start_command = "yarn start"
}
}
}resource "render_service" "mongodb" {
name = "mongodb"
repo = "https://github.com/render-examples/mongodb"
type = "private_service"private_service_details = {
env = "docker"disk = {
name = "db"
mount_path = "/data/db"
size_gb = 10
}
}
}resource "render_service" "svelte" {
name = "mongodb"
repo = "https://github.com/render-examples/svelte"
type = "static_site"static_site_details = {
build_command = "npm install && npm run build"
publish_path = "public"
}
}
```## Render API Documentation
Here is a link to the official Render API documentation: https://api-docs.render.com/reference/introduction