pulumi / pulumi-akamai

A Akamai Pulumi resource package, providing multi-language access to Akamai
Apache License 2.0
7 stars 3 forks source link

Problems configuring akamai.NewProvider #339

Open jooooel opened 11 months ago

jooooel commented 11 months ago

What happened?

I'm trying to configure my Akamai provider using values from the config, instead of having an .edgerc file or using environment varaibles. From what I can tell, it looks like it should be possible, but I can't get it to work. Am I trying in vain or is this a bug?

I get the following error:

   error: an unhandled error occurred: program failed:
    1 error occurred:
        * rpc error: code = Unknown desc = invocation of akamai:index/getGroups:getGroups returned an error: invoking akamai:index/getGroups:getGroups: 1 error occurred:
        * fetching groups: request failed: Get "https:///papi/v1/groups": http: no Host in request URL

Example

package main

import (
    akamai "github.com/pulumi/pulumi-akamai/sdk/v6/go/akamai"
    pulumi "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        provider, err := akamai.NewProvider(
            ctx,
            "akamai-provider",
            &akamai.ProviderArgs{
                Config: &akamai.ProviderConfigArgs{
                    AccessToken:  pulumi.String("..."),
                    ClientSecret: pulumi.String("..."),
                    ClientToken:  pulumi.String("..."),
                    Host:         pulumi.String("..."),
                },
            },
        )
        if err != nil {
            return err
        }

        _, err = akamai.GetGroups(ctx, pulumi.Provider(provider))
        if err != nil {
            return err
        }

        return nil
    })
}

Output of pulumi about

CLI Version 3.94.2 Go Version go1.21.4 Go Compiler gc

Plugins NAME VERSION akamai 6.3.1 aws 6.10.0 go unknown

Host OS ubuntu Version 22.04 Arch x86_64

This project is written in go: executable='/usr/local/go/bin/go' version='go version go1.21.1 linux/amd64'

Dependencies: NAME VERSION github.com/pulumi/pulumi-akamai/sdk/v6 6.3.1 github.com/pulumi/pulumi-aws/sdk/v6 6.10.0 github.com/pulumi/pulumi/sdk/v3 3.93.0 github.com/pulumiverse/pulumi-time/sdk 0.0.0-20231010123146-089d7304da13 github.com/stretchr/testify 1.8.4

Pulumi locates its logs in /tmp by default

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

iwahbe commented 11 months ago

Hey @jooooel. I'm sorry you're seeing this. I'm getting a slightly different error, but its not working for me either:

* rpc error: code = Unknown desc = invocation of akamai:index/getGroups:getGroups returned an error: configuring context failed: error reading Akamai EdgeGrid configuration: loading config file: open /Users/iwahbe/.edgerc: no such file or directory

I agree that this should work.


I haven't confirmed, but this might be related to https://github.com/pulumi/pulumi-terraform-bridge/issues/423.

mjeffryes commented 1 month ago

Unfortunately, it looks like this issue hasn't seen any updates in a while. If you're still encountering this problem, could you leave a quick comment to let us know so we can prioritize it? (Commenting will bump it back into our triage queue.)