Comments (3)
You don't need the data source in the first example. It is never used. You only need the data source if the corresponding resource is created in another project.
resource "hetznerdns_zone" "example_at" {
name = "example.at"
ttl = 3600
}
resource "hetznerdns_record" "example_at" {
zone_id = hetznerdns_zone.example_at.id
name = "@"
value = "127.0.0.1"
type = "A"
ttl= 3600
}
Above I copied and modified your code. Terraform uses the reference to hetznerdns_zone.example_at.id
to determine the order in this resources are being created. Without the reference it might create the record before the zone, which would result in errors.
from terraform-provider-hetznerdns.
Hey @c33s! Have you tried removing the data source? It is not used in the code you provided and I think you can just remove it. I'll close this issue. Please reopen if you still need the data source.
from terraform-provider-hetznerdns.
the ticket isn't about the datasource, yes i included the datasource as it was in the example in the docs but it's of course not required.
this ticket is about the requirement to access a zone over a id instead of it's name. a zones name is unique, so why not access it via its name. see the zone
instead of the zone_id
resource "hetznerdns_record" "example_at" {
zone_id = "${hetznerdns_zone.example_at.id}"
name = "@"
value = "127.0.0.1"
type = "A"
ttl= 3600
}
resource "hetznerdns_record" "example_at" {
zone = "example.at"
name = "@"
value = "127.0.0.1"
type = "A"
ttl= 3600
}
internally the provider could fetch the zone ids over the datasource (and maybe cache them?) and let the developer access the zones by their real name. it's a general hetzner problem that there are sometimes unneeded ids instead of the real unique identifieres of a resource (like the name of a zone for dns or the fingerprint of an ssh key . for accessing those resources we have to make our way trough datasources even if we already have or know a unique id).
from terraform-provider-hetznerdns.
Related Issues (20)
- Fake or real ALIAS record support HOT 3
- dot or no dot HOT 1
- How to handle SOA entries? HOT 2
- Suggestion: Provide constants for Hetzner nameservers HOT 2
- Suggestion: Support IDNs HOT 2
- Please support arm64 architecture HOT 2
- Issues working with wildcard DNS HOT 2
- Error: Error creating DNS record ...: Error creating record ...: API returned HTTP 422 Unprocessable Entity error with message: '409 Conflict: ' HOT 18
- Cannot update to 1.2.0: Failed to query available provider packages HOT 5
- DNS record will not be destroyed, when DNS zone has the prevent_destroy flag HOT 1
- Example for handling SRV records HOT 1
- Suggestion: Hand over the project to https://github.com/hetznercloud GitHub organization HOT 5
- Add the ability to manage primary servers HOT 3
- Hitting rate limit (without hitting it) HOT 3
- Convert list of values to multiple records
- terraform apply randomly gets stuck with "Still creating" HOT 12
- Long TXT value is getting recreated upon `terraform apply` HOT 9
- add data source hetznerdns_records HOT 1
- How to increase timeouts & retries? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-hetznerdns.