Skip to content

Commit

Permalink
Add Vertex AI Dataset (#4863) (#9411)
Browse files Browse the repository at this point in the history
* initial Dataset

Co-authored-by: upodroid <[email protected]>

* pass d to OperationWaiters

* fetch region from self_link

* fix regex and add test

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jun 21, 2021
1 parent a44839b commit 46090cc
Show file tree
Hide file tree
Showing 10 changed files with 793 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/4863.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
`google_vertex_ai_dataset`
```
4 changes: 4 additions & 0 deletions google/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ type Config struct {
StorageBasePath string
TagsBasePath string
TPUBasePath string
VertexAIBasePath string
VPCAccessBasePath string
WorkflowsBasePath string

Expand Down Expand Up @@ -225,6 +226,7 @@ const SQLBasePathKey = "SQL"
const StorageBasePathKey = "Storage"
const TagsBasePathKey = "Tags"
const TPUBasePathKey = "TPU"
const VertexAIBasePathKey = "VertexAI"
const VPCAccessBasePathKey = "VPCAccess"
const WorkflowsBasePathKey = "Workflows"
const CloudBillingBasePathKey = "CloudBilling"
Expand Down Expand Up @@ -303,6 +305,7 @@ var DefaultBasePaths = map[string]string{
StorageBasePathKey: "https://storage.googleapis.com/storage/v1/",
TagsBasePathKey: "https://cloudresourcemanager.googleapis.com/v3/",
TPUBasePathKey: "https://tpu.googleapis.com/v1/",
VertexAIBasePathKey: "https://{{region}}-aiplatform.googleapis.com/v1/",
VPCAccessBasePathKey: "https://vpcaccess.googleapis.com/v1/",
WorkflowsBasePathKey: "https://workflows.googleapis.com/v1/",
CloudBillingBasePathKey: "https://cloudbilling.googleapis.com/v1/",
Expand Down Expand Up @@ -1134,6 +1137,7 @@ func ConfigureBasePaths(c *Config) {
c.StorageBasePath = DefaultBasePaths[StorageBasePathKey]
c.TagsBasePath = DefaultBasePaths[TagsBasePathKey]
c.TPUBasePath = DefaultBasePaths[TPUBasePathKey]
c.VertexAIBasePath = DefaultBasePaths[VertexAIBasePathKey]
c.VPCAccessBasePath = DefaultBasePaths[VPCAccessBasePathKey]
c.WorkflowsBasePath = DefaultBasePaths[WorkflowsBasePathKey]

Expand Down
14 changes: 12 additions & 2 deletions google/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,14 @@ func Provider() *schema.Provider {
"GOOGLE_TPU_CUSTOM_ENDPOINT",
}, DefaultBasePaths[TPUBasePathKey]),
},
"vertex_ai_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_VERTEX_AI_CUSTOM_ENDPOINT",
}, DefaultBasePaths[VertexAIBasePathKey]),
},
"vpc_access_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -758,9 +766,9 @@ func Provider() *schema.Provider {
return provider
}

// Generated resources: 196
// Generated resources: 197
// Generated IAM resources: 87
// Total generated resources: 283
// Total generated resources: 284
func ResourceMap() map[string]*schema.Resource {
resourceMap, _ := ResourceMapWithErrors()
return resourceMap
Expand Down Expand Up @@ -1050,6 +1058,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_tags_tag_value_iam_policy": ResourceIamPolicy(TagsTagValueIamSchema, TagsTagValueIamUpdaterProducer, TagsTagValueIdParseFunc),
"google_tags_tag_binding": resourceTagsTagBinding(),
"google_tpu_node": resourceTPUNode(),
"google_vertex_ai_dataset": resourceVertexAIDataset(),
"google_vpc_access_connector": resourceVPCAccessConnector(),
"google_workflows_workflow": resourceWorkflowsWorkflow(),
},
Expand Down Expand Up @@ -1318,6 +1327,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
config.StorageBasePath = d.Get("storage_custom_endpoint").(string)
config.TagsBasePath = d.Get("tags_custom_endpoint").(string)
config.TPUBasePath = d.Get("tpu_custom_endpoint").(string)
config.VertexAIBasePath = d.Get("vertex_ai_custom_endpoint").(string)
config.VPCAccessBasePath = d.Get("vpc_access_custom_endpoint").(string)
config.WorkflowsBasePath = d.Get("workflows_custom_endpoint").(string)

Expand Down
Loading

0 comments on commit 46090cc

Please sign in to comment.