Skip to content
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

Configure and deploy an Azure API Management Service #76

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
db512a6
Add API management using Azure to Terraform
manojvazirani Apr 15, 2019
c0aad58
Update documentation for API Manager
manojvazirani Apr 15, 2019
1688214
Merge branch 'master' of github.com:Microsoft/entref-appservice-conta…
manojvazirani Apr 23, 2019
d726691
Update api-mgr resources and documentation
manojvazirani Apr 23, 2019
f0e298d
Integrate comments for naming of api manager
manojvazirani Apr 24, 2019
4079f2d
Add App Insights to azure using terraform
manojvazirani Apr 24, 2019
3474f75
Update variables.tf for api manager
manojvazirani Apr 24, 2019
e791dad
Create separate module for App Insights
manojvazirani Apr 24, 2019
a25f73d
Remove App Insight from AI mgmt module
manojvazirani Apr 24, 2019
0ec6454
Integrate review comments
manojvazirani Apr 26, 2019
8582a1a
Update usage documentation for API Manager and App Insights
manojvazirani Apr 29, 2019
22f7dd1
Update dependency documentation for Api mgmt and app insights
manojvazirani Apr 29, 2019
521de5f
Merge branch 'master' of github.com:Microsoft/entref-appservice-conta…
manojvazirani Apr 29, 2019
c8209b4
Add svc plan module link
manojvazirani Apr 29, 2019
769b7ed
Remove API from API manager module.
manojvazirani Apr 30, 2019
c2a8975
Add API in API manager module
manojvazirani Apr 30, 2019
f4ff299
Merge branch 'master' of github.com:Microsoft/entref-appservice-conta…
manojvazirani May 1, 2019
dbcdb1b
Add API changes and update documentation for usage
manojvazirani May 1, 2019
7c17ef2
Add app insights to API manager
manojvazirani May 1, 2019
e35d3bc
Add source to documentation
manojvazirani May 2, 2019
9b19abd
Add app insights to app service.
manojvazirani May 2, 2019
395e8da
Update Output ID's
manojvazirani May 2, 2019
ba6a0a6
Fix merge conflicts with master
manojvazirani May 2, 2019
9034be4
Add ARM deployment for API mgr inside VNET
manojvazirani May 6, 2019
feb3c26
Merge branch 'master' of github.com:Microsoft/entref-appservice-conta…
manojvazirani May 7, 2019
b14b859
Add azuredeploy.json file to repo.
manojvazirani May 7, 2019
6282294
Adding option for user to deploy APIM inside or outside of vnet
manojvazirani May 8, 2019
dc91b1b
Add API operation for each API created.
manojvazirani May 8, 2019
ff77853
Add hostname configuration options to APIM
manojvazirani May 9, 2019
6143d1f
Fix issue with type variables in hostname configurations
manojvazirani May 9, 2019
c78642b
Add keyvault integration to hostnameConfigurations
manojvazirani May 9, 2019
69380b3
Merge branch 'master' of github.com:Microsoft/entref-appservice-conta…
manojvazirani May 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions infra/modules/providers/azure/api-mgmt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Module Azure API Management

Azure API Management is a turnkey solution for publishing APIs to external and internal customers. It quickly creates consistent and modern API gateways for existing back-end services hosted anywhere.

