mineiros-io / terraform-github-repository

A Terraform module to manage GitHub Repositories. https://github.com/
Apache License 2.0
159 stars 105 forks source link

repo_id attribute from github_repository resource not generated #164

Open neilharris123 opened 1 year ago

neilharris123 commented 1 year ago

As explained here all attributes from the github_repository resource should be exported by the module.
There is an attribute on the github_repository documentation named repo_id.

However, when I create a github repository with the mineiros-io module, this repo_id attribute does not exist. For example, my attributes look something like this:

{
  "attributes": {
    "allow_merge_commit": true,
    "allow_rebase_merge": true,
    "allow_squash_merge": true,
    "archived": false,
    "auto_init": false,
    "default_branch": "master",
    "delete_branch_on_merge": false,
    "description": "",
    "etag": "W/\"b62fa29d48ada996cea8f6f4742c81c0c62b21256e886a72a356089eb57077c4\"",
    "full_name": "exampleorg/repo-anonymized",
    "git_clone_url": "git://github.com/exampleorg/repo-anonymized.git",
    "gitignore_template": null,
    "has_downloads": true,
    "has_issues": true,
    "has_projects": false,
    "has_wiki": true,
    "homepage_url": "",
    "html_url": "https://github.com/exampleorg/repo-anonymized",
    "http_clone_url": "https://github.com/exampleorg/repo-anonymized.git",
    "id": "repo-anonymized",
    "is_template": false,
    "license_template": null,
    "name": "repo-anonymized",
    "node_id": "MDEwOlJlcG9zaXRvcnk3NDU4OTg4NQ==",
    "private": true,
    "ssh_clone_url": "git@exampleorg/repo-anonymized.git",
    "svn_url": "https://github.com/exampleorg/repo-anonymized",
    "template": [],
    "topics": [],
    "visibility": "private"
  }
}

Is there any reason this one attribute is not generated by the module?

shinenelson commented 1 year ago

I tried to reproduce the issue, but I was unable to. What I tried was to export the module's output as an output from my root module. Also, listing module.<module-name>.repository from the terraform console gave the expected output.

Can you confirm whether you have the attribute when you create a resource without using the module? If not, then it might be an issue with the upstream provider.

Also, could you please mention the version of the provider that you are using?

shinenelson commented 1 year ago

I just noticed that you had an attributes key in the output you pasted. Also, the output does not have other attributes like archive_on_destroy, has_discussions, pages, security configuration, merge configuration, etc. That seems odd.

Can you also provide a sample configuration of how you are attempting to access the attribute?