Skip to content

Commit 9d6c67b

Browse files
authored
Merge pull request #2 from Telemaco019/fix/docs
Fix/docs
2 parents aee0e27 + 94433bf commit 9d6c67b

File tree

7 files changed

+33
-106
lines changed

7 files changed

+33
-106
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ backend.tfvars
4242
.terraform.lock.hcl
4343

4444
.idea/
45+
46+
examples/tests

docs/data-sources/datastore.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ data "azureml_datastores" "example" {
4242
- **last_modified_user_type** (String) The kind of user that last updated the datastore (Service Principal or User).
4343
- **storage_account_name** (String) The name of the Storage Account to which the datastore is linked to.
4444
- **storage_container_name** (String) The name of the Storage Container to which the datastore is linked to.
45-
- **storage_type** (String) The type of the storage to which the datstore is linked to. Possible values are: %!v(MISSING)
45+
- **storage_type** (String) The type of the storage to which the datstore is linked to. Possible values are: ["AzureFile" "AzureBlob" "AzureDataLakeGen1" "AzureDataLakeGen2" "AzureMySql" "AzurePostgreSql" "AzureSqlDatabase" "GlusterFs"]
4646

4747

docs/index.md

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -18,49 +18,16 @@ Principal specific to Terraform.
1818
terraform {
1919
required_providers {
2020
azureml = {
21-
source = "registry.terraform.io/Telemaco019/azureml"
22-
version = "0.0.1"
21+
source = "registry.terraform.io/Telemaco019/azureml"
2322
}
2423
}
2524
}
2625
2726
provider "azureml" {
28-
client_id = var.client_id
29-
client_secret = var.client_secret
30-
tenant_id = var.tenant_id
31-
subscription_id = var.subscription_id
32-
}
33-
34-
data "azureml_datastore" "datastore" {
35-
resource_group_name = var.resource_group_name
36-
workspace_name = var.workspace_name
37-
name = "test"
38-
}
39-
output "datastore" {
40-
value = data.azureml_datastore.datastore
41-
}
42-
43-
data "azureml_datastores" "datastores" {
44-
resource_group_name = var.resource_group_name
45-
workspace_name = var.workspace_name
46-
}
47-
48-
resource "azureml_datastore" "example" {
49-
resource_group_name = var.resource_group_name
50-
workspace_name = var.workspace_name
51-
name = "example2"
52-
description = "example"
53-
storage_type = "AzureBlob"
54-
55-
storage_account_name = "pippo"
56-
storage_container_name = "example"
57-
58-
auth {
59-
credentials_type = "ServicePrincipal"
60-
client_id = var.client_id
61-
client_secret = var.client_secret
62-
tenant_id = var.tenant_id
63-
}
27+
client_id = ""
28+
client_secret = ""
29+
tenant_id = ""
30+
subscription_id = ""
6431
}
6532
```
6633

docs/resources/datastore.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ resource "azureml_datastore" "example" {
4040
- **auth** (Block Set, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--auth))
4141
- **name** (String) The name of the datastore.
4242
- **resource_group_name** (String) The name of the resource group of the Azure ML Workspace to which the datastore belongs to.
43-
- **storage_type** (String) The type of the storage to which the datstore is linked to. Possible values are: %!v(MISSING)
43+
- **storage_type** (String) The type of the storage to which the datstore is linked to. Possible values are: ["AzureFile" "AzureBlob" "AzureDataLakeGen1" "AzureDataLakeGen2" "AzureMySql" "AzurePostgreSql" "AzureSqlDatabase" "GlusterFs"]
4444
- **workspace_name** (String) The name of the Azure ML Workspace to which the datastore belongs to.
4545

4646
### Optional
@@ -65,7 +65,7 @@ resource "azureml_datastore" "example" {
6565

6666
Required:
6767

68-
- **credentials_type** (String) The type of credentials used for authenticating with the underlying storage. Possible values are: %!v(MISSING).
68+
- **credentials_type** (String) The type of credentials used for authenticating with the underlying storage. Possible values are: ["AccountKey" "Certificate" "None" "Sas" "ServicePrincipal" "SqlAdmin"].
6969

7070
Optional:
7171

examples/provider/provider.tf

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,14 @@
11
terraform {
22
required_providers {
33
azureml = {
4-
source = "registry.terraform.io/Telemaco019/azureml"
5-
version = "0.0.1"
4+
source = "registry.terraform.io/Telemaco019/azureml"
65
}
76
}
87
}
98

109
provider "azureml" {
11-
client_id = var.client_id
12-
client_secret = var.client_secret
13-
tenant_id = var.tenant_id
14-
subscription_id = var.subscription_id
15-
}
16-
17-
data "azureml_datastore" "datastore" {
18-
resource_group_name = var.resource_group_name
19-
workspace_name = var.workspace_name
20-
name = "test"
21-
}
22-
output "datastore" {
23-
value = data.azureml_datastore.datastore
24-
}
25-
26-
data "azureml_datastores" "datastores" {
27-
resource_group_name = var.resource_group_name
28-
workspace_name = var.workspace_name
29-
}
30-
31-
resource "azureml_datastore" "example" {
32-
resource_group_name = var.resource_group_name
33-
workspace_name = var.workspace_name
34-
name = "example2"
35-
description = "example"
36-
storage_type = "AzureBlob"
37-
38-
storage_account_name = "pippo"
39-
storage_container_name = "example"
40-
41-
auth {
42-
credentials_type = "ServicePrincipal"
43-
client_id = var.client_id
44-
client_secret = var.client_secret
45-
tenant_id = var.tenant_id
46-
}
10+
client_id = ""
11+
client_secret = ""
12+
tenant_id = ""
13+
subscription_id = ""
4714
}

examples/provider/required_variables.tf

Lines changed: 0 additions & 18 deletions
This file was deleted.

internal/provider/provider.go

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"github.com/Telemaco019/azureml-go-sdk/workspace"
66
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
77
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
8+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
89
"time"
910
)
1011

@@ -33,21 +34,29 @@ func New(version string) func() *schema.Provider {
3334
p := &schema.Provider{
3435
Schema: map[string]*schema.Schema{
3536
"client_id": {
36-
Type: schema.TypeString,
37-
Required: true,
37+
Type: schema.TypeString,
38+
Required: true,
39+
ValidateFunc: validation.StringIsNotEmpty,
40+
Description: "The application ID of the Service Principal used for authenticating with Azure Machine Learning.",
3841
},
3942
"client_secret": {
40-
Type: schema.TypeString,
41-
Required: true,
42-
Sensitive: true,
43+
Type: schema.TypeString,
44+
Required: true,
45+
Sensitive: true,
46+
ValidateFunc: validation.StringIsNotEmpty,
47+
Description: "The client secret of the Service Principal used for authenticating with Azure Machine Learning.",
4348
},
4449
"tenant_id": {
45-
Type: schema.TypeString,
46-
Required: true,
50+
Type: schema.TypeString,
51+
Required: true,
52+
ValidateFunc: validation.StringIsNotEmpty,
53+
Description: "The ID of the home Tenant of the Service Principal used for authenticating with Azure Machine Learning.",
4754
},
4855
"subscription_id": {
49-
Type: schema.TypeString,
50-
Required: true,
56+
Type: schema.TypeString,
57+
Required: true,
58+
ValidateFunc: validation.StringIsNotEmpty,
59+
Description: "The Azure subscription ID on which the provider will operate.",
5160
},
5261
},
5362
DataSourcesMap: map[string]*schema.Resource{

0 commit comments

Comments
 (0)