Git Product home page Git Product logo

terraform-provider-namep's Introduction

Name Provider for Terraform

The goal of this provider is to allow users to create names in a pre-defined format to help standardize them across their landscape.

Maintainers

This provider plugin is currently maintained by the Jason Johnson.

Requirements

Installation

This provider is automatically installed when you run terraform init on a configuration using the provider.

Quick Starts

Documentation

Documentation can be found on the Terraform Website.

terraform-provider-namep's People

Contributors

jason-johnson avatar dependabot[bot] avatar

Stargazers

 avatar Andre Bossard avatar Petteri Johansson avatar

Watchers

 avatar  avatar

terraform-provider-namep's Issues

Allow providing own alternative slugs and short names for locations.

It would be practical for users not following Microsoft convetions to be able to provide alternative location and slug definitions in provider.

Something like
provider "namep" {
default_location = var.location
location_custom = [
{
region = "Africa"
name = "South Africa North"
azName = "southafricanorth"
short_name_1: "Sfn"
}
]
default_nodash_name_format = "I#{SLUG}#{SHORT_LOC}#{NAME}"
default_resource_name_format = "#{SLUG}-#{SHORT_LOC}-#{NAME}"
}

We can also discuss if you would accept this as a PR (after ironing out the design issues).

resource type unknown to provide despite using custom_resource_formats / azure_resource_formats

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Terraform v1.7.3
on linux_amd64
+ provider registry.terraform.io/databricks/databricks v1.33.0
+ provider registry.terraform.io/hashicorp/azuread v2.47.0
+ provider registry.terraform.io/hashicorp/azurerm v3.91.0
+ provider registry.terraform.io/jason-johnson/namep v1.1.1

Affected Resource(s)

  • azurerm_databricks_access_connector
  • databricks_storage_credential

relevant tf code:

provider "namep" {
  default_location             = local.location
  default_resource_name_format = "#{SLUG}-#{NAME}-#{PLATFORM}-#{ENVIRONMENT}-#{ALT_SHORT_LOC}"
  default_nodash_name_format   = "#{SLUG}#{NAME}#{PLATFORM}#{ENVIRONMENT}#{ALT_SHORT_LOC}"
  # name customizations
  extra_tokens                 = {
    platform    = local.platform
    environment = var.environment_short
  }

  azure_resource_formats = {
    azurerm_storage_account             = "sa#{NAME}#{PLATFORM}#{ENVIRONMENT}#{ALT_SHORT_LOC}"
    azurerm_resource_group              = "#{SLUG}-#{NAME}-#{PLATFORM}-#{ENVIRONMENT}-#{ALT_SHORT_LOC}"
    azurerm_application_insights        = "ai-#{NAME}-#{PLATFORM}-#{ENVIRONMENT}-#{ALT_SHORT_LOC}"
    azurerm_log_analytics_workspace     = "la-#{NAME}-#{PLATFORM}-#{ENVIRONMENT}-#{ALT_SHORT_LOC}"
    azurerm_subnet                      = "sn-#{NAME}-#{PLATFORM}-#{ENVIRONMENT}-#{ALT_SHORT_LOC}"
    azurerm_virtual_network             = "#{SLUG}-#{PLATFORM}-#{ENVIRONMENT}-#{ALT_SHORT_LOC}"
    instance_suffix                     = "#{ENVIRONMENT}-#{ALT_SHORT_LOC}"
    azurerm_databricks_access_connector = "dbac-#{NAME}-#{PLATFORM}-#{ENVIRONMENT}-#{ALT_SHORT_LOC}"
  }

  custom_resource_formats = {
    databricks_storage_credential = "dbsc-#{NAME}-#{PLATFORM}-#{ENVIRONMENT}-#{ALT_SHORT_LOC}"
  }

}

data "namep_azure_name" "dbrk_store_cred_adls_name" {
  name = "adls"
  type = "databricks_storage_credential"
}

data "namep_azure_name" "dbrk_access_connector_adlsext"  {
  type = "azurerm_databricks_access_connector"
  name = "adlsext"
}

Expected Behavior

namep should be able to provide a name for the resources, as they have been registered explicitly in the provider config

Actual Behavior

namep throws the following errors during terraform plan:

╷
│ Error: resource type
│
│   with data.namep_azure_name.dbrk_access_connector_adlsext,
│   on databricks_10_connectors.tf line 20, in data "namep_azure_name" "dbrk_access_connector_adlsext":
│   20: data "namep_azure_name" "dbrk_access_connector_adlsext"  {
│
│ resource type "azurerm_databricks_access_connector" unknown to provider
╵
╷
│ Error: resource type
│
│   with data.namep_azure_name.dbrk_store_cred_adls_name,
│   on databricks_10_connectors.tf line 144, in data "namep_azure_name" "dbrk_store_cred_adls_name":
│  144: data "namep_azure_name" "dbrk_store_cred_adls_name" {
│
│ resource type "databricks_storage_credential" unknown to provider

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.