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

Pay 5556 #101

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
67c93aa
Update demo.tfvars
anshikanigam15 Apr 29, 2022
6df49e0
Merge pull request #75 from hmcts/CertificateUpdate
anshikanigam15 Apr 29, 2022
21290fc
Update main.tf
anshikanigam15 May 3, 2022
39114d4
Merge pull request #76 from hmcts/anshikanigam15-patch-1
anshikanigam15 May 3, 2022
cb74998
Update main.tf
anshikanigam15 May 3, 2022
21dc251
Merge pull request #77 from hmcts/anshikanigam15-patch-2
anshikanigam15 May 3, 2022
0cfae7c
Update demo.tfvars
pats-john May 3, 2022
ccd04d7
certificate thumbnail
May 10, 2022
951f42e
certificate thumbnail
May 10, 2022
382e1a3
certificate thumbnail
May 10, 2022
97ccbb2
product&API added
May 11, 2022
c8d63ce
product&API added
May 12, 2022
25801d4
product&API added
May 12, 2022
b32513d
api gateway impl
May 12, 2022
cc8ca0a
api gateway impl
May 13, 2022
dcedf06
api gateway impl
May 13, 2022
ee21eb7
api gateway impl
May 13, 2022
9e09206
api gateway impl
May 13, 2022
5a1018b
api gateway impl
May 13, 2022
3cea9e1
api gateway impl
May 16, 2022
896a618
api gateway impl
May 16, 2022
60ba7f7
api gateway impl
May 16, 2022
88a9a09
policy change
May 18, 2022
6cd864e
file name update
May 19, 2022
fb5007b
Merge branch 'demo' into PAY-5556
ranjeet-kumarhmcts May 20, 2022
e312c57
Merge pull request #86 from hmcts/PAY-5556
anshikanigam15 May 20, 2022
e96a223
Update main.tf
anshikanigam15 May 20, 2022
e491e89
Update main.tf
anshikanigam15 May 20, 2022
c64abaf
Update main.tf
anshikanigam15 May 20, 2022
8798680
Update main.tf
anshikanigam15 May 20, 2022
e041cab
Update demo.tfvars
ranjeet-kumarhmcts May 23, 2022
b67b15e
PAY-5556 & PAY-5558 added activation keys
May 23, 2022
7ae3998
conflicts resolved with branch demo
May 23, 2022
638357d
user amd subd added
May 23, 2022
d3c50fa
user amd subd added
May 23, 2022
e4bc835
user amd subd added
May 23, 2022
d1ea0f0
Merge branch 'demo' into PAY-5556
ranjeet-kumarhmcts Jun 28, 2022
e30052a
Merge pull request #94 from hmcts/PAY-5556
anshikanigam15 Jul 4, 2022
32870a0
Changed swagger_url file name to ccpay-payment-app.recon-payments-v2.…
Jul 7, 2022
70e1a28
Merge branch 'PAY-5556' of https://github.com/hmcts/ccpay-payment-api…
Jul 7, 2022
dced72e
Merge branch 'demo' of https://github.com/hmcts/ccpay-payment-api-gat…
Jul 7, 2022
a6a028c
Changed swagger_url file name to ccpay-payment-app.recon-payments-v1.…
Jul 7, 2022
2afb2ac
Removed cft-api-mgmt changes
Jul 7, 2022
757f1b7
Added thumbprint and old changes to run Demo pipeline
Jul 8, 2022
54d757b
Added thumbprint for Vamshi
Jul 14, 2022
4ad5f88
Merge branch 'master' of https://github.com/hmcts/ccpay-payment-api-g…
Sep 6, 2022
452f328
Updated json file name
Sep 6, 2022
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
2 changes: 1 addition & 1 deletion aat.tfvars
Original file line number Diff line number Diff line change
@@ -1 +1 @@
api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","B1C45E55A1E93AD43A473972CFF490722EEF1E38","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B49BDDE7818B78058AC7401BE0284A40845031E3","E5F54E7BA2B780E2B1B1FFAC68F801251935BE80","C6E2FBAB5FED58FD86C10A3BD212CF44668FD1A3","7744A2F56BD3B73C0D7FED61309E1C65AF08538C"]
api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","B1C45E55A1E93AD43A473972CFF490722EEF1E38","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B49BDDE7818B78058AC7401BE0284A40845031E3","E5F54E7BA2B780E2B1B1FFAC68F801251935BE80","F46DF3FF3FD3AC664C20BF0F958D62E831C043FD","156E40AA1013B3B675B202602C10F7ED6B9C6E0A","C6E2FBAB5FED58FD86C10A3BD212CF44668FD1A3","7744A2F56BD3B73C0D7FED61309E1C65AF08538C"]
2 changes: 1 addition & 1 deletion demo.tfvars
Original file line number Diff line number Diff line change
@@ -1 +1 @@
api_gateway_test_certificate_thumbprints = ["B1BF8007527F85085D7C4A3DC406A9A6D124D721","13D1848E8B050CE55E4D41A35A60FF4A17E686A6","5E61678A6AC76C2E92F26D1F4AF3D8A327E0D2CE","68EDF481C5394D65962E9810913455D3EC635FA5","B1C45E55A1E93AD43A473972CFF490722EEF1E38","F7C2AB80CFA2721DB41490DC31325977AAA034FE","9AF616DC3860C9736BBD20ADAD34AAFD913FD6CA","B9D9E70AC23EAF8EA094F6B59EF77FF77D977CBE","B660C97A7CC2734ABD41FBF9F6ADAA61B0C399D4","B49BDDE7818B78058AC7401BE0284A40845031E3","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","BFE19A537A02FE356F72F65D93DB958C7E55C07C"]
139 changes: 138 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
@@ -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])
Expand All @@ -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" {
Expand Down Expand Up @@ -43,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-v1.json"
revision = "1"
}

Expand All @@ -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 = "[email protected]: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 = "[email protected]: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-update.json"

providers = {
azurerm = azurerm.cftappsdemo
}
}

module "ccpay-payment-policy" {
source = "[email protected]: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 = "[email protected]"
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 = "[email protected]"
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
}
2 changes: 2 additions & 0 deletions terraform.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
provider "azurerm" {
alias = "cftappsdemo"
features {}
subscription_id = "d025fece-ce99-4df2-b7a9-b649d3ff2060"
}

terraform {
Expand Down