Skip to content

Commit 44ced68

Browse files
authored
Add a new resource google_discovery_engine_acl_config (#14875)
1 parent 983a15d commit 44ced68

File tree

3 files changed

+146
-0
lines changed

3 files changed

+146
-0
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Copyright 2025 Google Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
---
15+
name: 'AclConfig'
16+
description: |
17+
Access Control Configuration.
18+
references:
19+
api: 'https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1alpha#aclconfigservice'
20+
base_url: 'projects/{{project}}/locations/{{location}}/aclConfig'
21+
self_link: 'projects/{{project}}/locations/{{location}}/aclConfig'
22+
create_url: 'projects/{{project}}/locations/{{location}}/aclConfig'
23+
create_verb: 'PATCH'
24+
update_url: 'projects/{{project}}/locations/{{location}}/aclConfig'
25+
update_verb: 'PATCH'
26+
exclude_delete: true
27+
import_format:
28+
- 'projects/{{project}}/locations/{{location}}/aclConfig'
29+
timeouts:
30+
insert_minutes: 5
31+
update_minutes: 5
32+
examples:
33+
- name: 'discoveryengine_aclconfig_basic'
34+
primary_resource_id: 'basic'
35+
parameters:
36+
- name: 'location'
37+
type: String
38+
description: |
39+
The geographic location where the data store should reside. The value can
40+
only be one of "global", "us" and "eu".
41+
url_param_only: true
42+
required: true
43+
immutable: true
44+
properties:
45+
- name: 'name'
46+
type: String
47+
description: |
48+
The unique full resource name of the aclConfig. Values are of the format
49+
`projects/{project}/locations/{location}/aclConfig`.
50+
output: true
51+
- name: 'idpConfig'
52+
type: NestedObject
53+
description: |
54+
Identity provider config.
55+
properties:
56+
- name: 'idpType'
57+
type: Enum
58+
description: |
59+
Identity provider type.
60+
enum_values:
61+
- 'GSUITE'
62+
- 'THIRD_PARTY'
63+
- name: 'externalIdpConfig'
64+
type: NestedObject
65+
description: |
66+
External third party identity provider config.
67+
properties:
68+
- name: 'workforcePoolName'
69+
type: String
70+
description: |
71+
Workforce pool name: "locations/global/workforcePools/pool_id"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
resource "google_discovery_engine_acl_config" "basic" {
2+
location = "global"
3+
idp_config {
4+
idp_type = "THIRD_PARTY"
5+
external_idp_config {
6+
workforce_pool_name = "locations/global/workforcePools/cloud-console-pool-manual"
7+
}
8+
}
9+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
package discoveryengine_test
2+
3+
import (
4+
"testing"
5+
6+
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
7+
"github.com/hashicorp/terraform-provider-google/google/acctest"
8+
)
9+
10+
func TestAccDiscoveryEngineAclConfig_discoveryengineAclconfigBasicExample_update(t *testing.T) {
11+
t.Parallel()
12+
13+
context := map[string]interface{}{
14+
"random_suffix": acctest.RandString(t, 10),
15+
}
16+
17+
acctest.VcrTest(t, resource.TestCase{
18+
PreCheck: func() { acctest.AccTestPreCheck(t) },
19+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
20+
Steps: []resource.TestStep{
21+
{
22+
Config: testAccDiscoveryEngineAclConfig_discoveryengineAclconfigBasicExample_basic(context),
23+
},
24+
{
25+
ResourceName: "google_discovery_engine_acl_config.basic",
26+
ImportState: true,
27+
ImportStateVerify: true,
28+
ImportStateVerifyIgnore: []string{"location"},
29+
},
30+
{
31+
Config: testAccDiscoveryEngineAclConfig_discoveryengineAclconfigBasicExample_update(context),
32+
},
33+
{
34+
ResourceName: "google_discovery_engine_acl_config.basic",
35+
ImportState: true,
36+
ImportStateVerify: true,
37+
ImportStateVerifyIgnore: []string{"location"},
38+
},
39+
},
40+
})
41+
}
42+
43+
func testAccDiscoveryEngineAclConfig_discoveryengineAclconfigBasicExample_basic(context map[string]interface{}) string {
44+
return acctest.Nprintf(`
45+
resource "google_discovery_engine_acl_config" "basic" {
46+
location = "global"
47+
idp_config {
48+
idp_type = "THIRD_PARTY"
49+
external_idp_config {
50+
workforce_pool_name = "locations/global/workforcePools/cloud-console-pool-manual"
51+
}
52+
}
53+
}
54+
`, context)
55+
}
56+
57+
func testAccDiscoveryEngineAclConfig_discoveryengineAclconfigBasicExample_update(context map[string]interface{}) string {
58+
return acctest.Nprintf(`
59+
resource "google_discovery_engine_acl_config" "basic" {
60+
location = "global"
61+
idp_config {
62+
idp_type = "GSUITE"
63+
}
64+
}
65+
`, context)
66+
}

0 commit comments

Comments
 (0)