ably / terraform-provider-ably

Ably's Terraform Provider, enabling you to manage your Ably account programmatically.
https://registry.terraform.io/providers/ably/ably
Apache License 2.0
11 stars 2 forks source link

Implement Ably Rule Resource with Azure Functions Target #117

Closed graham-russell closed 2 years ago

graham-russell commented 2 years ago

This PR includes the following items

graham-russell commented 2 years ago

I'll rebase off of #113 when it's merged to main.

graham-russell commented 2 years ago

Also note that I haven't included the enveloped parameter for the Azure function because I receive the following error when it's included:

Screenshot 2022-09-21 at 11 11 10
Morganamilo commented 2 years ago

Also note that I haven't included the enveloped parameter for the Azure function because I receive the following error when it's included: Screenshot 2022-09-21 at 11 11 10

Try batch mode :P

kavalerov commented 2 years ago

We should probably raise that behaviour as a Control API and web bug with the web team as well.

graham-russell commented 2 years ago

Also note that I haven't included the enveloped parameter for the Azure function because I receive the following error when it's included: Screenshot 2022-09-21 at 11 11 10

Try batch mode :P

Tried with batch mode again to confirm and still received the error. Using the following terraform template

resource "ably_rule_azure_function" "rule0" {
  app_id = ably_app.app0.id
  status = "enabled"
  source = {
    channel_filter = "^my-channel.*",
    type           = "channel.message"
  }
  request_mode = "batch"
  target = {
    azure_app_id  = "coms",
    function_name = "function0"
    headers = [
      {
        name : "User-Agent",
        value : "user-agent-string",
      },
      {
        name : "User-Agent-Extra",
        value : "user-agent-string",
      },
    ]
    signing_key_id = ably_api_key.api_key_1.id
    format         = "json"
    enveloped = true
  }
}
Morganamilo commented 2 years ago

So maybe this one doesn't support enveloped at all either way? hmm

graham-russell commented 2 years ago

So maybe this one doesn't support enveloped at all either way? hmm

Yeah, I'll track this down and figure out what's happening. The documentation included 'enveloped' as a param but it definitely fails with including in regardless of the request mode.

For now I'd suggest we review this without enveloped and then submit a follow up PR depending on the feedback we get from the team.

Morganamilo commented 2 years ago

In my current PR i moved the header loop to it's own function. I'll have to rebase that PR after this merges.