mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-08 15:13:56 -06:00
a1935a135d
When a Packet provision exceeds our time limit, we move the device to an internal project for Packet staff to investigate. When this happens, the original user no longer has access to the device, and they get a 403. These changes make that and other external state changes more pleasant for users of Terraform.
20 lines
423 B
Go
20 lines
423 B
Go
package packet
|
|
|
|
import (
|
|
"github.com/hashicorp/go-cleanhttp"
|
|
"github.com/packethost/packngo"
|
|
)
|
|
|
|
const (
|
|
consumerToken = "aZ9GmqHTPtxevvFq9SK3Pi2yr9YCbRzduCSXF2SNem5sjB91mDq7Th3ZwTtRqMWZ"
|
|
)
|
|
|
|
type Config struct {
|
|
AuthToken string
|
|
}
|
|
|
|
// Client() returns a new client for accessing Packet's API.
|
|
func (c *Config) Client() *packngo.Client {
|
|
return packngo.NewClient(consumerToken, c.AuthToken, cleanhttp.DefaultClient())
|
|
}
|