terraform-provider-github
terraform-provider-github copied to clipboard
[BUG]: `archive_on_destroy=true` is not honored for imported repositories
Expected Behavior
When importing a repository using an import
statement, the respective repository should have archive_on_destroy
set to the value configured in the terraform configuration it is imported to.
Actual Behavior
archive_on_destroy
is ignored, and its default value remains in the state instead.
Terraform Version
TF: v1.8.1 GH Provider: 6.2.3
Affected Resource(s)
- github_repository
Terraform Configuration Files
variable "repository" {
type = string
}
import {
id = var.repository
to = github_repository.this
}
resource "github_repository" "this" {
name = var.repository
archive_on_destroy = true
}
Steps to Reproduce
- Create a repository manually via WebUI or API
- Run
terraform apply -var='repository=<created-repo-name>'
- Run
terraform destroy
- repository is deleted, not archived
Debug Output
No response
Panic Output
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct