generated from moja-global/Import-Me
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add azure integration for FLINT.Cloud (#133)
* chore: add terraform auto-generated files to .gitignore * feat: add terraform scripts for deploying rest_api_flint.example * feat: add terraform scripts for deploying rest_api_gcbm * chore: format terraform files
- Loading branch information
1 parent
e6a7632
commit d461ec6
Showing
9 changed files
with
198 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# REST API FLINT.Example Terraform integration for Azure | ||
|
||
This Terraform script provisions a Linux App Service which runs the `ghcr.io/moja-global/rest_api_flint.example` Docker container. | ||
|
||
## Variables | ||
|
||
- `prefix` - (Required) The prefix used for all resources in this example. | ||
- `location` - (Required) Azure Region in which all resources in this example should be provisioned. | ||
|
||
## Outputs | ||
|
||
- `app_name` - The name of the app. | ||
- `app_url` - The default URL to access the app. | ||
|
||
## Usage | ||
|
||
- Initialize the directory: | ||
```sh | ||
terraform init | ||
``` | ||
|
||
- Deploy the infrastructure: | ||
```sh | ||
terraform apply | ||
``` | ||
|
||
If the plan is acceptable, type "yes" at the confirmation prompt to proceed. Executing the plan will take a few minutes. Once deployed, the Container is launched on the first HTTP Request, which can take a while. | ||
|
||
## Notes | ||
|
||
Continuous Deployment of a single Docker Container can be achieved using the App Setting `DOCKER_ENABLE_CI` to `true`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
provider "azurerm" { | ||
features {} | ||
} | ||
|
||
resource "azurerm_resource_group" "example" { | ||
name = "${var.prefix}-resources" | ||
location = var.location | ||
} | ||
|
||
resource "azurerm_service_plan" "example" { | ||
name = "${var.prefix}-sp-zipdeploy" | ||
location = azurerm_resource_group.example.location | ||
resource_group_name = azurerm_resource_group.example.name | ||
os_type = "Linux" | ||
sku_name = "S1" | ||
} | ||
|
||
|
||
resource "azurerm_linux_web_app" "example" { | ||
name = "${var.prefix}-example" | ||
location = azurerm_resource_group.example.location | ||
resource_group_name = azurerm_resource_group.example.name | ||
service_plan_id = azurerm_service_plan.example.id | ||
|
||
app_settings = { | ||
"WEBSITES_ENABLE_APP_SERVICE_STORAGE" = "false" | ||
"WEBSITES_PORT" = 8080 | ||
} | ||
|
||
site_config { | ||
application_stack { | ||
docker_image = "ghcr.io/moja-global/rest_api_flint.example" | ||
docker_image_tag = "master" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
output "linux_web_app_name" { | ||
value = azurerm_linux_web_app.example.name | ||
} | ||
|
||
output "app_url" { | ||
value = "https://${azurerm_linux_web_app.example.default_hostname}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
variable "prefix" { | ||
type = string | ||
description = "The prefix used for all resources in this example" | ||
} | ||
|
||
variable "location" { | ||
type = string | ||
description = "The Azure location where all resources in this example should be created" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# REST API GCBM Terraform integration for Azure | ||
|
||
This Terraform script provisions a Linux App Service which runs the `ghcr.io/moja-global/rest_api_gcbm` Docker container. | ||
|
||
## Variables | ||
|
||
- `prefix` - (Required) The prefix used for all resources in this example. | ||
- `location` - (Required) Azure Region in which all resources in this example should be provisioned. | ||
|
||
## Outputs | ||
|
||
- `app_name` - The name of the app. | ||
- `app_url` - The default URL to access the app. | ||
|
||
## Usage | ||
|
||
- Initialize the directory: | ||
```sh | ||
terraform init | ||
``` | ||
|
||
- Deploy the infrastructure: | ||
```sh | ||
terraform apply | ||
``` | ||
|
||
If the plan is acceptable, type "yes" at the confirmation prompt to proceed. Executing the plan will take a few minutes. Once deployed, the Container is launched on the first HTTP Request, which can take a while. | ||
|
||
## Notes | ||
|
||
Continuous Deployment of a single Docker Container can be achieved using the App Setting `DOCKER_ENABLE_CI` to `true`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
provider "azurerm" { | ||
features {} | ||
} | ||
|
||
resource "azurerm_resource_group" "example" { | ||
name = "${var.prefix}-resources" | ||
location = var.location | ||
} | ||
|
||
resource "azurerm_service_plan" "example" { | ||
name = "${var.prefix}-sp-zipdeploy" | ||
location = azurerm_resource_group.example.location | ||
resource_group_name = azurerm_resource_group.example.name | ||
os_type = "Linux" | ||
sku_name = "S1" | ||
} | ||
|
||
|
||
resource "azurerm_linux_web_app" "example" { | ||
name = "${var.prefix}-example" | ||
location = azurerm_resource_group.example.location | ||
resource_group_name = azurerm_resource_group.example.name | ||
service_plan_id = azurerm_service_plan.example.id | ||
|
||
app_settings = { | ||
"WEBSITES_ENABLE_APP_SERVICE_STORAGE" = "false" | ||
"WEBSITES_PORT" = 8080 | ||
} | ||
|
||
site_config { | ||
application_stack { | ||
docker_image = "ghcr.io/moja-global/rest_api_gcbm" | ||
docker_image_tag = "master" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
output "linux_web_app_name" { | ||
value = azurerm_linux_web_app.example.name | ||
} | ||
|
||
output "app_url" { | ||
value = "https://${azurerm_linux_web_app.example.default_hostname}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
variable "prefix" { | ||
type = string | ||
description = "The prefix used for all resources in this example" | ||
} | ||
|
||
variable "location" { | ||
type = string | ||
description = "The Azure location where all resources in this example should be created" | ||
} |