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

The resource 'azurecaf_name' is generating error for the 'azurerm_shared_image_gallery' type. #54

Closed
benhurjoel opened this issue Oct 19, 2020 · 5 comments
Assignees

Comments

@benhurjoel
Copy link
Contributor

I'm trying to generate a name for a Shared Image Gallery using azurecaf_name. My code as follows:

resource "azurecaf_name" "sig_name" {
  for_each =  local.shared_services.shared_image_gallery.galleries
  name          = each.value.name
  prefixes      = [local.global_settings.prefix]
  resource_type = "azurerm_shared_image_gallery"
  random_length = local.global_settings.random_length
  clean_input   = true
  passthrough   = local.global_settings.passthrough
}

I'm getting the following error:

Error: Invalid name for CAF naming azurerm_shared_image_gallery test1, the pattern ^[a-zA-Z0-9][a-zA-Z0-9.]{0,78}[a-zA-Z0-9]$ doesn't match

screen-cap:

image

Please advise.

@benhurjoel
Copy link
Contributor Author

Shared Image Gallery name limitations:

  • The value must be between 1 and 80 characters long
  • cannot contain special characters /""[]:|<>+=;,?*@& or begin with '_' or end with '.' or '-'.
  • cannot contain hyphen (-) but can have underscore.

image

@Nepomuceno
Copy link
Contributor

Nepomuceno commented Oct 19, 2020 via email

@benhurjoel
Copy link
Contributor Author

The values I supply for the Shared Image Gallery goes like this:

shared_image_gallery = {

  galleries = {
    gallery1 ={
      name = "test1"
      resource_group_key = "sig"
      description = " "
    }
    gallery2 = {
      name = "test2"
      resource_group_key = "sig2"
      description = " "
    }
  }

Prefixes are derived from Launchpad global settings.

@arnaudlh arnaudlh linked a pull request Nov 13, 2020 that will close this issue
@benhurjoel
Copy link
Contributor Author

Thank you @arnaudlh and @Nepomuceno . #69 fixed it.

@arnaudlh
Copy link
Member

Closing as fixed in #69

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

Successfully merging a pull request may close this issue.

3 participants