question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DNS-zone target_resource wrong parameter type?

See original GitHub issue
    let dns = dnsZone {
        name "myZone"
        zone_type Dns.Public
        add_records [
            aRecord {
                ttl 60
                target_resource trafficMgr.Name
            }
            yield!
                [ "de"; "es";"fr"; "it" ]
                |> List.map (fun nm ->
                    cnameRecord {
                        name nm
                        ttl 3600
                        target_resource trafficMgr.Name
                    }
                )
        ]
    }

Fails for:

  "error": {
    "code": "LinkedInvalidPropertyId",
    "message": "Property id 'myTrafficManager' at path 'properties.targetResource.id' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'."
  }

…so I expect the target_resource should take ResourceId instead of the current ResourceName

  "properties": {
      "TTL": 123,
      "targetResource": {
          "id": "/subscriptions/.../resourcegroups/.../providers/microsoft.network/trafficmanagerprofiles/myTrafficManager"
      }
  }

Also the traffic manager itself doesn’t have a simple Id property, so I expect it has to be created with something like (ResourceId.create(Farmer.Arm.TrafficManager.profiles, trafficMgr.Name))

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:21 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
ninjarobotcommented, Jul 21, 2021

@Thorium I think the resourceId expression is failing because the name segments in the CNAME subresource have to be separated.

instead of

resourceId('Microsoft.Network/dnsZones/CNAME', 'mytest.com/dk')

use this

resourceId('Microsoft.Network/dnsZones/CNAME', 'mytest.com’, ‘dk')
0reactions
ninjarobotcommented, Jul 23, 2021

This will be fixed by #704 by enabling passing resourceId and builders to target_resource on DNS record builders.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DNS-zone target_resource wrong parameter type?
let dns = dnsZone { name "myZone" zone_type Dns.Public add_records [ aRecord {... ... targetResource.id' is invalid.
Read more >
Azure DNS zone · Issue #270 · CompositionalIT/farmer
This is kind of related to #168 because Azure Traffic Managers seems to work best ... This is an ARM-template example for a...
Read more >
Tests/xDnsServerPrimaryZone.Tests.ps1 1.5.0.0
Context 'Validates Get-TargetResource Method' { ... Hashtable" object type' { ... It 'Returns "Absent" when DNS zone does not exists and "Ensure" ...
Read more >
Record Sets - Create Or Update - REST API (Azure DNS)
Creates or updates a record set within a DNS zone. In this article. URI Parameters; Request Header; Request Body; Responses; Examples; Definitions. HTTP...
Read more >
How to create DNS A Record usin Azure CLI or Terraform
You could create an empty A record with --target-resource which points ... variable "target_ip" { type = str description = "Target Resource ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found