Skip to content

Commit

Permalink
Merge pull request #95 from ruwinrmrrr/main-116-1
Browse files Browse the repository at this point in the history
Add logic app workflow, http request trigger and http action modules
  • Loading branch information
Migara-Pramod authored Sep 11, 2024
2 parents 1b05c60 + 3083a8f commit 43d1b42
Show file tree
Hide file tree
Showing 12 changed files with 390 additions and 0 deletions.
29 changes: 29 additions & 0 deletions modules/azurerm/Logic-App-Action-HTTP/logic_app_action_http.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------

resource "azurerm_logic_app_action_http" "logic_app_action_http" {
name = join("-", [var.abbreviation, var.name])
logic_app_id = var.logic_app_id
method = var.method
uri = var.uri
body = var.body
headers = var.headers
queries = var.queries
}
24 changes: 24 additions & 0 deletions modules/azurerm/Logic-App-Action-HTTP/output.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------

output "name" {
depends_on = [azurerm_logic_app_action_http.logic_app_action_http]
value = azurerm_logic_app_action_http.logic_app_action_http.name
}
61 changes: 61 additions & 0 deletions modules/azurerm/Logic-App-Action-HTTP/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------

variable "abbreviation" {
description = "Logic app action http abbreviation to be used in the resource name"
type = string
default = "lgaw-ac-http"
}

variable "name" {
description = "Name of the HTTP Action to be created within the Logic App Workflow"
type = string
}

variable "logic_app_id" {
description = "The ID of the Logic App Workflow"
type = string
}

variable "method" {
description = "The HTTP Method which should be used for the HTTP Action"
type = string
}

variable "uri" {
description = "The URI which will be called when the HTTP Action is triggered"
type = string
}

variable "body" {
description = "The HTTP Body that should be sent to the uri when this HTTP Action is triggered"
type = string
}

variable "headers" {
description = "A map of Key-Value Pairs that should be sent to the uri when this HTTP Action is triggered"
type = map(string)
}

variable "queries" {
description = "Map of Key-Value Pairs that should be sent to the uri when this HTTP Action is triggered"
type = map(string)
default = null
}
29 changes: 29 additions & 0 deletions modules/azurerm/Logic-App-Action-HTTP/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------

terraform {
required_version = ">= 0.14.10"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.52.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------

resource "azurerm_logic_app_trigger_http_request" "logic_app_trigger_http_request" {
name = join("-", [var.abbreviation, var.name])
logic_app_id = var.logic_app_id
schema = var.schema
}
29 changes: 29 additions & 0 deletions modules/azurerm/Logic-App-Trigger-HTTP-Request/output.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------

output "name" {
depends_on = [azurerm_logic_app_trigger_http_request.logic_app_trigger_http_request]
value = azurerm_logic_app_trigger_http_request.logic_app_trigger_http_request.name
}

output "callback_url" {
depends_on = [azurerm_logic_app_trigger_http_request.logic_app_trigger_http_request]
value = azurerm_logic_app_trigger_http_request.logic_app_trigger_http_request.callback_url
}
41 changes: 41 additions & 0 deletions modules/azurerm/Logic-App-Trigger-HTTP-Request/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------

variable "abbreviation" {
description = "Logic app trigger http request abbreviation to be used in the resource name"
type = string
default = "lgaw-trig-http"
}

variable "name" {
description = "Name of the Azure Logic App HTTP Requset Trigger"
type = string
}

variable "logic_app_id" {
description = "The Logic App Workflow ID"
type = string
}

variable "schema" {
description = "JSON blob defining the Schema of the incoming request"
type = string
default = "{}"
}
29 changes: 29 additions & 0 deletions modules/azurerm/Logic-App-Trigger-HTTP-Request/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------

terraform {
required_version = ">= 0.14.10"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.52.0"
}
}
}
25 changes: 25 additions & 0 deletions modules/azurerm/Logic-App-Workflow/logic_app_workflow.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------

resource "azurerm_logic_app_workflow" "logic_app_workflow" {
name = join("-", [var.abbreviation, var.name])
location = var.location
resource_group_name = var.resource_group_name
}
29 changes: 29 additions & 0 deletions modules/azurerm/Logic-App-Workflow/output.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------

output "name" {
depends_on = [azurerm_logic_app_workflow.logic_app_workflow]
value = azurerm_logic_app_workflow.logic_app_workflow.name
}

output "id" {
depends_on = [azurerm_logic_app_workflow.logic_app_workflow]
value = azurerm_logic_app_workflow.logic_app_workflow.id
}
40 changes: 40 additions & 0 deletions modules/azurerm/Logic-App-Workflow/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------


variable "abbreviation" {
description = "Logic app workflow abbreviation to be used in the resource name"
type = string
default = "lgaw"
}
variable "name" {
description = "Name of the Azure Logic App Workflow"
type = string
}

variable "location" {
description = "The location of the resource need to be created"
type = string
}

variable "resource_group_name" {
description = "Name of the resource group in which the Azure Logic App Workflow will be created"
type = string
}
Loading

0 comments on commit 43d1b42

Please sign in to comment.