-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add deployment solution to digital ocean app platform #430
Changes from all commits
534610d
5e46488
bf4b43a
b04f436
43ee94b
290de11
1ca4a29
28f8912
6bc73ef
fd0f969
e132e0a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.terraform | ||
terraform.tfstate | ||
terraform.tfstate.backup |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
terraform { | ||
required_version = ">= 1.0.0" | ||
|
||
required_providers { | ||
digitalocean = { | ||
source = "digitalocean/digitalocean" | ||
version = ">= 2.0.0" | ||
} | ||
} | ||
} | ||
|
||
provider "digitalocean" {} | ||
|
||
resource "digitalocean_app" "server-api" { | ||
spec { | ||
name = "server-api" | ||
region = "sfo3" | ||
|
||
domain { | ||
name = "api.asyncapi.com" | ||
smoya marked this conversation as resolved.
Show resolved
Hide resolved
|
||
type = "PRIMARY" | ||
} | ||
|
||
ingress { | ||
rule { | ||
component { | ||
name = "asyncapi-server-api" | ||
} | ||
match { | ||
path { | ||
prefix = "/" | ||
} | ||
} | ||
cors { | ||
allow_origins { | ||
exact = "*" | ||
} | ||
allow_methods = ["GET", "POST", "PUT", "DELETE", "OPTIONS"] | ||
allow_headers = ["*"] | ||
} | ||
} | ||
} | ||
|
||
service { | ||
name = "asyncapi-server-api" | ||
http_port = 80 | ||
health_check { | ||
http_path = "/v1/help/validate" | ||
Shurtu-gal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
port = 80 | ||
} | ||
env { | ||
key = "PORT" | ||
value = "80" | ||
} | ||
|
||
image { | ||
registry_type = "DOCKER_HUB" | ||
registry = "asyncapi" | ||
repository = "server-api" | ||
tag = "latest" | ||
} | ||
|
||
instance_count = 1 | ||
instance_size_slug = "basic-xs" // $10/month | ||
|
||
alert { | ||
rule = "CPU_UTILIZATION" | ||
value = 80 | ||
operator = "GREATER_THAN" | ||
window = "TEN_MINUTES" | ||
} | ||
} | ||
|
||
alert { | ||
rule = "DEPLOYMENT_FAILED" | ||
} | ||
} | ||
} | ||
|
||
output "live_url" { | ||
value = digitalocean_app.server-api.default_ingress | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!!! 👏 👏