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

Refactor mapping file #223

Closed
stemaMSFT opened this issue Sep 14, 2022 · 2 comments · Fixed by #234
Closed

Refactor mapping file #223

stemaMSFT opened this issue Sep 14, 2022 · 2 comments · Fixed by #234
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@stemaMSFT
Copy link
Member

Refactoring mapping file to consist of JSON objects defined by their azure resourceID. They'd have two properties: tf_type and tf_name

@magodo magodo added the enhancement New feature or request label Sep 14, 2022
@stemaMSFT stemaMSFT modified the milestones: 0.7.0, 0.8.0 Sep 20, 2022
@magodo
Copy link
Collaborator

magodo commented Sep 22, 2022

@stemaMSFT So the proposed format is as below:

{
  "tf_id": {
    "resource_type": xxx,
    "resource_name": xxx
  }
}

While I'd like to change this a bit to something like below:

{
  "azure_id": {
    "resource_id": xxx,
    "resource_type": xxx,
    "resource_name": xxx
  }
}

azure_id is the azure resource id, in upper case (since RP tends to change the casing and azure is actually case insensitive for resource id). resource_id is the Terraform resource id (case sensitive). In most case, both are the same regardless the casing. For the other cases, they might be different.

The reason why using the azure_id as the object key here rather than the tf id is that there are resources that have different azure_id, but they have the same tf ids. E.g.

  • azurerm_subnet_network_security_group_association and azurerm_subnet
  • azurerm_postgresql_active_directory_administrator is a singleton child resource of azurerm_postgresql_server, but their tf ids are the same

WDYT?

@stemaMSFT
Copy link
Member Author

Hey @magodo, I think we're on the same page here :) I was trying to say that I wanted the azure_id to be the outside property, which is exactly what you have (I didn't think of the terraform ID, but I think that's a wonderful addition). Good to know that you have it upper case since I saw from your conversation about the issues with case sensitivity in the ARG API. Complete supportfrom my end!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants