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

Must pass ID but it is read-only #2

Open
neuroretransmit opened this issue Jun 10, 2024 · 2 comments
Open

Must pass ID but it is read-only #2

neuroretransmit opened this issue Jun 10, 2024 · 2 comments

Comments

@neuroretransmit
Copy link

neuroretransmit commented Jun 10, 2024

Hello, I'm trying to use this against my porkbun domain but am having issues.

resource "porkbun_dns_record" "root" {
  domain = "deadman.wtf"
  name = "*"
  type = "CNAME"
  content = "pixie.porkbun.com"
  ttl = 600
  priority = 1
  notes = "Root record deadman.wtf"
}

resource "porkbun_dns_record" "www" {
  domain = "deadman.wtf"
  name = "www"
  type = "CNAME"
  content = "pixie.porkbun.com"
  ttl = 600
  priority = 1
  notes = "Redirect www.deadman.wtf to deadman.wtf"
}

resource "porkbun_dns_record" "proton" {
  domain = "deadman.wtf"
  name = "@"
  type = "TXT"
  content = "protonmail-verification=REDACTED"
  ttl = 600
  priority = 1
  notes = "Protonmail domain verification"
}
r3p0m4n@fedora:~/git/__new__/deadman/terraform$ terraform apply
╷
│ Error: Invalid Configuration for Read-Only Attribute
│ 
│   with porkbun_dns_record.root,
│   on record.tf line 2, in resource "porkbun_dns_record" "root":
│    2:   id = 0
│ 
│ Cannot set value for this attribute as the provider has marked it as read-only. Remove the configuration line setting the value.
│ 
│ Refer to the provider documentation or contact the provider developers for additional information about configurable and read-only attributes that are supported.
╵
╷
│ Error: Invalid Configuration for Read-Only Attribute
│ 
│   with porkbun_dns_record.www,
│   on record.tf line 13, in resource "porkbun_dns_record" "www":
│   13:   id = 1
│ 
│ Cannot set value for this attribute as the provider has marked it as read-only. Remove the configuration line setting the value.
│ 
│ Refer to the provider documentation or contact the provider developers for additional information about configurable and read-only attributes that are supported.
╵
╷
│ Error: Invalid Configuration for Read-Only Attribute
│ 
│   with porkbun_dns_record.proton,
│   on record.tf line 24, in resource "porkbun_dns_record" "proton":
│   24:   id = 2
│ 
│ Cannot set value for this attribute as the provider has marked it as read-only. Remove the configuration line setting the value.
│ 
│ Refer to the provider documentation or contact the provider developers for additional information about configurable and read-only attributes that are supported.

@kyswtn
Copy link
Owner

kyswtn commented Jun 13, 2024

I see you've updated your code and removed the problematic id fields. The new configuration should resolve the error. Are there any other issues? If not, I'll close this ticket.

@neuroretransmit
Copy link
Author

You can close it. I got this worked out. I have another but I'll open in another ticket. Failed destroys end badly

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

No branches or pull requests

2 participants