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

Updating to add Bulk scanning api to new Management API service. #543

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

davejones74
Copy link
Contributor

JIRA link (if applicable)

https://tools.hmcts.net/jira/browse/PAY-6602

Change description

Infra to add bulk scanning payment api to cft mgmt gateway.

Does this PR introduce a breaking change? (check one with "x")

[x] Yes
[ ] No

@davejones74 davejones74 requested a review from a team June 14, 2024 14:57
@hmcts-jenkins-a-to-c
Copy link
Contributor

hmcts-jenkins-a-to-c bot commented Jun 14, 2024

Plan Result (aat)

Plan: 1 to add, 1 to change, 0 to destroy.
  • Create
    • azurerm_template_deployment.cft-bulk-scanning-payment[0]
  • Update
    • azurerm_template_deployment.bulk-scanning-payment[0]
Change Result (Click me)
  # azurerm_template_deployment.bulk-scanning-payment[0] will be updated in-place
  ~ resource "azurerm_template_deployment" "bulk-scanning-payment" {
        id                  = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/core-infra-aat/providers/Microsoft.Resources/deployments/bulk-scanning-payment-aat"
        name                = "bulk-scanning-payment-aat"
      ~ parameters          = {
          ~ "policy"                   = <<-EOT
                <policies>
                  <backend>
                    <base/>
                  </backend>
                  <inbound>
                    <base/>
                    <choose>
              -       <when condition="@(context.Request.Certificate == null || context.Request.Certificate.NotAfter &lt; DateTime.Now || context.Request.Certificate.NotBefore &gt; DateTime.Now || !(new string[] {&quot;7744A2F56BD3B73C0D7FED61309E1C65AF08538C&quot;,&quot;792265A947D0C76D4F67A0878B1D06E60976DFDA&quot;,&quot;4396D69786566676383DD5BFF84B95E2A9975263&quot;}.Any(c => c == context.Request.Certificate.Thumbprint)))" >
              +       <when condition="@(context.Request.Certificate == null || context.Request.Certificate.NotAfter &lt; DateTime.Now || context.Request.Certificate.NotBefore &gt; DateTime.Now || !(new string[] {&quot;7744A2F56BD3B73C0D7FED61309E1C65AF08538C&quot;,&quot;792265A947D0C76D4F67A0878B1D06E60976DFDA&quot;,&quot;4396D69786566676383DD5BFF84B95E2A9975263&quot;,&quot;BFE89B4BA1F47E048CFDF125C2E1BB4E2CC26083&quot;}.Any(c => c == context.Request.Certificate.Thumbprint)))" >
                        <return-response>
                          <set-status code="403" reason="Invalid client certificate."/>
                        </return-response>
                      </when>
                    </choose>
                    <!-- generate totp -->
                    <set-variable name="client_id" value="api_gw" />
                    <set-variable name="client_secret" value="C5OI566EGMPHT3CC" />
                    <set-variable name="one_time_password" value="@{
                                const string Base32AllowedCharacters = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ234567&quot;;
                                var bits = &quot;C5OI566EGMPHT3CC&quot;.ToUpper().ToCharArray().Select(c => Convert.ToString(Base32AllowedCharacters.IndexOf(c), 2).PadLeft(5, '0')).Aggregate((a, b) => a + b);
                                var secretKeyBytes = Enumerable.Range(0, bits.Length / 8).Select(i => Convert.ToByte(bits.Substring(i * 8, 8), 2)).ToArray();
                
                                var unixTimestamp = (long) (DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
                                var timeIndex = unixTimestamp / 30;
                                byte[] challenge = BitConverter.GetBytes(timeIndex);
                                if (BitConverter.IsLittleEndian) {
                                    Array.Reverse(challenge);
                                }
                
                                HMACSHA1 hmac = new HMACSHA1(secretKeyBytes);
                                byte[] hash = hmac.ComputeHash(challenge);
                                int offset = hash[19] &amp; 0xf;
                                int truncatedHash = hash[offset] &amp; 0x7f;
                                for (int i = 1; i &lt; 4; i++)
                                {
                                    truncatedHash &lt;&lt;= 8;
                                    truncatedHash |= hash[offset + i] &amp; 0xff;
                                }
                                truncatedHash %= 1000000;
                                return truncatedHash.ToString(&quot;D6&quot;);
                            }"/>
                    <send-request ignore-error="false" timeout="20" response-variable-name="s2sBearerToken" mode="new">
                      <set-url>http://rpe-service-auth-provider-aat.service.core-compute-aat.internal/lease</set-url>
                      <set-method>POST</set-method>
                      <set-header name="Content-Type" exists-action="override">
                        <value>application/json</value>
                      </set-header>
                      <set-body>@{
                        return new JObject(
                        new JProperty("microservice", (string)context.Variables["client_id"]),
                        new JProperty("oneTimePassword", (string)context.Variables["one_time_password"])
                        ).ToString();
                        }</set-body>
                    </send-request>
                
                    <set-header name="ServiceAuthorization" exists-action="override">
                      <value>@("Bearer " + ((IResponse)context.Variables["s2sBearerToken"]).Body.As&lt;string&gt;())</value>
                    </set-header>
                  </inbound>
                  <outbound>
                    <base/>
                  </outbound>
                  <on-error>
                    <base/>
                  </on-error>
                </policies>
            EOT
            # (5 unchanged elements hidden)
        }
        # (4 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # azurerm_template_deployment.cft-bulk-scanning-payment[0] will be created
  + resource "azurerm_template_deployment" "cft-bulk-scanning-payment" {
      + deployment_mode     = "Incremental"
      + id                  = (known after apply)
      + name                = "cft-bulk-scanning-payment-aat"
      + outputs             = (known after apply)
      + parameters          = {
          + "apiBasePath"              = "bulk-scanning-payment"
          + "apiManagementServiceName" = "cft-api-mgmt-aat"
          + "apiName"                  = "bulk-scanning-payment-api"
          + "apiProductName"           = "bulk-scanning-payment"
          + "policy"                   = <<-EOT
                <policies>
                  <backend>
                    <base/>
                  </backend>
                  <inbound>
                    <base/>
                    <choose>
                      <when condition="@(context.Request.Certificate == null || context.Request.Certificate.NotAfter &lt; DateTime.Now || context.Request.Certificate.NotBefore &gt; DateTime.Now || !(new string[] {&quot;7744A2F56BD3B73C0D7FED61309E1C65AF08538C&quot;,&quot;792265A947D0C76D4F67A0878B1D06E60976DFDA&quot;,&quot;4396D69786566676383DD5BFF84B95E2A9975263&quot;,&quot;BFE89B4BA1F47E048CFDF125C2E1BB4E2CC26083&quot;}.Any(c => c == context.Request.Certificate.Thumbprint)))" >
                        <return-response>
                          <set-status code="403" reason="Invalid client certificate."/>
                        </return-response>
                      </when>
                    </choose>
                    <!-- generate totp -->
                    <set-variable name="client_id" value="api_gw" />
                    <set-variable name="client_secret" value="C5OI566EGMPHT3CC" />
                    <set-variable name="one_time_password" value="@{
                                const string Base32AllowedCharacters = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ234567&quot;;
                                var bits = &quot;C5OI566EGMPHT3CC&quot;.ToUpper().ToCharArray().Select(c => Convert.ToString(Base32AllowedCharacters.IndexOf(c), 2).PadLeft(5, '0')).Aggregate((a, b) => a + b);
                                var secretKeyBytes = Enumerable.Range(0, bits.Length / 8).Select(i => Convert.ToByte(bits.Substring(i * 8, 8), 2)).ToArray();
                
                                var unixTimestamp = (long) (DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
                                var timeIndex = unixTimestamp / 30;
                                byte[] challenge = BitConverter.GetBytes(timeIndex);
                                if (BitConverter.IsLittleEndian) {
                                    Array.Reverse(challenge);
                                }
                
                                HMACSHA1 hmac = new HMACSHA1(secretKeyBytes);
                                byte[] hash = hmac.ComputeHash(challenge);
                                int offset = hash[19] &amp; 0xf;
                                int truncatedHash = hash[offset] &amp; 0x7f;
                                for (int i = 1; i &lt; 4; i++)
                                {
                                    truncatedHash &lt;&lt;= 8;
                                    truncatedHash |= hash[offset + i] &amp; 0xff;
                                }
                                truncatedHash %= 1000000;
                                return truncatedHash.ToString(&quot;D6&quot;);
                            }"/>
                    <send-request ignore-error="false" timeout="20" response-variable-name="s2sBearerToken" mode="new">
                      <set-url>http://rpe-service-auth-provider-aat.service.core-compute-aat.internal/lease</set-url>
                      <set-method>POST</set-method>
                      <set-header name="Content-Type" exists-action="override">
                        <value>application/json</value>
                      </set-header>
                      <set-body>@{
                        return new JObject(
                        new JProperty("microservice", (string)context.Variables["client_id"]),
                        new JProperty("oneTimePassword", (string)context.Variables["one_time_password"])
                        ).ToString();
                        }</set-body>
                    </send-request>
                
                    <set-header name="ServiceAuthorization" exists-action="override">
                      <value>@("Bearer " + ((IResponse)context.Variables["s2sBearerToken"]).Body.As&lt;string&gt;())</value>
                    </set-header>
                  </inbound>
                  <outbound>
                    <base/>
                  </outbound>
                  <on-error>
                    <base/>
                  </on-error>
                </policies>
            EOT
          + "serviceUrl"               = "http://ccpay-bulkscanning-api-aat.service.core-compute-aat.internal"
        }
      + resource_group_name = "cft-aat-network-rg"
      + template_body       = jsonencode(
            {
              + "$schema"      = "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#"
              + contentVersion = "1.0.0.0"
              + parameters     = {
                  + apiBasePath              = {
                      + metadata = {
                          + description = "Path to the API (excluding host)"
                        }
                      + type     = "string"
                    }
                  + apiManagementServiceName = {
                      + metadata = {
                          + description = "API Management service name"
                        }
                      + type     = "string"
                    }
                  + apiName                  = {
                      + metadata = {
                          + description = "Name of the API (gateway)"
                        }
                      + type     = "string"
                    }
                  + apiProductName           = {
                      + metadata = {
                          + description = "API Management product name"
                        }
                      + type     = "string"
                    }
                  + policy                   = {
                      + type = "string"
                    }
                  + serviceUrl               = {
                      + metadata = {
                          + description = "URL of the backend service (to be protected by the API)"
                        }
                      + type     = "string"
                    }
                }
              + resources      = [
                  + {
                      + apiVersion = "2017-03-01"
                      + dependsOn  = []
                      + name       = "[concat(parameters('apiManagementServiceName') ,'/', parameters('apiProductName'))]"
                      + properties = {
                          + approvalRequired     = true
                          + displayName          = "[parameters('apiProductName')]"
                          + state                = "published"
                          + subscriptionRequired = true
                        }
                      + type       = "Microsoft.ApiManagement/service/products"
                    },
                  + {
                      + apiVersion = "2017-03-01"
                      + dependsOn  = [
                          + "[resourceId('Microsoft.ApiManagement/service/products', parameters('apiManagementServiceName'), parameters('apiProductName'))]",
                        ]
                      + name       = "[concat(parameters('apiManagementServiceName') ,'/', parameters('apiProductName'), '/', variables('developersGroupName'))]"
                      + properties = {
                          + builtIn     = true
                          + description = "Developers group"
                          + displayName = "Developers"
                          + type        = "system"
                        }
                      + type       = "Microsoft.ApiManagement/service/products/groups"
                    },
                  + {
                      + apiVersion = "2017-03-01"
                      + dependsOn  = [
                          + "[variables('fullApiProductName')]",
                        ]
                      + name       = "[concat(parameters('apiManagementServiceName'), '/', parameters('apiName'))]"
                      + properties = {
                          + displayName = "bulk-scanning payments API"
                          + path        = "[parameters('apiBasePath')]"
                          + protocols   = [
                              + "HTTPS",
                            ]
                          + serviceUrl  = "[parameters('serviceUrl')]"
                        }
                      + resources  = [
                          + {
                              + apiVersion = "2017-03-01"
                              + dependsOn  = [
                                  + "[variables('fullApiName')]",
                                ]
                              + name       = "bulk-scanning-payments-api"
                              + properties = {
                                  + description = "Insert payment data from scanning third party"
                                  + displayName = "bulk-scanning payments api "
                                  + method      = "POST"
                                  + request     = {
                                      + description     = "Used by third party scanning service to insert payments data in Bulk-scanning service"
                                      + representations = [
                                          + {
                                              + contentType = "application/json"
                                              + parameters  = [
                                                  + {
                                                      + description = "BulkScanPayment"
                                                      + in          = "body"
                                                      + name        = "bulkScanPayment"
                                                    },
                                                ]
                                            },
                                        ]
                                    }
                                  + responses   = [
                                      + {
                                          + description = "Created"
                                          + statusCode  = 201
                                        },
                                      + {
                                          + description = "Request failed due to malformed syntax"
                                          + statusCode  = 400
                                        },
                                      + {
                                          + description = "Failed authentication"
                                          + statusCode  = 401
                                        },
                                      + {
                                          + description = "Failed authorisation"
                                          + statusCode  = 403
                                        },
                                      + {
                                          + description = "Conflict"
                                          + statusCode  = 409
                                        },
                                    ]
                                  + urlTemplate = "/bulk-scan-payment"
                                }
                              + type       = "operations"
                            },
                        ]
                      + type       = "Microsoft.ApiManagement/service/apis"
                    },
                  + {
                      + apiVersion = "2017-03-01"
                      + dependsOn  = [
                          + "[variables('fullApiProductName')]",
                          + "[variables('fullApiName')]",
                        ]
                      + name       = "[concat(parameters('apiManagementServiceName'), '/', parameters('apiProductName'), '/', parameters('apiName'))]"
                      + type       = "Microsoft.ApiManagement/service/products/apis"
                    },
                  + {
                      + apiVersion = "2017-03-01"
                      + dependsOn  = [
                          + "[variables('fullApiProductName')]",
                          + "[variables('fullApiName')]",
                        ]
                      + name       = "[concat(parameters('apiManagementServiceName'), '/', parameters('apiName'),'/policy')]"
                      + properties = {
                          + policyContent = "[parameters('policy')]"
                        }
                      + type       = "Microsoft.ApiManagement/service/apis/policies"
                    },
                ]
              + variables      = {
                  + developersGroupName = "Developers"
                  + fullApiName         = "[concat('Microsoft.ApiManagement/service/', parameters('apiManagementServiceName'), '/apis/', parameters('apiName'))]"
                  + fullApiProductName  = "[concat('Microsoft.ApiManagement/service/', parameters('apiManagementServiceName'), '/products/', parameters('apiProductName'))]"
                }
            }
        )
    }

Plan: 1 to add, 1 to change, 0 to destroy.

@hmcts-jenkins-a-to-c
Copy link
Contributor

Plan Result (prod)

Plan: 1 to add, 0 to change, 0 to destroy.
  • Create
    • azurerm_template_deployment.cft-bulk-scanning-payment[0]
Change Result (Click me)
  # azurerm_template_deployment.cft-bulk-scanning-payment[0] will be created
  + resource "azurerm_template_deployment" "cft-bulk-scanning-payment" {
      + deployment_mode     = "Incremental"
      + id                  = (known after apply)
      + name                = "cft-bulk-scanning-payment-prod"
      + outputs             = (known after apply)
      + parameters          = {
          + "apiBasePath"              = "bulk-scanning-payment"
          + "apiManagementServiceName" = "cft-api-mgmt-prod"
          + "apiName"                  = "bulk-scanning-payment-api"
          + "apiProductName"           = "bulk-scanning-payment"
          + "policy"                   = <<-EOT
                <policies>
                  <backend>
                    <base/>
                  </backend>
                  <inbound>
                    <base/>
                    <choose>
                      <when condition="@(context.Request.Certificate == null || context.Request.Certificate.NotAfter &lt; DateTime.Now || context.Request.Certificate.NotBefore &gt; DateTime.Now || !(new string[] {&quot;A78ED211FD9CE9DE2EEC47FD1A87F40CE0F4A1A5&quot;,&quot;F4A976E4967F8F4F621C87C67B9E258563F80F0E&quot;,&quot;B35BCF6C5C9DAEE7D0C756B666FFEDE2CF4659BA&quot;,&quot;B1BF8007527F85085D7C4A3DC406A9A6D124D721&quot;,&quot;E4E5673792DA616E14BEEF63F75DD96590124734&quot;,&quot;3FEBC1DE5DFBAF97B1F1CEEC80A1B192F999596A&quot;,&quot;CC852B5D1349041E1309AC5F9918ECE1FE5C023C&quot;}.Any(c => c == context.Request.Certificate.Thumbprint)))" >
                        <return-response>
                          <set-status code="403" reason="Invalid client certificate."/>
                        </return-response>
                      </when>
                    </choose>
                    <!-- generate totp -->
                    <set-variable name="client_id" value="api_gw" />
                    <set-variable name="client_secret" value="JBSAAHPPEHPK3PXP" />
                    <set-variable name="one_time_password" value="@{
                                const string Base32AllowedCharacters = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ234567&quot;;
                                var bits = &quot;JBSAAHPPEHPK3PXP&quot;.ToUpper().ToCharArray().Select(c => Convert.ToString(Base32AllowedCharacters.IndexOf(c), 2).PadLeft(5, '0')).Aggregate((a, b) => a + b);
                                var secretKeyBytes = Enumerable.Range(0, bits.Length / 8).Select(i => Convert.ToByte(bits.Substring(i * 8, 8), 2)).ToArray();
                
                                var unixTimestamp = (long) (DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
                                var timeIndex = unixTimestamp / 30;
                                byte[] challenge = BitConverter.GetBytes(timeIndex);
                                if (BitConverter.IsLittleEndian) {
                                    Array.Reverse(challenge);
                                }
                
                                HMACSHA1 hmac = new HMACSHA1(secretKeyBytes);
                                byte[] hash = hmac.ComputeHash(challenge);
                                int offset = hash[19] &amp; 0xf;
                                int truncatedHash = hash[offset] &amp; 0x7f;
                                for (int i = 1; i &lt; 4; i++)
                                {
                                    truncatedHash &lt;&lt;= 8;
                                    truncatedHash |= hash[offset + i] &amp; 0xff;
                                }
                                truncatedHash %= 1000000;
                                return truncatedHash.ToString(&quot;D6&quot;);
                            }"/>
                    <send-request ignore-error="false" timeout="20" response-variable-name="s2sBearerToken" mode="new">
                      <set-url>http://rpe-service-auth-provider-prod.service.core-compute-prod.internal/lease</set-url>
                      <set-method>POST</set-method>
                      <set-header name="Content-Type" exists-action="override">
                        <value>application/json</value>
                      </set-header>
                      <set-body>@{
                        return new JObject(
                        new JProperty("microservice", (string)context.Variables["client_id"]),
                        new JProperty("oneTimePassword", (string)context.Variables["one_time_password"])
                        ).ToString();
                        }</set-body>
                    </send-request>
                
                    <set-header name="ServiceAuthorization" exists-action="override">
                      <value>@("Bearer " + ((IResponse)context.Variables["s2sBearerToken"]).Body.As&lt;string&gt;())</value>
                    </set-header>
                  </inbound>
                  <outbound>
                    <base/>
                  </outbound>
                  <on-error>
                    <base/>
                  </on-error>
                </policies>
            EOT
          + "serviceUrl"               = "http://ccpay-bulkscanning-api-prod.service.core-compute-prod.internal"
        }
      + resource_group_name = "cft-prod-network-rg"
      + template_body       = jsonencode(
            {
              + "$schema"      = "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#"
              + contentVersion = "1.0.0.0"
              + parameters     = {
                  + apiBasePath              = {
                      + metadata = {
                          + description = "Path to the API (excluding host)"
                        }
                      + type     = "string"
                    }
                  + apiManagementServiceName = {
                      + metadata = {
                          + description = "API Management service name"
                        }
                      + type     = "string"
                    }
                  + apiName                  = {
                      + metadata = {
                          + description = "Name of the API (gateway)"
                        }
                      + type     = "string"
                    }
                  + apiProductName           = {
                      + metadata = {
                          + description = "API Management product name"
                        }
                      + type     = "string"
                    }
                  + policy                   = {
                      + type = "string"
                    }
                  + serviceUrl               = {
                      + metadata = {
                          + description = "URL of the backend service (to be protected by the API)"
                        }
                      + type     = "string"
                    }
                }
              + resources      = [
                  + {
                      + apiVersion = "2017-03-01"
                      + dependsOn  = []
                      + name       = "[concat(parameters('apiManagementServiceName') ,'/', parameters('apiProductName'))]"
                      + properties = {
                          + approvalRequired     = true
                          + displayName          = "[parameters('apiProductName')]"
                          + state                = "published"
                          + subscriptionRequired = true
                        }
                      + type       = "Microsoft.ApiManagement/service/products"
                    },
                  + {
                      + apiVersion = "2017-03-01"
                      + dependsOn  = [
                          + "[resourceId('Microsoft.ApiManagement/service/products', parameters('apiManagementServiceName'), parameters('apiProductName'))]",
                        ]
                      + name       = "[concat(parameters('apiManagementServiceName') ,'/', parameters('apiProductName'), '/', variables('developersGroupName'))]"
                      + properties = {
                          + builtIn     = true
                          + description = "Developers group"
                          + displayName = "Developers"
                          + type        = "system"
                        }
                      + type       = "Microsoft.ApiManagement/service/products/groups"
                    },
                  + {
                      + apiVersion = "2017-03-01"
                      + dependsOn  = [
                          + "[variables('fullApiProductName')]",
                        ]
                      + name       = "[concat(parameters('apiManagementServiceName'), '/', parameters('apiName'))]"
                      + properties = {
                          + displayName = "bulk-scanning payments API"
                          + path        = "[parameters('apiBasePath')]"
                          + protocols   = [
                              + "HTTPS",
                            ]
                          + serviceUrl  = "[parameters('serviceUrl')]"
                        }
                      + resources  = [
                          + {
                              + apiVersion = "2017-03-01"
                              + dependsOn  = [
                                  + "[variables('fullApiName')]",
                                ]
                              + name       = "bulk-scanning-payments-api"
                              + properties = {
                                  + description = "Insert payment data from scanning third party"
                                  + displayName = "bulk-scanning payments api "
                                  + method      = "POST"
                                  + request     = {
                                      + description     = "Used by third party scanning service to insert payments data in Bulk-scanning service"
                                      + representations = [
                                          + {
                                              + contentType = "application/json"
                                              + parameters  = [
                                                  + {
                                                      + description = "BulkScanPayment"
                                                      + in          = "body"
                                                      + name        = "bulkScanPayment"
                                                    },
                                                ]
                                            },
                                        ]
                                    }
                                  + responses   = [
                                      + {
                                          + description = "Created"
                                          + statusCode  = 201
                                        },
                                      + {
                                          + description = "Request failed due to malformed syntax"
                                          + statusCode  = 400
                                        },
                                      + {
                                          + description = "Failed authentication"
                                          + statusCode  = 401
                                        },
                                      + {
                                          + description = "Failed authorisation"
                                          + statusCode  = 403
                                        },
                                      + {
                                          + description = "Conflict"
                                          + statusCode  = 409
                                        },
                                    ]
                                  + urlTemplate = "/bulk-scan-payment"
                                }
                              + type       = "operations"
                            },
                        ]
                      + type       = "Microsoft.ApiManagement/service/apis"
                    },
                  + {
                      + apiVersion = "2017-03-01"
                      + dependsOn  = [
                          + "[variables('fullApiProductName')]",
                          + "[variables('fullApiName')]",
                        ]
                      + name       = "[concat(parameters('apiManagementServiceName'), '/', parameters('apiProductName'), '/', parameters('apiName'))]"
                      + type       = "Microsoft.ApiManagement/service/products/apis"
                    },
                  + {
                      + apiVersion = "2017-03-01"
                      + dependsOn  = [
                          + "[variables('fullApiProductName')]",
                          + "[variables('fullApiName')]",
                        ]
                      + name       = "[concat(parameters('apiManagementServiceName'), '/', parameters('apiName'),'/policy')]"
                      + properties = {
                          + policyContent = "[parameters('policy')]"
                        }
                      + type       = "Microsoft.ApiManagement/service/apis/policies"
                    },
                ]
              + variables      = {
                  + developersGroupName = "Developers"
                  + fullApiName         = "[concat('Microsoft.ApiManagement/service/', parameters('apiManagementServiceName'), '/apis/', parameters('apiName'))]"
                  + fullApiProductName  = "[concat('Microsoft.ApiManagement/service/', parameters('apiManagementServiceName'), '/products/', parameters('apiProductName'))]"
                }
            }
        )
    }

Plan: 1 to add, 0 to change, 0 to destroy.

@davejones74 davejones74 marked this pull request as draft June 14, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants