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

rgOverride Doesn't Support Expressions #93

Closed
bdschaap opened this issue Jul 2, 2019 · 2 comments
Closed

rgOverride Doesn't Support Expressions #93

bdschaap opened this issue Jul 2, 2019 · 2 comments

Comments

@bdschaap
Copy link
Contributor

bdschaap commented Jul 2, 2019

The Bake schema documentation indicates that expressions are supported for rgOverride. However, I'm receiving the error message below when specifying the following expression for an event hub recipe. Specifically, I am trying to deploy an event hub within an event hub namespace defined in a different recipe. Note that event hubs must be created in the same resource group as the event hub namespace in Azure. Would appreciate any suggested workarounds as well.

rgOverride: "[coreutils.resource_group('product')]"

[Tue, 02 Jul 2019 19:54:28 GMT] Downloading ingredients...
[Tue, 02 Jul 2019 19:54:28 GMT] - @azbake/ingredient-event-hub
[Tue, 02 Jul 2019 19:54:30 GMT] Ingredients loaded
[Tue, 02 Jul 2019 19:54:30 GMT] logging into azure...
RangeError

@bdschaap
Copy link
Contributor Author

bdschaap commented Jul 2, 2019

I came up with a temporary workaround where I give the event hub's recipe the same short name as the event hub namespace's recipe. Not ideal but it works for now. Example -

shortName: myeventhubnamespace
version: 0.0.1
ingredients:
  - "@azbake/ingredient-event-hub"
parallelRegions: true
resourceGroup: false
recipe:
  eh-deploy: 
    properties:
      #Specify the Bake ingredient above
      type: "@azbake/ingredient-event-hub"
      source: ""
      parameters:        
        eventHubName: "[eventhub.create_resource_name('myeventhub')]"        
        eventHubNamespaceName: "[coreutils.get_event_hub_namespace_name('myeventhubnamespace')]"
        messageRetentionInDays: "1"
        partitionCount: "2"
        policyName: "defaultPolicy"

@whilke
Copy link
Member

whilke commented Jul 26, 2019

You're creating a stack overflow since coreutils.resource_group tries to eval rgOveride..which loops until it dies. There is a new rgOverride pattern you can use to solve this.

whilke added a commit that referenced this issue Jul 26, 2019
fix: changing resource group naming schema

fix: adding support for a region-less RG name create set: rgOverride: "[coreutils.resource_group(null,false,null,true)]"
@whilke whilke closed this as completed Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants