Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package bitbucket
- import (
- "net/http"
- "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
- )
- // Provider -
- func Provider() *schema.Provider {
- return &schema.Provider{
- Schema: map[string]*schema.Schema{
- "username": {
- Required: true,
- Type: schema.TypeString,
- DefaultFunc: schema.EnvDefaultFunc("BITBUCKET_USERNAME", nil),
- },
- "password": {
- Type: schema.TypeString,
- Required: true,
- Sensitive: true,
- DefaultFunc: schema.EnvDefaultFunc("BITBUCKET_PASSWORD", nil),
- },
- },
- ConfigureFunc: providerConfigure,
- ResourcesMap: map[string]*schema.Resource{
- "bitbucket_project": resourceProject(),
- },
- DataSourcesMap: map[string]*schema.Resource{},
- }
- }
- func providerConfigure(d *schema.ResourceData) (interface{}, error) {
- client := &Client{
- Username: d.Get("username").(string),
- Password: d.Get("password").(string),
- HTTPClient: &http.Client{},
- }
- return client, nil
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement