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

DNSimple Static Config Ignored in dotnet #5043

Open
drusellers opened this issue Jul 27, 2024 · 3 comments
Open

DNSimple Static Config Ignored in dotnet #5043

drusellers opened this issue Jul 27, 2024 · 3 comments
Labels
area/api-docs Generated API docs, generated from providers. For hand-written docs, see area/docs. area/docs Hand-written documentation. For api docs, see area/api-docs. kind/bug Some behavior is incorrect or out of spec

Comments

@drusellers
Copy link

What happened?

I was starting my Pulumi adventure and wanted to see if I could automate some DNS stuff in DNSimple. Because I'm just starting I didn't really want to muck around with ENV VAR so I thought I could use some kind of static configuration. I found Pulumi.DNSimple.Config and thought I could set those values. Alas, they weren't respected and had to revert to ENV VAR.

Example

using Pulumi;
using Pulumi.DNSimple;

return await Deployment.RunAsync(() =>
{
    Pulumi.DNSimple.Config.Account = "000000";
    Pulumi.DNSimple.Config.Token = "dnsimple_u_....";

    var record = new ZoneRecord("test-record", new ZoneRecordArgs()
    {
        Name = "pulumi",
        Type = "TXT",
        Value = "Hello",
        ZoneName = "twosix.io",
    });
});

Output of pulumi about

❯ pulumi about
running 'dotnet build -nologo .'
  Determining projects to restore...

  All projects are up-to-date for restore.

  groundwork -> /Users/drusellers/dev/altas/groundwork/bin/Debug/net6.0/groundwork.dll



Build succeeded.

    0 Warning(s)
    0 Error(s)



Time Elapsed 00:00:01.07

'dotnet build -nologo .' completed successfully
CLI
Version      3.127.0
Go Version   go1.22.5
Go Compiler  gc

Plugins
KIND      NAME      VERSION
resource  aws       6.47.0
resource  dnsimple  4.0.0
language  dotnet    unknown

Host
OS       darwin
Version  14.5
Arch     arm64

This project is written in dotnet: executable='/usr/local/share/dotnet/dotnet' version='8.0.201'

Current Stack: drusellers/groundwork/dev

TYPE                                  URN
pulumi:pulumi:Stack                   urn:pulumi:dev::groundwork::pulumi:pulumi:Stack::groundwork-dev
pulumi:providers:dnsimple             urn:pulumi:dev::groundwork::pulumi:providers:dnsimple::default_4_0_0
dnsimple:index/zoneRecord:ZoneRecord  urn:pulumi:dev::groundwork::dnsimple:index/zoneRecord:ZoneRecord::test-record


Found no pending operations associated with dev

Backend
Name           pulumi.com
URL            https://app.pulumi.com/drusellers
User           drusellers
Organizations  drusellers
Token type     personal

Dependencies:
NAME             VERSION
Pulumi           3.65.0
Pulumi.Aws       6.47.0
Pulumi.DNSimple  4.0.0

Pulumi locates its logs in /var/folders/_c/6jq351xs0s7_drpbxpph56y00000gn/T/ by default

Additional context

I think that is everything.

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).

@drusellers drusellers added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jul 27, 2024
@github-project-automation github-project-automation bot moved this to 🤔 Triage in Docs 📚 Jul 27, 2024
@thoward
Copy link
Contributor

thoward commented Jul 29, 2024

Could you provide more context, like an error message or some more detail on what you expected vs what happened?

@thoward thoward added area/api-docs Generated API docs, generated from providers. For hand-written docs, see area/docs. area/docs Hand-written documentation. For api docs, see area/api-docs. and removed needs-triage Needs attention from the triage team labels Jul 29, 2024
@thoward thoward moved this from 🤔 Triage to 🧳 Backlog in Docs 📚 Jul 29, 2024
@drusellers
Copy link
Author

❯ pulumi up
Previewing update (dev)

View in Browser (Ctrl+O): https://app.pulumi.com/drusellers/groundwork/dev/previews/494be034-eb37-4586-9062-cfd21c2fac1c

     Type                          Name            Plan     Info
     pulumi:pulumi:Stack           groundwork-dev
     └─ dnsimple:index:ZoneRecord  test-record              1 error

Diagnostics:
  dnsimple:index:ZoneRecord (test-record):
    error: must provide api token: must define a token for the dnsimple provider or set the DNSIMPLE_TOKEN environment variable

but it works with

❯ DNSIMPLE_ACCOUNT=... DNSIMPLE_TOKEN=... pulumi up
Previewing update (dev)

View in Browser (Ctrl+O): https://app.pulumi.com/drusellers/groundwork/dev/previews/22ce627e-29b5-48b2-95e1-f1dbcd23860a

     Type                 Name            Plan
     pulumi:pulumi:Stack  groundwork-dev

Resources:
    2 unchanged

Do you want to perform this update? yes
Updating (dev)

View in Browser (Ctrl+O): https://app.pulumi.com/drusellers/groundwork/dev/updates/2

     Type                 Name            Status
     pulumi:pulumi:Stack  groundwork-dev

Resources:
    2 unchanged

Duration: 1s

I think its odd that the static configuration isn't being respected. The classes are using Pulumi.Config under the covers.

@guineveresaenger
Copy link
Contributor

hi @drusellers - I just happened across this issue.

We're sorry you were having trouble here. We've since updated the landing page for dnsimple, which should show you an example of how to set up configuration via Pulumi.yaml configuration file.
Read more about configuration here: https://www.pulumi.com/docs/iac/concepts/config/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api-docs Generated API docs, generated from providers. For hand-written docs, see area/docs. area/docs Hand-written documentation. For api docs, see area/api-docs. kind/bug Some behavior is incorrect or out of spec
Projects
Status: 🧳 Backlog
Development

No branches or pull requests

3 participants