Closed eljoth closed 5 months ago
Hi @eljoth. Thanks for raising an issue here. We'll take a look as soon as we can.
@iwahbe Were you able to repro the issue and provide some ideas for workarounds or possible fixes?
I wasn't able to repro. Running the program given yields:
civo:index:DnsDomainRecord (74.220.31.244):
error: 1 error occurred:
* [ERR] failed to create a new domain record: DatabaseDNSDomainNotFoundError: Failed to find that DNS domain name in the internal database
Our last release included some changes to how we do diffs. @eljoth is the issue still present on v2.3.16?
@eljoth if the problem persists, can you post a pulumi program that we can run in our Civo account to reproduce the issue?
I am using the new version v2.3.16. Running the program still results in the same error.
@iwahbe the updated code you can run is as follows (domainName creation was missing in the upper example)
import (
civosdk "github.com/pulumi/pulumi-civo/sdk/v2/go/civo"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
domainName, err := civosdk.NewDnsDomainName(ctx, "test", &civosdk.DnsDomainNameArgs{
Name: pulumi.String("bringalong.io"),
},
)
if err != nil {
return err
}
if _, err := civosdk.NewDnsDomainRecord(ctx, "74.220.31.244", &civosdk.DnsDomainRecordArgs{
Ttl: pulumi.Int(600),
Type: pulumi.String("A"),
DomainId: domainName.ID(),
Name: pulumi.String("api-stg.bringalong.io"),
Value: pulumi.String("74.220.31.244"),
}); err != nil {
return err
}
return nil
})
}
I also investigated the issue with @praneetloke and we could not figure out the issue.
Hi @eljoth - thank you for the new program.
I also get a diff on preview and then an error on the second pulumi up
after running your code. I changed the Name
field to a different record but that's all.
However, my error is different:
The above code in Terraform presents the same error.
I cannot reproduce your particular error -
however I noticed from the details
output that the provider was attempting to rename
"api-stg" => "api-stg.civofourseveneight.io"
.
It appears as though DnsDomainRecordArgs.Name
cannot contain any .
characters, and the initially supplied name of api-stg.civofourseveneight.io
is in fact quietly truncated to api-stg
somewhere, resulting in a diff every time you try to run pulumi up
.
When I set DnsDomainRecordArgs.Name
to "hello"
there was no diff on the second pulumi up
. Can you try something like this? The docs say the Name value corresponds to the part before the domain name.
Please let us know if this helps!
HI @guineveresaenger, changing the name to only contain the subdomain instead of the whole DNS Name it works great. Thanks for the hint!
Even though I obviously did not read the docs correctly, is this a candidate for validation improvement? If that's the case, I can leave this issue open, otherwise I will close it.
Brilliant! Thank you, @guineveresaenger! By the way, I do have one comment though:
however I noticed from the details output that the provider was attempting to rename "api-stg" => "api-stg.civofourseveneight.io".
I don't think we were seeing this diff or we definitely would have noticed what was going on. Here's a link to the pulumi preview --diff
from when @eljoth reported this on Slack: https://pulumi-community.slack.com/archives/C01PF3E1B8V/p1714293493171259?thread_ts=1714162691.564549&cid=C01PF3E1B8V
Yay! I'm glad you're unblocked. 🎉
@praneetloke - I do actually see this diff on my end. on pulumi preview --diff
:
guin repros/civo-478🦉 pulumi preview --diff
Previewing update (dev)
View Live: https://app.pulumi.com/guinevere-pulumi-corp/civo-478/dev/previews/8fe4be12-6172-43b5-af79-d3997033233b
pulumi:pulumi:Stack: (same)
[urn=urn:pulumi:dev::civo-478::pulumi:pulumi:Stack::civo-478-dev]
~ civo:index/dnsDomainRecord:DnsDomainRecord: (update)
[id=93e306eb-88e9-46a3-b501-4b0ff0fbcc61]
[urn=urn:pulumi:dev::civo-478::civo:index/dnsDomainRecord:DnsDomainRecord::74.220.31.244]
~ name: "api-stg" => "api-stg.civofourseveneight.io"
Resources:
~ 1 to update
2 unchanged
But again, I don't have an exact repro for what you saw.
@eljoth - I agree validation can be better here. This would be a fix on the upstream Terraform provider. I'm going to file an issue there and mark this issue as awaiting upstream. 👍
upstream issue: https://github.com/civo/terraform-provider-civo/issues/211
@guineveresaenger ah I think perhaps there was a bug in the CLI display (or TF bridge maybe?) that has been fixed since the time @eljoth and I were looking into this. I think it may have been 3.113.0 perhaps that he was on. Everything else was latest at the time then.
What happened?
I am provisioning my CIVO cloud infrastructure via Pulumi. On the first run, everything works fine, including provisioning of my DNS Name as well as its record.
Without changing the code, running
pulumi up
again, I get the following error:A
pulumi preview --diff
shows no changes:Example
Output of
pulumi about
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).