From 67c93aa62615fa0f93f697457308c4241c39fa04 Mon Sep 17 00:00:00 2001 From: anshikanigam15 <92734361+anshikanigam15@users.noreply.github.com> Date: Fri, 29 Apr 2022 14:40:54 +0100 Subject: [PATCH 01/35] Update demo.tfvars --- demo.tfvars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo.tfvars b/demo.tfvars index d2726e5..a8deca4 100644 --- a/demo.tfvars +++ b/demo.tfvars @@ -1 +1 @@ -api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","5E61678A6AC76C2E92F26D1F4AF3D8A327E0D2CE","68EDF481C5394D65962E9810913455D3EC635FA5","B1C45E55A1E93AD43A473972CFF490722EEF1E38","F7C2AB80CFA2721DB41490DC31325977AAA034FE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B49BDDE7818B78058AC7401BE0284A40845031E3"] +api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","5E61678A6AC76C2E92F26D1F4AF3D8A327E0D2CE","68EDF481C5394D65962E9810913455D3EC635FA5","B1C45E55A1E93AD43A473972CFF490722EEF1E38","F7C2AB80CFA2721DB41490DC31325977AAA034FE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B49BDDE7818B78058AC7401BE0284A40845031E3","D36AC5686200258AE7C03CCCA70E14B69C17F94B"] From 21290fc7476a513107711f97c827dbf8562b5ab7 Mon Sep 17 00:00:00 2001 From: anshikanigam15 <92734361+anshikanigam15@users.noreply.github.com> Date: Tue, 3 May 2022 09:31:23 +0100 Subject: [PATCH 02/35] Update main.tf --- main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/main.tf b/main.tf index 714aa5b..08b4a04 100644 --- a/main.tf +++ b/main.tf @@ -42,6 +42,7 @@ module "api_mgmt_api" { api_mgmt_rg = local.api_mgmt_rg product_id = module.api_mgmt_product.product_id path = local.api_base_path + protocols = ["http", "https"] service_url = local.payments_api_url swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.recon-payments.json" revision = "1" From cb749981393628ae5902ce7ba42d79db1aa0eadf Mon Sep 17 00:00:00 2001 From: anshikanigam15 <92734361+anshikanigam15@users.noreply.github.com> Date: Tue, 3 May 2022 09:50:23 +0100 Subject: [PATCH 03/35] Update main.tf --- main.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/main.tf b/main.tf index 08b4a04..714aa5b 100644 --- a/main.tf +++ b/main.tf @@ -42,7 +42,6 @@ module "api_mgmt_api" { api_mgmt_rg = local.api_mgmt_rg product_id = module.api_mgmt_product.product_id path = local.api_base_path - protocols = ["http", "https"] service_url = local.payments_api_url swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.recon-payments.json" revision = "1" From 0cfae7c30bf1fb4b6e5400739d24d5211c76d7d6 Mon Sep 17 00:00:00 2001 From: pats-john <13101669+pats-john@users.noreply.github.com> Date: Tue, 3 May 2022 16:06:28 +0100 Subject: [PATCH 04/35] Update demo.tfvars --- demo.tfvars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo.tfvars b/demo.tfvars index a8deca4..4ef74e9 100644 --- a/demo.tfvars +++ b/demo.tfvars @@ -1 +1 @@ -api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","5E61678A6AC76C2E92F26D1F4AF3D8A327E0D2CE","68EDF481C5394D65962E9810913455D3EC635FA5","B1C45E55A1E93AD43A473972CFF490722EEF1E38","F7C2AB80CFA2721DB41490DC31325977AAA034FE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B49BDDE7818B78058AC7401BE0284A40845031E3","D36AC5686200258AE7C03CCCA70E14B69C17F94B"] +api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","5E61678A6AC76C2E92F26D1F4AF3D8A327E0D2CE","68EDF481C5394D65962E9810913455D3EC635FA5","B1C45E55A1E93AD43A473972CFF490722EEF1E38","F7C2AB80CFA2721DB41490DC31325977AAA034FE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B49BDDE7818B78058AC7401BE0284A40845031E3","D36AC5686200258AE7C03CCCA70E14B69C17F94B","C6E2FBAB5FED58FD86C10A3BD212CF44668FD1A3"] From ccd04d7a0df7d81d61ff1f39c2cb32464aa4ede7 Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Tue, 10 May 2022 11:56:49 +0100 Subject: [PATCH 05/35] certificate thumbnail --- aat.tfvars | 2 +- demo.tfvars | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aat.tfvars b/aat.tfvars index e7115b4..d232da3 100644 --- a/aat.tfvars +++ b/aat.tfvars @@ -1 +1 @@ -api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","B1C45E55A1E93AD43A473972CFF490722EEF1E38","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B49BDDE7818B78058AC7401BE0284A40845031E3","E5F54E7BA2B780E2B1B1FFAC68F801251935BE80"] +api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","B1C45E55A1E93AD43A473972CFF490722EEF1E38","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B49BDDE7818B78058AC7401BE0284A40845031E3","E5F54E7BA2B780E2B1B1FFAC68F801251935BE80","F46DF3FF3FD3AC664C20BF0F958D62E831C043FD","156E40AA1013B3B675B202602C10F7ED6B9C6E0A"] diff --git a/demo.tfvars b/demo.tfvars index d2726e5..4926e35 100644 --- a/demo.tfvars +++ b/demo.tfvars @@ -1 +1 @@ -api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","5E61678A6AC76C2E92F26D1F4AF3D8A327E0D2CE","68EDF481C5394D65962E9810913455D3EC635FA5","B1C45E55A1E93AD43A473972CFF490722EEF1E38","F7C2AB80CFA2721DB41490DC31325977AAA034FE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B49BDDE7818B78058AC7401BE0284A40845031E3"] +api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","5E61678A6AC76C2E92F26D1F4AF3D8A327E0D2CE","68EDF481C5394D65962E9810913455D3EC635FA5","B1C45E55A1E93AD43A473972CFF490722EEF1E38","F7C2AB80CFA2721DB41490DC31325977AAA034FE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B49BDDE7818B78058AC7401BE0284A40845031E3","F46DF3FF3FD3AC664C20BF0F958D62E831C043FD","156E40AA1013B3B675B202602C10F7ED6B9C6E0A"] \ No newline at end of file From 382e1a3ea287f94eda28b96f0c137e689d715aac Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Tue, 10 May 2022 12:20:34 +0100 Subject: [PATCH 06/35] certificate thumbnail --- demo.tfvars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo.tfvars b/demo.tfvars index 4ef74e9..43b167d 100644 --- a/demo.tfvars +++ b/demo.tfvars @@ -1 +1 @@ -api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","5E61678A6AC76C2E92F26D1F4AF3D8A327E0D2CE","68EDF481C5394D65962E9810913455D3EC635FA5","B1C45E55A1E93AD43A473972CFF490722EEF1E38","F7C2AB80CFA2721DB41490DC31325977AAA034FE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B49BDDE7818B78058AC7401BE0284A40845031E3","D36AC5686200258AE7C03CCCA70E14B69C17F94B","C6E2FBAB5FED58FD86C10A3BD212CF44668FD1A3"] +api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","5E61678A6AC76C2E92F26D1F4AF3D8A327E0D2CE","68EDF481C5394D65962E9810913455D3EC635FA5","B1C45E55A1E93AD43A473972CFF490722EEF1E38","F7C2AB80CFA2721DB41490DC31325977AAA034FE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B49BDDE7818B78058AC7401BE0284A40845031E3","D36AC5686200258AE7C03CCCA70E14B69C17F94B","C6E2FBAB5FED58FD86C10A3BD212CF44668FD1A3","F46DF3FF3FD3AC664C20BF0F958D62E831C043FD","156E40AA1013B3B675B202602C10F7ED6B9C6E0A"] From 97ccbb27745e2518340ca871c1dc0113f04994b1 Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Wed, 11 May 2022 14:48:37 +0100 Subject: [PATCH 07/35] product&API added --- main.tf | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/main.tf b/main.tf index 714aa5b..6cf8d90 100644 --- a/main.tf +++ b/main.tf @@ -10,6 +10,14 @@ locals { # list of the thumbprints of the SSL certificates that should be accepted by the API (gateway) thumbprints_in_quotes = formatlist("\"%s\"", var.api_gateway_test_certificate_thumbprints) thumbprints_in_quotes_str = join(",", local.thumbprints_in_quotes) + + core_product_vaultName = join("-", [var.core_product, var.env]) + api_mgmt_name_cft = join("-", ["cft-api-mgmt", var.env]) + api_mgmt_rg_cft = join("-", ["cft", var.env, "network-rg"]) + s2s_rg_prefix = "rpe-service-auth-provider" + s2s_key_vault_name = var.env == "preview" || var.env == "spreview" ? join("-", ["s2s", "aat"]) : join("-", ["s2s", var.env]) + s2s_vault_resource_group = var.env == "preview" || var.env == "spreview" ? join("-", [local.s2s_rg_prefix, "aat"]) : join("-", [local.s2s_rg_prefix, var.env]) + } data "azurerm_key_vault" "payment_key_vault" { @@ -65,3 +73,70 @@ module "api_mgmt_policy" { api_name = module.api_mgmt_api.name api_policy_xml_content = data.template_file.policy_template.rendered } + +module "ccpay-payment-product" { + source = "git@github.com:hmcts/cnp-module-api-mgmt-product?ref=master" + api_mgmt_name = local.api_mgmt_name_cft + api_mgmt_rg = local.api_mgmt_rg_cft + name = var.product_name + product_access_control_groups = ["developers"] + + providers = { + azurerm = azurerm.cftappsdemo + } +} + +module "ccpay-payment-api" { + source = "git@github.com:hmcts/cnp-module-api-mgmt-api?ref=master" + + api_mgmt_name = local.api_mgmt_name_cft + api_mgmt_rg = local.api_mgmt_rg_cft + revision = "1" + service_url = local.payments_api_url + product_id = module.api_mgmt_product.product_id + name = join("-", [var.product_name, "apiList"]) + protocols = ["https"] + display_name = "Payments API" + path = local.api_base_path + swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.freg_api.json" + + providers = { + azurerm = azurerm.cftappsdemo + } +} + +data "template_file" "payment_policy_template" { + template = file(join("", [path.module, "/template/api-policy.xml"])) + vars = { + allowed_certificate_thumbprints = local.thumbprints_in_quotes_str + s2s_client_id = data.azurerm_key_vault_secret.s2s_client_id.value + s2s_client_secret = data.azurerm_key_vault_secret.s2s_client_secret.value + s2s_base_url = local.s2sUrl + } +} + +module "ccpay-payment-policy" { + source = "git@github.com:hmcts/cnp-module-api-mgmt-api-policy?ref=master" + + api_mgmt_name = local.api_mgmt_name_cft + api_mgmt_rg = local.api_mgmt_rg_cft + + api_name = module.api_mgmt_api.name + api_policy_xml_content = data.template_file.policy_template.rendered + + providers = { + azurerm = azurerm.cftappsdemo + } +} + +data "azurerm_api_management_product" "payment" { + product_id = module.ccpay-payment-product.product_id + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + provider = azurerm.cftappsdemo +} + +data "azurerm_key_vault" "s2s_key_vault" { + name = local.s2s_key_vault_name + resource_group_name = local.s2s_vault_resource_group +} \ No newline at end of file From c8d63cec11eae2bbb45211962a31cf45c30addf4 Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Thu, 12 May 2022 11:12:39 +0100 Subject: [PATCH 08/35] product&API added --- main.tf | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/main.tf b/main.tf index 6cf8d90..d4fb935 100644 --- a/main.tf +++ b/main.tf @@ -14,10 +14,6 @@ locals { core_product_vaultName = join("-", [var.core_product, var.env]) api_mgmt_name_cft = join("-", ["cft-api-mgmt", var.env]) api_mgmt_rg_cft = join("-", ["cft", var.env, "network-rg"]) - s2s_rg_prefix = "rpe-service-auth-provider" - s2s_key_vault_name = var.env == "preview" || var.env == "spreview" ? join("-", ["s2s", "aat"]) : join("-", ["s2s", var.env]) - s2s_vault_resource_group = var.env == "preview" || var.env == "spreview" ? join("-", [local.s2s_rg_prefix, "aat"]) : join("-", [local.s2s_rg_prefix, var.env]) - } data "azurerm_key_vault" "payment_key_vault" { @@ -105,16 +101,6 @@ module "ccpay-payment-api" { } } -data "template_file" "payment_policy_template" { - template = file(join("", [path.module, "/template/api-policy.xml"])) - vars = { - allowed_certificate_thumbprints = local.thumbprints_in_quotes_str - s2s_client_id = data.azurerm_key_vault_secret.s2s_client_id.value - s2s_client_secret = data.azurerm_key_vault_secret.s2s_client_secret.value - s2s_base_url = local.s2sUrl - } -} - module "ccpay-payment-policy" { source = "git@github.com:hmcts/cnp-module-api-mgmt-api-policy?ref=master" @@ -134,9 +120,4 @@ data "azurerm_api_management_product" "payment" { api_management_name = local.api_mgmt_name_cft resource_group_name = local.api_mgmt_rg_cft provider = azurerm.cftappsdemo -} - -data "azurerm_key_vault" "s2s_key_vault" { - name = local.s2s_key_vault_name - resource_group_name = local.s2s_vault_resource_group } \ No newline at end of file From 25801d4ee261eec430fe0b29518901d35d00fa6c Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Thu, 12 May 2022 15:45:49 +0100 Subject: [PATCH 09/35] product&API added --- main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index d4fb935..ce339b7 100644 --- a/main.tf +++ b/main.tf @@ -89,12 +89,12 @@ module "ccpay-payment-api" { api_mgmt_rg = local.api_mgmt_rg_cft revision = "1" service_url = local.payments_api_url - product_id = module.api_mgmt_product.product_id + product_id = module.ccpay-payment-product.product_id name = join("-", [var.product_name, "apiList"]) protocols = ["https"] display_name = "Payments API" path = local.api_base_path - swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.freg_api.json" + swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.status.json" providers = { azurerm = azurerm.cftappsdemo From b32513dfa79ca1e2f7003b9867530d8d775f27c7 Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Thu, 12 May 2022 17:40:41 +0100 Subject: [PATCH 10/35] api gateway impl --- terraform.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform.tf b/terraform.tf index 8144f8d..59f266c 100644 --- a/terraform.tf +++ b/terraform.tf @@ -1,4 +1,5 @@ provider "azurerm" { + alias = "cftappsdemo" features {} } From cc8ca0a88b8d402987ccd7a8c9e372b6de3be43d Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Fri, 13 May 2022 08:59:08 +0100 Subject: [PATCH 11/35] api gateway impl --- main.tf | 5 +++++ terraform.tf | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index ce339b7..4ef673a 100644 --- a/main.tf +++ b/main.tf @@ -1,3 +1,8 @@ +provider "azurerm" { + alias = "cftappsdemo" + features {} +} + locals { api_mgmt_name = join("-", ["core-api-mgmt", var.env]) api_mgmt_rg = join("-", ["core-infra", var.env]) diff --git a/terraform.tf b/terraform.tf index 59f266c..8144f8d 100644 --- a/terraform.tf +++ b/terraform.tf @@ -1,5 +1,4 @@ provider "azurerm" { - alias = "cftappsdemo" features {} } From dcedf0654d32500ff2cca17930ee83140fcd7a82 Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Fri, 13 May 2022 09:08:35 +0100 Subject: [PATCH 12/35] api gateway impl --- main.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/main.tf b/main.tf index 4ef673a..07025dd 100644 --- a/main.tf +++ b/main.tf @@ -16,7 +16,6 @@ locals { thumbprints_in_quotes = formatlist("\"%s\"", var.api_gateway_test_certificate_thumbprints) thumbprints_in_quotes_str = join(",", local.thumbprints_in_quotes) - core_product_vaultName = join("-", [var.core_product, var.env]) api_mgmt_name_cft = join("-", ["cft-api-mgmt", var.env]) api_mgmt_rg_cft = join("-", ["cft", var.env, "network-rg"]) } From ee21eb7e49dba14f87beab0b82bd18d419b8949f Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Fri, 13 May 2022 09:28:21 +0100 Subject: [PATCH 13/35] api gateway impl --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 07025dd..85d5dd3 100644 --- a/main.tf +++ b/main.tf @@ -119,7 +119,7 @@ module "ccpay-payment-policy" { } } -data "azurerm_api_management_product" "payment" { +data "azurerm_api_management_product" "payments" { product_id = module.ccpay-payment-product.product_id api_management_name = local.api_mgmt_name_cft resource_group_name = local.api_mgmt_rg_cft From 9e0920636a394fc3856a746e8647ef645633d1af Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Fri, 13 May 2022 09:43:19 +0100 Subject: [PATCH 14/35] api gateway impl --- main.tf | 7 ------- 1 file changed, 7 deletions(-) diff --git a/main.tf b/main.tf index 85d5dd3..93ce1e6 100644 --- a/main.tf +++ b/main.tf @@ -118,10 +118,3 @@ module "ccpay-payment-policy" { azurerm = azurerm.cftappsdemo } } - -data "azurerm_api_management_product" "payments" { - product_id = module.ccpay-payment-product.product_id - api_management_name = local.api_mgmt_name_cft - resource_group_name = local.api_mgmt_rg_cft - provider = azurerm.cftappsdemo -} \ No newline at end of file From 5a1018bd11dcfc1bb3faa5a0f3c9f5426c543a91 Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Fri, 13 May 2022 16:30:34 +0100 Subject: [PATCH 15/35] api gateway impl --- main.tf | 1 - terraform.tf | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 93ce1e6..0f13abf 100644 --- a/main.tf +++ b/main.tf @@ -1,5 +1,4 @@ provider "azurerm" { - alias = "cftappsdemo" features {} } diff --git a/terraform.tf b/terraform.tf index 8144f8d..65aaafe 100644 --- a/terraform.tf +++ b/terraform.tf @@ -1,5 +1,7 @@ provider "azurerm" { + alias = "cftappsdemo" features {} + subscription_id = "d025fece-ce99-4df2-b7a9-b649d3ff2060" } terraform { From 3cea9e1cbfe11076d926cccac4f125c740325522 Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Mon, 16 May 2022 10:36:48 +0100 Subject: [PATCH 16/35] api gateway impl --- main.tf | 3 +++ variables.tf | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 0f13abf..3497923 100644 --- a/main.tf +++ b/main.tf @@ -98,6 +98,9 @@ module "ccpay-payment-api" { display_name = "Payments API" path = local.api_base_path swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.status.json" + import { + content_format = var.open_api_spec_content_format + } providers = { azurerm = azurerm.cftappsdemo diff --git a/variables.tf b/variables.tf index de98eb1..c6929a8 100644 --- a/variables.tf +++ b/variables.tf @@ -34,4 +34,9 @@ variable "api_gateway_test_certificate_thumbprints" { variable "common_tags" { type = map(string) -} \ No newline at end of file +} + +variable "open_api_spec_content_format" { + type = openapi + description = "The format of the content from which the API Definition should be imported. Possible values are: openapi, openapi+json, openapi+json-link, openapi-link, swagger-json, swagger-link-json, wadl-link-json, wadl-xml, wsdl and wsdl-link." +} From 896a618e641b1f9d8ac3cf661263a210c3a98cfb Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Mon, 16 May 2022 16:12:11 +0100 Subject: [PATCH 17/35] api gateway impl --- main.tf | 4 ++-- variables.tf | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/main.tf b/main.tf index 3497923..1001d2d 100644 --- a/main.tf +++ b/main.tf @@ -97,9 +97,9 @@ module "ccpay-payment-api" { protocols = ["https"] display_name = "Payments API" path = local.api_base_path - swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.status.json" import { - content_format = var.open_api_spec_content_format + content_format = "openapi-link" + content_value = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.status.json" } providers = { diff --git a/variables.tf b/variables.tf index c6929a8..27dffe7 100644 --- a/variables.tf +++ b/variables.tf @@ -35,8 +35,3 @@ variable "api_gateway_test_certificate_thumbprints" { variable "common_tags" { type = map(string) } - -variable "open_api_spec_content_format" { - type = openapi - description = "The format of the content from which the API Definition should be imported. Possible values are: openapi, openapi+json, openapi+json-link, openapi-link, swagger-json, swagger-link-json, wadl-link-json, wadl-xml, wsdl and wsdl-link." -} From 60ba7f70e8425b36058209023996603ff90a6fda Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Mon, 16 May 2022 17:20:11 +0100 Subject: [PATCH 18/35] api gateway impl --- main.tf | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/main.tf b/main.tf index 1001d2d..0f13abf 100644 --- a/main.tf +++ b/main.tf @@ -97,10 +97,7 @@ module "ccpay-payment-api" { protocols = ["https"] display_name = "Payments API" path = local.api_base_path - import { - content_format = "openapi-link" - content_value = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.status.json" - } + swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.status.json" providers = { azurerm = azurerm.cftappsdemo From 88a9a092182f181ba8b4d487f1a9d8c0e3042de9 Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Wed, 18 May 2022 09:44:42 +0100 Subject: [PATCH 19/35] policy change --- main.tf | 2 +- variables.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index 0f13abf..95ab8d5 100644 --- a/main.tf +++ b/main.tf @@ -110,7 +110,7 @@ module "ccpay-payment-policy" { api_mgmt_name = local.api_mgmt_name_cft api_mgmt_rg = local.api_mgmt_rg_cft - api_name = module.api_mgmt_api.name + api_name = module.ccpay-payment-api.name api_policy_xml_content = data.template_file.policy_template.rendered providers = { diff --git a/variables.tf b/variables.tf index 27dffe7..de98eb1 100644 --- a/variables.tf +++ b/variables.tf @@ -34,4 +34,4 @@ variable "api_gateway_test_certificate_thumbprints" { variable "common_tags" { type = map(string) -} +} \ No newline at end of file From 6cd864eb0c703683fb57b2af631b8f838ba868d8 Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Thu, 19 May 2022 16:15:46 +0100 Subject: [PATCH 20/35] file name update --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 95ab8d5..3d0d2ee 100644 --- a/main.tf +++ b/main.tf @@ -97,7 +97,7 @@ module "ccpay-payment-api" { protocols = ["https"] display_name = "Payments API" path = local.api_base_path - swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.status.json" + swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.payment-status.json" providers = { azurerm = azurerm.cftappsdemo From e96a2233fd107b787e03d356c8efae146b294522 Mon Sep 17 00:00:00 2001 From: anshikanigam15 <92734361+anshikanigam15@users.noreply.github.com> Date: Fri, 20 May 2022 12:14:01 +0100 Subject: [PATCH 21/35] Update main.tf --- main.tf | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/main.tf b/main.tf index 3d0d2ee..d11ba90 100644 --- a/main.tf +++ b/main.tf @@ -84,6 +84,13 @@ module "ccpay-payment-product" { azurerm = azurerm.cftappsdemo } } + + data "azurerm_api_management_product" "paymentcft" { + product_id = module.ccpay-payment-product.product_id + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + provider = azurerm.cftappsdemo +} module "ccpay-payment-api" { source = "git@github.com:hmcts/cnp-module-api-mgmt-api?ref=master" @@ -116,4 +123,52 @@ module "ccpay-payment-policy" { providers = { azurerm = azurerm.cftappsdemo } + + +resource "azurerm_api_management_user" "payment_Ranjeet" { + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + user_id = "5931a75ae4bbd512288c990c" + first_name = "Ranjeet" + last_name = "Kumar" + email = "ranjeet.kumar@hmcts.net" + state = "active" + + provider = azurerm.cftappsdemo +} + +resource "azurerm_api_management_subscription" "Ranjeet_sub_payment" { + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + user_id = azurerm_api_management_user.payment_Ranjeet.id + product_id = data.azurerm_api_management_product.paymentcft.id + display_name = "payment Subscription ranjeet" + state = "active" + + provider = azurerm.cftappsdemo +} + + +resource "azurerm_api_management_user" "payment_sayali" { + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + user_id = "5931a75ae4bbd512288c790c" + first_name = "Sayali" + last_name = "Salunkhe" + email = "sayali.salunkhe@hmcts.net" + state = "active" + + provider = azurerm.cftappsdemo +} + +resource "azurerm_api_management_subscription" "sayali_sub_payment" { + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + user_id = azurerm_api_management_user.payment_sayali.id + product_id = data.azurerm_api_management_product.paymentcft.id + display_name = "payment Subscription sayali" + state = "active" + + provider = azurerm.cftappsdemo +} } From e491e8922a62c0876e6558dc835476d8a7906291 Mon Sep 17 00:00:00 2001 From: anshikanigam15 <92734361+anshikanigam15@users.noreply.github.com> Date: Fri, 20 May 2022 12:19:53 +0100 Subject: [PATCH 22/35] Update main.tf --- main.tf | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/main.tf b/main.tf index d11ba90..3b03cda 100644 --- a/main.tf +++ b/main.tf @@ -137,38 +137,4 @@ resource "azurerm_api_management_user" "payment_Ranjeet" { provider = azurerm.cftappsdemo } -resource "azurerm_api_management_subscription" "Ranjeet_sub_payment" { - api_management_name = local.api_mgmt_name_cft - resource_group_name = local.api_mgmt_rg_cft - user_id = azurerm_api_management_user.payment_Ranjeet.id - product_id = data.azurerm_api_management_product.paymentcft.id - display_name = "payment Subscription ranjeet" - state = "active" - - provider = azurerm.cftappsdemo -} - - -resource "azurerm_api_management_user" "payment_sayali" { - api_management_name = local.api_mgmt_name_cft - resource_group_name = local.api_mgmt_rg_cft - user_id = "5931a75ae4bbd512288c790c" - first_name = "Sayali" - last_name = "Salunkhe" - email = "sayali.salunkhe@hmcts.net" - state = "active" - - provider = azurerm.cftappsdemo -} - -resource "azurerm_api_management_subscription" "sayali_sub_payment" { - api_management_name = local.api_mgmt_name_cft - resource_group_name = local.api_mgmt_rg_cft - user_id = azurerm_api_management_user.payment_sayali.id - product_id = data.azurerm_api_management_product.paymentcft.id - display_name = "payment Subscription sayali" - state = "active" - - provider = azurerm.cftappsdemo -} -} + From c64abaf23f372828c53696a37ac8cfe38bb0949d Mon Sep 17 00:00:00 2001 From: anshikanigam15 <92734361+anshikanigam15@users.noreply.github.com> Date: Fri, 20 May 2022 12:21:08 +0100 Subject: [PATCH 23/35] Update main.tf --- main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/main.tf b/main.tf index 3b03cda..591773a 100644 --- a/main.tf +++ b/main.tf @@ -123,6 +123,7 @@ module "ccpay-payment-policy" { providers = { azurerm = azurerm.cftappsdemo } + } resource "azurerm_api_management_user" "payment_Ranjeet" { From 87986809b94dfec10a1f2664e75b6497520f8e1c Mon Sep 17 00:00:00 2001 From: anshikanigam15 <92734361+anshikanigam15@users.noreply.github.com> Date: Fri, 20 May 2022 12:24:58 +0100 Subject: [PATCH 24/35] Update main.tf --- main.tf | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 591773a..210af35 100644 --- a/main.tf +++ b/main.tf @@ -137,5 +137,52 @@ resource "azurerm_api_management_user" "payment_Ranjeet" { provider = azurerm.cftappsdemo } - +resource "azurerm_api_management_user" "payment_sayali" { + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + user_id = "5931a75ae4bbd512288c790c" + first_name = "Sayali" + last_name = "Salunkhe" + email = "sayali.salunkhe@hmcts.net" + state = "active" + provider = azurerm.cftappsdemo +} + + resource "azurerm_api_management_subscription" "sayali_sub_payment" { + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + user_id = azurerm_api_management_user.payment_sayali.id + product_id = data.azurerm_api_management_product.paymentcft.id + display_name = "payment Subscription sayali" + state = "active" + provider = azurerm.cftappsdemo +} + + resource "azurerm_api_management_subscription" "Ranjeet_sub_payment" { + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + user_id = azurerm_api_management_user.payment_Ranjeet.id + product_id = data.azurerm_api_management_product.paymentcft.id + display_name = "payment Subscription ranjeet" + state = "active" + provider = azurerm.cftappsdemo +} + + data "azurerm_api_management_user" "anshika" { + user_id = "5931a75ae4bbd512288c680b" + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + provider = azurerm.cftappsdemo +} + + + resource "azurerm_api_management_subscription" "anshika_sub" { + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + user_id = data.azurerm_api_management_user.anshika.id + product_id = data.azurerm_api_management_product.paymentcft.id + display_name = "Payment Subscription" + state = "active" + provider = azurerm.cftappsdemo +} From e041cab6243e4dc0fb3f89e49c74df46002e07f3 Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <93199005+ranjeet-kumarhmcts@users.noreply.github.com> Date: Mon, 23 May 2022 10:29:50 +0100 Subject: [PATCH 25/35] Update demo.tfvars --- demo.tfvars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo.tfvars b/demo.tfvars index 43b167d..83b6ed6 100644 --- a/demo.tfvars +++ b/demo.tfvars @@ -1 +1 @@ -api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","5E61678A6AC76C2E92F26D1F4AF3D8A327E0D2CE","68EDF481C5394D65962E9810913455D3EC635FA5","B1C45E55A1E93AD43A473972CFF490722EEF1E38","F7C2AB80CFA2721DB41490DC31325977AAA034FE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B49BDDE7818B78058AC7401BE0284A40845031E3","D36AC5686200258AE7C03CCCA70E14B69C17F94B","C6E2FBAB5FED58FD86C10A3BD212CF44668FD1A3","F46DF3FF3FD3AC664C20BF0F958D62E831C043FD","156E40AA1013B3B675B202602C10F7ED6B9C6E0A"] +api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","5E61678A6AC76C2E92F26D1F4AF3D8A327E0D2CE","68EDF481C5394D65962E9810913455D3EC635FA5","B1C45E55A1E93AD43A473972CFF490722EEF1E38","F7C2AB80CFA2721DB41490DC31325977AAA034FE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B49BDDE7818B78058AC7401BE0284A40845031E3","D36AC5686200258AE7C03CCCA70E14B69C17F94B","C6E2FBAB5FED58FD86C10A3BD212CF44668FD1A3","F46DF3FF3FD3AC664C20BF0F958D62E831C043FD","156E40AA1013B3B675B202602C10F7ED6B9C6E0A","865DA26A413AED2D83CE1F7F70AAC1532A148058"] From b67b15eaab4ff08553bb399486fd4e78d79cffb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csayali-salunkhe=E2=80=9D?= <“sayali.salunkhe@HMCTS.net”> Date: Mon, 23 May 2022 11:13:43 +0100 Subject: [PATCH 26/35] PAY-5556 & PAY-5558 added activation keys --- demo.tfvars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo.tfvars b/demo.tfvars index 43b167d..031ab14 100644 --- a/demo.tfvars +++ b/demo.tfvars @@ -1 +1 @@ -api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","5E61678A6AC76C2E92F26D1F4AF3D8A327E0D2CE","68EDF481C5394D65962E9810913455D3EC635FA5","B1C45E55A1E93AD43A473972CFF490722EEF1E38","F7C2AB80CFA2721DB41490DC31325977AAA034FE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B49BDDE7818B78058AC7401BE0284A40845031E3","D36AC5686200258AE7C03CCCA70E14B69C17F94B","C6E2FBAB5FED58FD86C10A3BD212CF44668FD1A3","F46DF3FF3FD3AC664C20BF0F958D62E831C043FD","156E40AA1013B3B675B202602C10F7ED6B9C6E0A"] +api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","5E61678A6AC76C2E92F26D1F4AF3D8A327E0D2CE","68EDF481C5394D65962E9810913455D3EC635FA5","B1C45E55A1E93AD43A473972CFF490722EEF1E38","F7C2AB80CFA2721DB41490DC31325977AAA034FE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B49BDDE7818B78058AC7401BE0284A40845031E3","D36AC5686200258AE7C03CCCA70E14B69C17F94B","C6E2FBAB5FED58FD86C10A3BD212CF44668FD1A3","F46DF3FF3FD3AC664C20BF0F958D62E831C043FD","156E40AA1013B3B675B202602C10F7ED6B9C6E0A","f397f389e584407985df065562ce4835","57c15a76bebc4427976e45b1f38f9623"] From 638357dfcd82f10a6746d13211be6e2408629089 Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Mon, 23 May 2022 15:03:54 +0100 Subject: [PATCH 27/35] user amd subd added --- main.tf | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/main.tf b/main.tf index 210af35..77dd8d7 100644 --- a/main.tf +++ b/main.tf @@ -185,4 +185,25 @@ resource "azurerm_api_management_user" "payment_sayali" { state = "active" provider = azurerm.cftappsdemo } + +resource "azurerm_api_management_user" "payment_Vamshi" { + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + user_id = "5931a75ae4bbd512288c991c" + first_name = "Vamshi" + last_name = "Rudrabhatla" + email = "vamshi.rudrabhatla@HMCTS.NET" + state = "active" + + provider = azurerm.cftappsdemo +} +resource "azurerm_api_management_subscription" "Vamshi_sub_payment" { + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + user_id = azurerm_api_management_user.payment_Vamshi.id + product_id = data.azurerm_api_management_product.paymentcft.id + display_name = "payment Subscription Vamshi" + state = "active" + provider = azurerm.cftappsdemo +} \ No newline at end of file From d3c50fac018c2e6be9e0026ad8fe8dd32fb011e6 Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Mon, 23 May 2022 15:20:31 +0100 Subject: [PATCH 28/35] user amd subd added --- main.tf | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/main.tf b/main.tf index 77dd8d7..99e7d8f 100644 --- a/main.tf +++ b/main.tf @@ -189,12 +189,7 @@ resource "azurerm_api_management_user" "payment_sayali" { resource "azurerm_api_management_user" "payment_Vamshi" { api_management_name = local.api_mgmt_name_cft resource_group_name = local.api_mgmt_rg_cft - user_id = "5931a75ae4bbd512288c991c" - first_name = "Vamshi" - last_name = "Rudrabhatla" - email = "vamshi.rudrabhatla@HMCTS.NET" - state = "active" - + user_id = "5931a75ae4bbd512288c680c" provider = azurerm.cftappsdemo } From e4bc835d8010e1e3581180e383068ee57bc9a6df Mon Sep 17 00:00:00 2001 From: ranjeet-kumarhmcts <“ranjeet.kumar@hmcts.net”> Date: Mon, 23 May 2022 15:34:36 +0100 Subject: [PATCH 29/35] user amd subd added --- main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index 99e7d8f..6ecaa39 100644 --- a/main.tf +++ b/main.tf @@ -186,7 +186,7 @@ resource "azurerm_api_management_user" "payment_sayali" { provider = azurerm.cftappsdemo } -resource "azurerm_api_management_user" "payment_Vamshi" { + data "azurerm_api_management_user" "payment_Vamshi" { api_management_name = local.api_mgmt_name_cft resource_group_name = local.api_mgmt_rg_cft user_id = "5931a75ae4bbd512288c680c" @@ -196,7 +196,7 @@ resource "azurerm_api_management_user" "payment_Vamshi" { resource "azurerm_api_management_subscription" "Vamshi_sub_payment" { api_management_name = local.api_mgmt_name_cft resource_group_name = local.api_mgmt_rg_cft - user_id = azurerm_api_management_user.payment_Vamshi.id + user_id = data.azurerm_api_management_user.payment_Vamshi.id product_id = data.azurerm_api_management_product.paymentcft.id display_name = "payment Subscription Vamshi" state = "active" From 32870a0c88469b8bb2b89bf4f4783fe735546d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csayali-salunkhe=E2=80=9D?= <“sayali.salunkhe@HMCTS.net”> Date: Thu, 7 Jul 2022 11:32:24 +0100 Subject: [PATCH 30/35] Changed swagger_url file name to ccpay-payment-app.recon-payments-v2.json --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 210af35..11cedff 100644 --- a/main.tf +++ b/main.tf @@ -50,7 +50,7 @@ module "api_mgmt_api" { product_id = module.api_mgmt_product.product_id path = local.api_base_path service_url = local.payments_api_url - swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.recon-payments.json" + swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.recon-payments-v2.json" revision = "1" } From a6a028c15b066a626371b25b9010f6dac91afc4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csayali-salunkhe=E2=80=9D?= <“sayali.salunkhe@HMCTS.net”> Date: Thu, 7 Jul 2022 17:24:29 +0100 Subject: [PATCH 31/35] Changed swagger_url file name to ccpay-payment-app.recon-payments-v1.json --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 63580c9..b91a380 100644 --- a/main.tf +++ b/main.tf @@ -50,7 +50,7 @@ module "api_mgmt_api" { product_id = module.api_mgmt_product.product_id path = local.api_base_path service_url = local.payments_api_url - swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.recon-payments-v2.json" + swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.recon-payments-v1.json" revision = "1" } From 2afb2acf11893966751e8760071562106cc18817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csayali-salunkhe=E2=80=9D?= <“sayali.salunkhe@HMCTS.net”> Date: Thu, 7 Jul 2022 18:11:55 +0100 Subject: [PATCH 32/35] Removed cft-api-mgmt changes --- main.tf | 137 --------------------------------------------------- terraform.tf | 2 - 2 files changed, 139 deletions(-) diff --git a/main.tf b/main.tf index b91a380..3c6f142 100644 --- a/main.tf +++ b/main.tf @@ -1,7 +1,3 @@ -provider "azurerm" { - features {} -} - locals { api_mgmt_name = join("-", ["core-api-mgmt", var.env]) api_mgmt_rg = join("-", ["core-infra", var.env]) @@ -14,9 +10,6 @@ locals { # list of the thumbprints of the SSL certificates that should be accepted by the API (gateway) thumbprints_in_quotes = formatlist("\"%s\"", var.api_gateway_test_certificate_thumbprints) thumbprints_in_quotes_str = join(",", local.thumbprints_in_quotes) - - api_mgmt_name_cft = join("-", ["cft-api-mgmt", var.env]) - api_mgmt_rg_cft = join("-", ["cft", var.env, "network-rg"]) } data "azurerm_key_vault" "payment_key_vault" { @@ -72,133 +65,3 @@ module "api_mgmt_policy" { api_name = module.api_mgmt_api.name api_policy_xml_content = data.template_file.policy_template.rendered } - -module "ccpay-payment-product" { - source = "git@github.com:hmcts/cnp-module-api-mgmt-product?ref=master" - api_mgmt_name = local.api_mgmt_name_cft - api_mgmt_rg = local.api_mgmt_rg_cft - name = var.product_name - product_access_control_groups = ["developers"] - - providers = { - azurerm = azurerm.cftappsdemo - } -} - - data "azurerm_api_management_product" "paymentcft" { - product_id = module.ccpay-payment-product.product_id - api_management_name = local.api_mgmt_name_cft - resource_group_name = local.api_mgmt_rg_cft - provider = azurerm.cftappsdemo -} - -module "ccpay-payment-api" { - source = "git@github.com:hmcts/cnp-module-api-mgmt-api?ref=master" - - api_mgmt_name = local.api_mgmt_name_cft - api_mgmt_rg = local.api_mgmt_rg_cft - revision = "1" - service_url = local.payments_api_url - product_id = module.ccpay-payment-product.product_id - name = join("-", [var.product_name, "apiList"]) - protocols = ["https"] - display_name = "Payments API" - path = local.api_base_path - swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.payment-status.json" - - providers = { - azurerm = azurerm.cftappsdemo - } -} - -module "ccpay-payment-policy" { - source = "git@github.com:hmcts/cnp-module-api-mgmt-api-policy?ref=master" - - api_mgmt_name = local.api_mgmt_name_cft - api_mgmt_rg = local.api_mgmt_rg_cft - - api_name = module.ccpay-payment-api.name - api_policy_xml_content = data.template_file.policy_template.rendered - - providers = { - azurerm = azurerm.cftappsdemo - } - } - - -resource "azurerm_api_management_user" "payment_Ranjeet" { - api_management_name = local.api_mgmt_name_cft - resource_group_name = local.api_mgmt_rg_cft - user_id = "5931a75ae4bbd512288c990c" - first_name = "Ranjeet" - last_name = "Kumar" - email = "ranjeet.kumar@hmcts.net" - state = "active" - - provider = azurerm.cftappsdemo -} -resource "azurerm_api_management_user" "payment_sayali" { - api_management_name = local.api_mgmt_name_cft - resource_group_name = local.api_mgmt_rg_cft - user_id = "5931a75ae4bbd512288c790c" - first_name = "Sayali" - last_name = "Salunkhe" - email = "sayali.salunkhe@hmcts.net" - state = "active" - provider = azurerm.cftappsdemo -} - - resource "azurerm_api_management_subscription" "sayali_sub_payment" { - api_management_name = local.api_mgmt_name_cft - resource_group_name = local.api_mgmt_rg_cft - user_id = azurerm_api_management_user.payment_sayali.id - product_id = data.azurerm_api_management_product.paymentcft.id - display_name = "payment Subscription sayali" - state = "active" - provider = azurerm.cftappsdemo -} - - resource "azurerm_api_management_subscription" "Ranjeet_sub_payment" { - api_management_name = local.api_mgmt_name_cft - resource_group_name = local.api_mgmt_rg_cft - user_id = azurerm_api_management_user.payment_Ranjeet.id - product_id = data.azurerm_api_management_product.paymentcft.id - display_name = "payment Subscription ranjeet" - state = "active" - provider = azurerm.cftappsdemo -} - - data "azurerm_api_management_user" "anshika" { - user_id = "5931a75ae4bbd512288c680b" - api_management_name = local.api_mgmt_name_cft - resource_group_name = local.api_mgmt_rg_cft - provider = azurerm.cftappsdemo -} - - - resource "azurerm_api_management_subscription" "anshika_sub" { - api_management_name = local.api_mgmt_name_cft - resource_group_name = local.api_mgmt_rg_cft - user_id = data.azurerm_api_management_user.anshika.id - product_id = data.azurerm_api_management_product.paymentcft.id - display_name = "Payment Subscription" - state = "active" - provider = azurerm.cftappsdemo -} - - data "azurerm_api_management_user" "payment_Vamshi" { - api_management_name = local.api_mgmt_name_cft - resource_group_name = local.api_mgmt_rg_cft - user_id = "5931a75ae4bbd512288c680c" - provider = azurerm.cftappsdemo -} - -resource "azurerm_api_management_subscription" "Vamshi_sub_payment" { - api_management_name = local.api_mgmt_name_cft - resource_group_name = local.api_mgmt_rg_cft - user_id = data.azurerm_api_management_user.payment_Vamshi.id - product_id = data.azurerm_api_management_product.paymentcft.id - display_name = "payment Subscription Vamshi" - state = "active" - provider = azurerm.cftappsdemo -} \ No newline at end of file diff --git a/terraform.tf b/terraform.tf index 65aaafe..8144f8d 100644 --- a/terraform.tf +++ b/terraform.tf @@ -1,7 +1,5 @@ provider "azurerm" { - alias = "cftappsdemo" features {} - subscription_id = "d025fece-ce99-4df2-b7a9-b649d3ff2060" } terraform { From 757f1b763f9984ccbda2e1aa74246eac2fad4088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csayali-salunkhe=E2=80=9D?= <“sayali.salunkhe@HMCTS.net”> Date: Fri, 8 Jul 2022 10:49:11 +0100 Subject: [PATCH 33/35] Added thumbprint and old changes to run Demo pipeline --- demo.tfvars | 2 +- main.tf | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++ terraform.tf | 2 + 3 files changed, 140 insertions(+), 1 deletion(-) diff --git a/demo.tfvars b/demo.tfvars index bf1a959..9b018f5 100644 --- a/demo.tfvars +++ b/demo.tfvars @@ -1 +1 @@ -api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","5E61678A6AC76C2E92F26D1F4AF3D8A327E0D2CE","68EDF481C5394D65962E9810913455D3EC635FA5","B1C45E55A1E93AD43A473972CFF490722EEF1E38","F7C2AB80CFA2721DB41490DC31325977AAA034FE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B49BDDE7818B78058AC7401BE0284A40845031E3","D36AC5686200258AE7C03CCCA70E14B69C17F94B","C6E2FBAB5FED58FD86C10A3BD212CF44668FD1A3","F46DF3FF3FD3AC664C20BF0F958D62E831C043FD","156E40AA1013B3B675B202602C10F7ED6B9C6E0A","865DA26A413AED2D83CE1F7F70AAC1532A148058","f397f389e584407985df065562ce4835","57c15a76bebc4427976e45b1f38f9623","7744A2F56BD3B73C0D7FED61309E1C65AF08538C"] +api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","5E61678A6AC76C2E92F26D1F4AF3D8A327E0D2CE","68EDF481C5394D65962E9810913455D3EC635FA5","B1C45E55A1E93AD43A473972CFF490722EEF1E38","F7C2AB80CFA2721DB41490DC31325977AAA034FE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B49BDDE7818B78058AC7401BE0284A40845031E3","D36AC5686200258AE7C03CCCA70E14B69C17F94B","C6E2FBAB5FED58FD86C10A3BD212CF44668FD1A3","F46DF3FF3FD3AC664C20BF0F958D62E831C043FD","156E40AA1013B3B675B202602C10F7ED6B9C6E0A","865DA26A413AED2D83CE1F7F70AAC1532A148058","f397f389e584407985df065562ce4835","57c15a76bebc4427976e45b1f38f9623","7744A2F56BD3B73C0D7FED61309E1C65AF08538C","4C07B236DB85B31252C0469543A77D4542F21276"] diff --git a/main.tf b/main.tf index 3c6f142..87dbe91 100644 --- a/main.tf +++ b/main.tf @@ -1,3 +1,7 @@ +provider "azurerm" { + features {} +} + locals { api_mgmt_name = join("-", ["core-api-mgmt", var.env]) api_mgmt_rg = join("-", ["core-infra", var.env]) @@ -10,6 +14,9 @@ locals { # list of the thumbprints of the SSL certificates that should be accepted by the API (gateway) thumbprints_in_quotes = formatlist("\"%s\"", var.api_gateway_test_certificate_thumbprints) thumbprints_in_quotes_str = join(",", local.thumbprints_in_quotes) + + api_mgmt_name_cft = join("-", ["cft-api-mgmt", var.env]) + api_mgmt_rg_cft = join("-", ["cft", var.env, "network-rg"]) } data "azurerm_key_vault" "payment_key_vault" { @@ -65,3 +72,133 @@ module "api_mgmt_policy" { api_name = module.api_mgmt_api.name api_policy_xml_content = data.template_file.policy_template.rendered } + +module "ccpay-payment-product" { + source = "git@github.com:hmcts/cnp-module-api-mgmt-product?ref=master" + api_mgmt_name = local.api_mgmt_name_cft + api_mgmt_rg = local.api_mgmt_rg_cft + name = var.product_name + product_access_control_groups = ["developers"] + + providers = { + azurerm = azurerm.cftappsdemo + } +} + + data "azurerm_api_management_product" "paymentcft" { + product_id = module.ccpay-payment-product.product_id + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + provider = azurerm.cftappsdemo +} + +module "ccpay-payment-api" { + source = "git@github.com:hmcts/cnp-module-api-mgmt-api?ref=master" + + api_mgmt_name = local.api_mgmt_name_cft + api_mgmt_rg = local.api_mgmt_rg_cft + revision = "1" + service_url = local.payments_api_url + product_id = module.ccpay-payment-product.product_id + name = join("-", [var.product_name, "apiList"]) + protocols = ["https"] + display_name = "Payments API" + path = local.api_base_path + swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.payment-status.json" + + providers = { + azurerm = azurerm.cftappsdemo + } +} + +module "ccpay-payment-policy" { + source = "git@github.com:hmcts/cnp-module-api-mgmt-api-policy?ref=master" + + api_mgmt_name = local.api_mgmt_name_cft + api_mgmt_rg = local.api_mgmt_rg_cft + + api_name = module.ccpay-payment-api.name + api_policy_xml_content = data.template_file.policy_template.rendered + + providers = { + azurerm = azurerm.cftappsdemo + } + } + + +resource "azurerm_api_management_user" "payment_Ranjeet" { + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + user_id = "5931a75ae4bbd512288c990c" + first_name = "Ranjeet" + last_name = "Kumar" + email = "ranjeet.kumar@hmcts.net" + state = "active" + + provider = azurerm.cftappsdemo +} +resource "azurerm_api_management_user" "payment_sayali" { + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + user_id = "5931a75ae4bbd512288c790c" + first_name = "Sayali" + last_name = "Salunkhe" + email = "sayali.salunkhe@hmcts.net" + state = "active" + provider = azurerm.cftappsdemo +} + + resource "azurerm_api_management_subscription" "sayali_sub_payment" { + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + user_id = azurerm_api_management_user.payment_sayali.id + product_id = data.azurerm_api_management_product.paymentcft.id + display_name = "payment Subscription sayali" + state = "active" + provider = azurerm.cftappsdemo +} + + resource "azurerm_api_management_subscription" "Ranjeet_sub_payment" { + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + user_id = azurerm_api_management_user.payment_Ranjeet.id + product_id = data.azurerm_api_management_product.paymentcft.id + display_name = "payment Subscription ranjeet" + state = "active" + provider = azurerm.cftappsdemo +} + + data "azurerm_api_management_user" "anshika" { + user_id = "5931a75ae4bbd512288c680b" + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + provider = azurerm.cftappsdemo +} + + + resource "azurerm_api_management_subscription" "anshika_sub" { + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + user_id = data.azurerm_api_management_user.anshika.id + product_id = data.azurerm_api_management_product.paymentcft.id + display_name = "Payment Subscription" + state = "active" + provider = azurerm.cftappsdemo +} + + data "azurerm_api_management_user" "payment_Vamshi" { + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + user_id = "5931a75ae4bbd512288c680c" + provider = azurerm.cftappsdemo +} + +resource "azurerm_api_management_subscription" "Vamshi_sub_payment" { + api_management_name = local.api_mgmt_name_cft + resource_group_name = local.api_mgmt_rg_cft + user_id = data.azurerm_api_management_user.payment_Vamshi.id + product_id = data.azurerm_api_management_product.paymentcft.id + display_name = "payment Subscription Vamshi" + state = "active" + provider = azurerm.cftappsdemo +} \ No newline at end of file diff --git a/terraform.tf b/terraform.tf index 8144f8d..65aaafe 100644 --- a/terraform.tf +++ b/terraform.tf @@ -1,5 +1,7 @@ provider "azurerm" { + alias = "cftappsdemo" features {} + subscription_id = "d025fece-ce99-4df2-b7a9-b649d3ff2060" } terraform { From 54d757b6121cf27163e34167d52724a97fc7cf82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csayali-salunkhe=E2=80=9D?= <“sayali.salunkhe@HMCTS.net”> Date: Thu, 14 Jul 2022 10:05:20 +0100 Subject: [PATCH 34/35] Added thumbprint for Vamshi --- demo.tfvars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo.tfvars b/demo.tfvars index 9b018f5..71fb48c 100644 --- a/demo.tfvars +++ b/demo.tfvars @@ -1 +1 @@ -api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","5E61678A6AC76C2E92F26D1F4AF3D8A327E0D2CE","68EDF481C5394D65962E9810913455D3EC635FA5","B1C45E55A1E93AD43A473972CFF490722EEF1E38","F7C2AB80CFA2721DB41490DC31325977AAA034FE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B49BDDE7818B78058AC7401BE0284A40845031E3","D36AC5686200258AE7C03CCCA70E14B69C17F94B","C6E2FBAB5FED58FD86C10A3BD212CF44668FD1A3","F46DF3FF3FD3AC664C20BF0F958D62E831C043FD","156E40AA1013B3B675B202602C10F7ED6B9C6E0A","865DA26A413AED2D83CE1F7F70AAC1532A148058","f397f389e584407985df065562ce4835","57c15a76bebc4427976e45b1f38f9623","7744A2F56BD3B73C0D7FED61309E1C65AF08538C","4C07B236DB85B31252C0469543A77D4542F21276"] +api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","5E61678A6AC76C2E92F26D1F4AF3D8A327E0D2CE","68EDF481C5394D65962E9810913455D3EC635FA5","B1C45E55A1E93AD43A473972CFF490722EEF1E38","F7C2AB80CFA2721DB41490DC31325977AAA034FE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B49BDDE7818B78058AC7401BE0284A40845031E3","D36AC5686200258AE7C03CCCA70E14B69C17F94B","C6E2FBAB5FED58FD86C10A3BD212CF44668FD1A3","F46DF3FF3FD3AC664C20BF0F958D62E831C043FD","156E40AA1013B3B675B202602C10F7ED6B9C6E0A","865DA26A413AED2D83CE1F7F70AAC1532A148058","f397f389e584407985df065562ce4835","57c15a76bebc4427976e45b1f38f9623","7744A2F56BD3B73C0D7FED61309E1C65AF08538C","4C07B236DB85B31252C0469543A77D4542F21276","BFE19A537A02FE356F72F65D93DB958C7E55C07C"] From 452f3282489c035295e0a5d9cd31fb8484e97c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csayali-salunkhe=E2=80=9D?= <“sayali.salunkhe@HMCTS.net”> Date: Tue, 6 Sep 2022 13:20:22 +0100 Subject: [PATCH 35/35] Updated json file name --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 87dbe91..565057b 100644 --- a/main.tf +++ b/main.tf @@ -104,7 +104,7 @@ module "ccpay-payment-api" { protocols = ["https"] display_name = "Payments API" path = local.api_base_path - swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.payment-status.json" + swagger_url = "https://raw.githubusercontent.com/hmcts/reform-api-docs/master/docs/specs/ccpay-payment-app.payment-status-update.json" providers = { azurerm = azurerm.cftappsdemo