More information for Azure API Management Service can be found [here](https://azure.microsoft.com/en-us/services/api-management)

A terraform module in Cobalt to provide API manangement with the following characteristics:

- Ability to specify resource group name in which the API manager is deployed.
- Ability to specify resource group location in which the API manager is deployed.
- Also gives ability to specify the following for API Manager based on the requirements:
- name : The name of the API Manager to be deployed.
- publisher_name : The name of the Publisher/Company of the API Management Service.
- publisher_email : The email of Publisher/Company of the API Management Service.
- tags : A mapping of tags assigned to the resource.
- sku_name : Specifies the plan's pricing tier.
- capacity : Specifies the number of units associated with this API Management service.

Please click the [link](https://www.terraform.io/docs/providers/azurerm/d/api_management.html) to get additional details on settings in Terraform for Azure API Management.

## Usage
manojvazirani marked this conversation as resolved.
Show resolved Hide resolved

```
variable "resource_group_name" {
default = "cblt-apimgmt-rg"
}

variable "resource_group_location" {
default = "eastus"
}

resource "azurerm_resource_group" "apimgmt" {
name = "${var.resource_group_name}"
location = "${var.resource_group_location}"
tags = "${var.resource_tags}"
}

resource "azurerm_api_management" "apimgmt" {
name = "${var.apimgmt_name}"
location = "${azurerm_resource_group.apimgmt.location}"
resource_group_name = "${azurerm_resource_group.apimgmt.name}"
publisher_name = "${var.apimgmt_pub_name}"
publisher_email = "${var.apimgmt_pub_email}"
tags = "${var.resource_tags}"

sku {
name = "${var.apimgmt_sku}"
capacity = "${var.apimgmt_capacity}"
}
}
```
23 changes: 23 additions & 0 deletions infra/modules/providers/azure/api-mgmt/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module "azure-provider" {
manojvazirani marked this conversation as resolved.
Show resolved Hide resolved
source = "../provider"
}

resource "azurerm_resource_group" "apimgmt" {
manojvazirani marked this conversation as resolved.
Show resolved Hide resolved
name = "${var.resource_group_name}"
location = "${var.resource_group_location}"
tags = "${var.resource_tags}"
}

resource "azurerm_api_management" "apimgmt" {
name = "${var.apimgmt_name}"
manojvazirani marked this conversation as resolved.
Show resolved Hide resolved
location = "${azurerm_resource_group.apimgmt.location}"
resource_group_name = "${azurerm_resource_group.apimgmt.name}"
publisher_name = "${var.apimgmt_pub_name}"
publisher_email = "${var.apimgmt_pub_email}"
tags = "${var.resource_tags}"

sku {
name = "${var.apimgmt_sku}"
capacity = "${var.apimgmt_capacity}"
}
}
14 changes: 14 additions & 0 deletions infra/modules/providers/azure/api-mgmt/output.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
output "resource_group_name" {
description = "The name of the resource group created"
value = "${azurerm_resource_group.apimgmt.name}"
}

output "scm_url" {
description = "The url of the API management source code management url"
value = "${azurerm_api_management.apimgmt.scm_url}"
}

output "management_api_url" {
description = "The URL for the Management API associated with this API Management service."
value = "${azurerm_api_management.apimgmt.management_api_url}"
}
40 changes: 40 additions & 0 deletions infra/modules/providers/azure/api-mgmt/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
variable "resource_group_name" {
description = "Default resource group name that the management service will be created in."
type = "string"
}

variable "resource_group_location" {
description = "The location/region where the api management service will be deployed. The full list of Azure regions can be found at https://azure.microsoft.com/regions"
type = "string"
}

variable "resource_tags" {
description = "Map of tags to apply to taggable resources in this module. By default the taggable resources are tagged with the name defined above and this map is merged in"
type = "map"
default = {}
}

variable "apimgmt_name" {
description = "Name of the api management service to create"
type = "string"
}

variable "apimgmt_sku" {
description = "SKU of the api management service to create"
default = "Premium"
}

variable "apimgmt_pub_name" {
description = "API management publisher name"
default = "mycompany.co"
}

variable "apimgmt_pub_email" {
description = "API management publisher name"
default = "terraform@mycompany.co"
}

variable "apimgmt_capacity" {
type = "string"
default = "1"
}
42 changes: 42 additions & 0 deletions infra/modules/providers/azure/app-insights/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Azure Application Insights

Application Insights is an extensible Application Performance Management (APM) service for web developers on multiple platforms. Use it to monitor your live web application. It will automatically detect performance anomalies. It includes powerful analytics tools to help you diagnose issues and to understand what users actually do with your app.

More information for Azure Application Insights can be found [here](https://docs.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview)

A terraform module in Cobalt to provide Application Insights with the following characteristics:

- Ability to deploy Application Insights in the same resource group as the API manager.
- Ability to deploy Application Insights in the same resource group location in which the API manager is deployed.
- Also gives ability to specify the following for Application Insights based on the requirements:
- name : Specifies the name of the Application Insights component. Changing this forces a new resource to be created.
- application_type : Specifies the type of Application Insights to create. Valid values are ios for iOS, java for Java web, MobileCenter for App Center, Node.JS for Node.js, other for General, phone for Windows Phone, store for Windows Store and web for ASP.NET. Please note these values are case sensitive; unmatched values are treated as ASP.NET by Azure. Changing this forces a new resource to be created.
- tags : A mapping of tags to assign to the resource.

Please click the [link](https://www.terraform.io/docs/providers/azurerm/r/application_insights.html) to get additional details on settings in Terraform for Azure Application Insights.

## Usage
manojvazirani marked this conversation as resolved.
Show resolved Hide resolved

```
variable "resource_group_name" {
default = "cblt-apimgmt-rg"
}

variable "resource_group_location" {
default = "eastus"
}

resource "azurerm_resource_group" "appinsights" {
name = "${var.resource_group_name}"
location = "${var.resource_group_location}"
tags = "${var.resource_tags}"
}

resource "azurerm_application_insights" "appinsights" {
name = "${var.appinsights_name}"
resource_group_name = "${azurerm_resource_group.appinsights.name}"
location = "${azurerm_resource_group.appinsights.location}"
application_type = "${var.appinsights_application_type}"
tags = "${var.resource_tags}"
}
```
17 changes: 17 additions & 0 deletions infra/modules/providers/azure/app-insights/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module "azure-provider" {
source = "../provider"
}

resource "azurerm_resource_group" "appinsights" {
manojvazirani marked this conversation as resolved.
Show resolved Hide resolved
name = "${var.resource_group_name}"
location = "${var.resource_group_location}"
tags = "${var.resource_tags}"
}

resource "azurerm_application_insights" "appinsights" {
manojvazirani marked this conversation as resolved.
Show resolved Hide resolved
name = "${var.appinsights_name}"
resource_group_name = "${azurerm_resource_group.appinsights.name}"
location = "${azurerm_resource_group.appinsights.location}"
application_type = "${var.appinsights_application_type}"
tags = "${var.resource_tags}"
}
14 changes: 14 additions & 0 deletions infra/modules/providers/azure/app-insights/output.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
output "resource_group_name" {
description = "The name of the resource group created"
value = "${azurerm_resource_group.appinsights.name}"
}

output "app_insights_app_id" {
description = "The App ID associated with this Application Insights component"
value = "${azurerm_application_insights.appinsights.app_id}"
}

output "app_insights_instrumentation_key" {
description = "The Instrumentation Key for this Application Insights component."
value = "${azurerm_application_insights.appinsights.instrumentation_key}"
}
50 changes: 50 additions & 0 deletions infra/modules/providers/azure/app-insights/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
variable "resource_group_name" {
description = "Default resource group name that the management service will be created in."
type = "string"
}

variable "resource_group_location" {
description = "The location/region where the api management service will be deployed. The full list of Azure regions can be found at https://azure.microsoft.com/regions"
type = "string"
}

variable "resource_tags" {
description = "Map of tags to apply to taggable resources in this module. By default the taggable resources are tagged with the name defined above and this map is merged in"
type = "map"
default = {}
}

variable "apimgmt_name" {
description = "Name of the api management service to create"
type = "string"
}

variable "apimgmt_sku" {
description = "SKU of the api management service to create"
default = "Premium"
}

variable "apimgmt_pub_name" {
description = "API management publisher name"
default = "mycompany.co"
}

variable "apimgmt_pub_email" {
description = "API management publisher name"
default = "terraform@mycompany.co"
}

variable "apimgmt_capacity" {
type = "string"
default = "1"
}

variable "appinsights_name" {
description = "Name of the App Insights to create"
type = "string"
}

variable "appinsights_application_type" {
description = "Type of the App Insights Application"
default = "Web"
}