Skip to content

Commit

Permalink
chore: do not prefix provider config
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasZeissner committed Sep 13, 2024
1 parent bcc70df commit 38b5ab8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ terraform {
}
provider "cosmo" {
cosmo_api_url = "cosmo_669b576aaadc10ee1ae81d9193425705"
cosmo_api_key = "http://localhost:3001"
api_url = "http://localhost:3001"
api_key = "cosmo_669b576aaadc10ee1ae81d9193425705"
}
```

Expand All @@ -33,5 +33,5 @@ provider "cosmo" {

### Optional

- `cosmo_api_key` (String) The Api Key to be used: COSMO_API_KEY
- `cosmo_api_url` (String) The Api Url to be used: COSMO_API_URL
- `api_key` (String) The Api Key to be used: COSMO_API_KEY
- `api_url` (String) The Api Url to be used: COSMO_API_URL
4 changes: 2 additions & 2 deletions examples/cosmo/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ terraform {
}

provider "cosmo" {
cosmo_api_url = "cosmo_669b576aaadc10ee1ae81d9193425705"
cosmo_api_key = "http://localhost:3001"
api_url = "cosmo_669b576aaadc10ee1ae81d9193425705"
api_key = "http://localhost:3001"
}
4 changes: 2 additions & 2 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ terraform {
}

provider "cosmo" {
cosmo_api_url = "cosmo_669b576aaadc10ee1ae81d9193425705"
cosmo_api_key = "http://localhost:3001"
api_url = "http://localhost:3001"
api_key = "cosmo_669b576aaadc10ee1ae81d9193425705"
}
12 changes: 6 additions & 6 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ type Provider struct {

// CosmoProviderModel describes the provider data model.
type CosmoProviderModel struct {
CosmoApiUrl types.String `tfsdk:"cosmo_api_url"`
CosmoApiKey types.String `tfsdk:"cosmo_api_key"`
ApiUrl types.String `tfsdk:"api_url"`
ApiKey types.String `tfsdk:"api_key"`
}

func (p *CosmoProvider) Metadata(ctx context.Context, req provider.MetadataRequest, resp *provider.MetadataResponse) {
Expand All @@ -50,11 +50,11 @@ func (p *CosmoProvider) Metadata(ctx context.Context, req provider.MetadataReque
func (p *CosmoProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse) {
resp.Schema = schema.Schema{
Attributes: map[string]schema.Attribute{
"cosmo_api_url": schema.StringAttribute{
"api_url": schema.StringAttribute{
MarkdownDescription: fmt.Sprintf("The Api Url to be used: %s", utils.EnvCosmoApiUrl),
Optional: true,
},
"cosmo_api_key": schema.StringAttribute{
"api_key": schema.StringAttribute{
MarkdownDescription: fmt.Sprintf("The Api Key to be used: %s", utils.EnvCosmoApiKey),
Optional: true,
},
Expand All @@ -71,8 +71,8 @@ func (p *CosmoProvider) Configure(ctx context.Context, req provider.ConfigureReq
return
}

cosmoApiKey := data.CosmoApiKey.ValueString()
cosmoApiUrl := data.CosmoApiUrl.ValueString()
cosmoApiKey := data.ApiKey.ValueString()
cosmoApiUrl := data.ApiUrl.ValueString()

platformClient, err := api.NewClient(cosmoApiKey, cosmoApiUrl)

Expand Down

0 comments on commit 38b5ab8

Please sign in to comment.