upjet icon indicating copy to clipboard operation
upjet copied to clipboard

Usage of dots in metadata.name errors at Terraform level

Open turkenh opened this issue 3 years ago • 3 comments

What happened?

We are getting errors from Terraform if the metadata.name contains dots, e.g. example.com, since we use the same to name the terraform resource name which does not accept dots in the name.

Note users would see this during runtime.

How can we reproduce it?

Create an upjet generated MR with name dots inside.

Possible Fixes

Not use metadata.name in cases where it would break. We need to be careful with the upgrade process.

turkenh avatar Nov 28 '22 07:11 turkenh

https://github.com/upbound/provider-azure/issues/71

tomasfreund avatar Jan 03 '23 08:01 tomasfreund

Hello! this blocks usage of subdomains in the record name, which are obviously separated by the dots. I was planning to migrate from the Terraform resource azurerm_private_dns_a_record to Crossplane PrivateDNSARecord. This fails with error:

observe failed: cannot run refresh: refresh failed: Invalid resource name: A name must start with a letter or underscore and may contain only letters, digits, underscores, and dashes

PowerSurj avatar Sep 07 '23 07:09 PowerSurj

@PowerSurj, you can use external-name annotation to mitigate the problem:

metadata:
  name: example
  annotations:
    crossplane.io/external-name: subdomain.example.com

ytsarev avatar Sep 07 '23 23:09 ytsarev