Coder Social home page Coder Social logo

pulumi-gandi's Introduction

pulumi-gandi's People

Contributors

rawkode avatar ringods avatar susanev avatar vincentbernat avatar

Stargazers

 avatar

Watchers

 avatar  avatar

pulumi-gandi's Issues

Broken API: Access denied issue

I created a fresh Pulumi project and setup everything need but fail to provision live DNS records. It seems there is change in Gandi's API now requiring Personal Access Token instead of regular tokens. I have working key that experimented with in plain curl and found it works as expected in doing the exact operation with Pulumi. Since pulumi does not complain about gandi key, it means it is correctly set. I checked that fact by removing the key from configuration an confirm pulumi explains that a key is needed and how to configure it.

How to reproduce

Sample program

const pulumi = require("@pulumi/pulumi");
const gandi = require("@pulumiverse/gandi");

const config = new pulumi.Config();
const zone = config.get('dns-zone-cloud');  // 'domain.tld' no dot at the end

const dnsRecordA = new gandi.livedns.Record(`${zone}-dns-a`, {
  name: `@`,
  ttl: 1800,
  type: "A",
  values: ['1.1.1.1'],
  zone: zone,
});

Output

Enter your passphrase to unlock config/secrets
    (set PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE to remember):  
Enter your passphrase to unlock config/secrets
Previewing update (dev):
     Type                     Name                Plan       
     pulumi:pulumi:Stack      infrastructure-dev             
 +   └─ gandi:livedns:Record  myname.cloud-dns-a  create     

Resources:
    + 1 to create
    3 unchanged

Updating (dev):
     Type                     Name                Status                  Info
     pulumi:pulumi:Stack      infrastructure-dev  **failed**              1 error
 +   └─ gandi:livedns:Record  myname.cloud-dns-a  **creating failed**     1 error

Diagnostics:
  pulumi:pulumi:Stack (infrastructure-dev):
    error: update failed

  gandi:livedns:Record (myname.cloud-dns-a):
    error: 1 error occurred:
    	* StatusCode: 403 ; Err: 403: Access was denied to this resource.

Resources:
    3 unchanged

Duration: 2s

CURL experiment

curl -v -X POST -s -H 'content-type: application/json' -H "Authorization: Bearer REDACTEDPERSONALACESSTOKEN https://api.gandi.net/v5/livedns/domains/mydomain/records -d '{"rrset_name":"wxxwxw","rrset_type":"A","rrset_values":["1.1.1.1"]}'
* processing: https://api.gandi.net/v5/livedns/domains/mydomain/records
*   Trying 213.167.231.7:443...
* Connected to api.gandi.net (213.167.231.7) port 443
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/pki/tls/certs/ca-bundle.crt
*  CApath: none
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN: server accepted http/1.1
* Server certificate:
*  subject: CN=api.gandi.net
*  start date: Jan  3 00:00:00 2024 GMT
*  expire date: Jan 21 23:59:59 2025 GMT
*  subjectAltName: host "api.gandi.net" matched cert's "api.gandi.net"
*  issuer: C=FR; O=Gandi; CN=Gandi RSA Domain Validation Secure Server CA 3
*  SSL certificate verify ok.
* using HTTP/1.1
> POST /v5/livedns/domains/mydomain/records HTTP/1.1
> Host: api.gandi.net
> User-Agent: curl/8.2.1
> Accept: */*
> content-type: application/json
> Authorization: Bearer REDACTEDPERSONALACESSTOKEN
> Content-Length: 67
> 
< HTTP/1.1 201 Created
< Server: nginx
< Date: Thu, 22 Feb 2024 13:55:19 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 32
< Connection: keep-alive
< Cache-Control: max-age=0, must-revalidate, no-cache, no-store
< Expires: Thu, 22 Feb 2024 13:55:19 GMT
< Last-Modified: Thu, 22 Feb 2024 13:55:19 GMT
< Pragma: no-cache
< location: https://api.gandi.net/v5/livedns/domains/mydomain/records/wxxwxw/A
< Trace-ID: 2c1cssdf3d26e
< ETag: W/"20-8xcvxcvqNVzJRLVdc"
< Vary: Accept-Encoding, Accept-Language
< Strict-Transport-Security: max-age=15768000;
< X-Content-Type-Options: nosniff
< X-Frame-Options: DENY
< X-XSS-Protection: 1; mode=block
< 
* Connection #0 to host api.gandi.net left intact
{"message":"DNS Record Created"}

Create Go SDK

Hello,

The Go SDK is missing. Would it be possible to generate it? Or at least, what's the steps to integrate it?

Would love to use this integration but for now it's impossible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.