-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from ruwinrmrrr/main-116-1
Add logic app workflow, http request trigger and http action modules
- Loading branch information
Showing
12 changed files
with
390 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
modules/azurerm/Logic-App-Action-HTTP/logic_app_action_http.tf
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,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 | ||
} |
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,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 | ||
} |
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,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 | ||
} |
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,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
25
modules/azurerm/Logic-App-Trigger-HTTP-Request/logic_app_trigger_http_request.tf
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,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 | ||
} |
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,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
41
modules/azurerm/Logic-App-Trigger-HTTP-Request/variables.tf
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,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
29
modules/azurerm/Logic-App-Trigger-HTTP-Request/versions.tf
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,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" | ||
} | ||
} | ||
} |
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,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 | ||
} |
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,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 | ||
} |
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,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 | ||
} |
Oops, something went wrong.