Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netapp active dirtectory #9546

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
9429d76
Create activeDirectory.yaml
paavan-gopala-reddy Nov 30, 2023
942244c
Create Active_Directory_Create.tf.erb
paavan-gopala-reddy Nov 30, 2023
cfd0b2d
Apply suggestions from code review
paavan-gopala-reddy Dec 5, 2023
57dce25
Update Active_Directory_Create.tf.erb
paavan-gopala-reddy Dec 5, 2023
c16ef7e
Update activeDirectory.yaml
paavan-gopala-reddy Dec 5, 2023
a7c0eb6
Rename Active_Directory_Create.tf.erb to netapp_active_directory_basi…
paavan-gopala-reddy Dec 6, 2023
c6c6c92
Rename netapp_active_directory_basic.tf.erb.tf.erb to netapp_active_d…
paavan-gopala-reddy Dec 6, 2023
27379e7
Update activeDirectory.yaml
paavan-gopala-reddy Dec 6, 2023
a57dcd7
Update activeDirectory.yaml
paavan-gopala-reddy Dec 6, 2023
af5d5c2
Create netapp_active_directory_full.tf.erb
paavan-gopala-reddy Dec 6, 2023
3bca5c5
Update netapp_active_directory_full.tf.erb
paavan-gopala-reddy Dec 6, 2023
c463607
Update activeDirectory.yaml
paavan-gopala-reddy Dec 6, 2023
de4ffda
Update activeDirectory.yaml
paavan-gopala-reddy Dec 6, 2023
8f9af0e
Update activeDirectory.yaml
paavan-gopala-reddy Dec 6, 2023
5f971ee
Update activeDirectory.yaml
paavan-gopala-reddy Dec 6, 2023
56b1c9e
Update netapp_active_directory_basic.tf.erb
paavan-gopala-reddy Dec 6, 2023
3a2d879
Update netapp_active_directory_full.tf.erb
paavan-gopala-reddy Dec 6, 2023
0bb21fa
Create resource_netapp_active_directory_test.go
paavan-gopala-reddy Dec 6, 2023
60ed6cc
Apply suggestions from code review
paavan-gopala-reddy Dec 7, 2023
ca62940
Update activeDirectory.yaml
paavan-gopala-reddy Dec 7, 2023
8b2943b
Update activeDirectory.yaml
paavan-gopala-reddy Dec 9, 2023
b8fdc46
Apply suggestions from code review
paavan-gopala-reddy Dec 9, 2023
77a174d
Update activeDirectory.yaml
paavan-gopala-reddy Dec 13, 2023
2b9f8f5
Update activeDirectory.yaml
paavan-gopala-reddy Dec 13, 2023
bc8426d
Update netapp_active_directory_basic.tf.erb
paavan-gopala-reddy Dec 13, 2023
e7c5027
Update netapp_active_directory_full.tf.erb
paavan-gopala-reddy Dec 13, 2023
bb0654f
Update activeDirectory.yaml
paavan-gopala-reddy Dec 13, 2023
ab76eba
Update netapp_active_directory_full.tf.erb
paavan-gopala-reddy Dec 13, 2023
4a0096e
Update resource_netapp_active_directory_test.go
paavan-gopala-reddy Dec 13, 2023
2b38d87
Update activeDirectory.yaml
paavan-gopala-reddy Dec 13, 2023
95d9203
Update activeDirectory.yaml
paavan-gopala-reddy Dec 13, 2023
166b8e2
Update netapp_active_directory_full.tf.erb
paavan-gopala-reddy Dec 13, 2023
3fd6435
Update resource_netapp_active_directory_test.go
paavan-gopala-reddy Dec 13, 2023
8034e16
Update resource_netapp_active_directory_test.go
paavan-gopala-reddy Dec 14, 2023
0b750f4
Update resource_netapp_active_directory_test.go
paavan-gopala-reddy Dec 14, 2023
b526636
Update activeDirectory.yaml
paavan-gopala-reddy Dec 19, 2023
46415d8
Delete mmv1/templates/terraform/examples/netapp_active_directory_basi…
paavan-gopala-reddy Dec 19, 2023
b6ebe78
Update resource_netapp_active_directory_test.go
paavan-gopala-reddy Dec 19, 2023
0c1c6a0
Update resource_netapp_active_directory_test.go
paavan-gopala-reddy Dec 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 179 additions & 0 deletions mmv1/products/netapp/activeDirectory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# Copyright 2023 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

--- !ruby/object:Api::Resource
name: 'activeDirectory'
description: |
ActiveDirectory is the public representation of the active directory config.
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Official Documentation': 'https://cloud.google.com/netapp/volumes/docs/configure-and-use/active-directory/about-ad'
api: 'https://cloud.google.com/netapp/volumes/docs/reference/rest/v1/projects.locations.activeDirectories'
base_url: projects/{{project}}/locations/{{location}}/activeDirectories
self_link: projects/{{project}}/locations/{{location}}/activeDirectories/{{name}}
create_url: projects/{{project}}/locations/{{location}}/activeDirectories?activeDirectoryId={{name}}
create_verb: :POST
update_url: projects/{{project}}/locations/{{location}}/activeDirectories/{{name}}
update_verb: :PATCH
update_mask: true
delete_url: projects/{{project}}/locations/{{location}}/activeDirectories/{{name}}
delete_verb: :DELETE
autogen_async: true
async: !ruby/object:Api::OpAsync
operation: !ruby/object:Api::OpAsync::Operation
base_url: '{{op_id}}'
id_format: 'projects/{{project}}/locations/{{location}}/activeDirectories/{{name}}'
import_format: ['projects/{{project}}/locations/{{location}}/activeDirectories/{{name}}']
parameters:
- !ruby/object:Api::Type::String
name: 'location'
required: true
immutable: true
url_param_only: true
description: |
Name of the region for the policy to apply to.
- !ruby/object:Api::Type::String
name: 'name'
description: |
The resource name of the Active Directory pool. Needs to be unique per location.
required: true
immutable: true
url_param_only: true
examples:
- !ruby/object:Provider::Terraform::Examples
name: 'netapp_active_directory_full'
primary_resource_id: 'test_active_directory_full'
paavan-gopala-reddy marked this conversation as resolved.
Show resolved Hide resolved
skip_test: true
vars:
active_directory_full_name: 'test-active-directory-full'
properties:
# Fields go here
- !ruby/object:Api::Type::String
name: 'createTime'
description: |
Create time of the active directory. A timestamp in RFC3339 UTC "Zulu" format. Examples: "2023-06-22T09:13:01.617Z".
output: true
- !ruby/object:Api::Type::Enum
name: 'state'
description: |
The state of the Active Directory policy (not the Active Directory itself).
values:
- :STATE_UNSPECIFIED
- :CREATING
- :READY
- :UPDATING
- :DELETING
- :IN_USE
- :ERROR
output: true
- !ruby/object:Api::Type::String
name: 'domain'
description: |
Fully qualified domain name for the Active Directory domain.
required: true
- !ruby/object:Api::Type::String
name: 'site'
description: |
Specifies an Active Directory site to manage domain controller selection.
Use when Active Directory domain controllers in multiple regions are configured. Defaults to `Default-First-Site-Name` if left empty.
required: false
- !ruby/object:Api::Type::String
name: 'dns'
description: |
Comma separated list of DNS server IP addresses for the Active Directory domain.
required: true
- !ruby/object:Api::Type::String
name: 'netBiosPrefix'
description: |
NetBIOS name prefix of the server to be created.
A five-character random ID is generated automatically, for example, -6f9a, and appended to the prefix. The full UNC share path will have the following format:
`\\NetBIOS_PREFIX-ABCD.DOMAIN_NAME\SHARE_NAME`
required: true
- !ruby/object:Api::Type::String
name: 'organizationalUnit'
description: |
Name of the Organizational Unit where you intend to create the computer account for NetApp Volumes.
Defaults to `CN=Computers` if left empty.
required: false
default_from_api: true
- !ruby/object:Api::Type::Boolean
name: 'aesEncryption'
description: |
Enables AES-128 and AES-256 encryption for Kerberos-based communication with Active Directory.
required: false
default_value: true
- !ruby/object:Api::Type::String
name: 'username'
description: |
Username for the Active Directory account with permissions to create the compute account within the specified organizational unit.
required: true
- !ruby/object:Api::Type::String
name: 'password'
description: |
Password for specified username. Note - Manual changes done to the password will not be detected. Terraform will not re-apply the password, unless you use a new password in Terraform.
required: true
sensitive: true
paavan-gopala-reddy marked this conversation as resolved.
Show resolved Hide resolved
ignore_read: true
- !ruby/object:Api::Type::Array
name: 'backupOperators'
description: |
Domain user/group accounts to be added to the Backup Operators group of the SMB service. The Backup Operators group allows members to backup and restore files regardless of whether they have read or write access to the files. Comma-separated list.
required: false
item_type: Api::Type::String
- !ruby/object:Api::Type::Array
name: 'securityOperators'
description: |
Domain accounts that require elevated privileges such as `SeSecurityPrivilege` to manage security logs. Comma-separated list.
required: false
item_type: Api::Type::String
- !ruby/object:Api::Type::String
name: 'kdcHostname'
description: |
Hostname of the Active Directory server used as Kerberos Key Distribution Center. Only requried for volumes using kerberized NFSv4.1
required: false
- !ruby/object:Api::Type::String
name: 'kdcIp'
description: |
IP address of the Active Directory server used as Kerberos Key Distribution Center.
required: false
- !ruby/object:Api::Type::Boolean
name: 'nfsUsersWithLdap'
description: |
Local UNIX users on clients without valid user information in Active Directory are blocked from access to LDAP enabled volumes.
This option can be used to temporarily switch such volumes to AUTH_SYS authentication (user ID + 1-16 groups).
required: false
- !ruby/object:Api::Type::String
name: 'description'
description: |
An optional description of this resource.
required: false
- !ruby/object:Api::Type::Boolean
name: 'ldapSigning'
description: |
Specifies whether or not the LDAP traffic needs to be signed.
required: false
- !ruby/object:Api::Type::Boolean
name: 'encryptDcConnections'
description: |
If enabled, traffic between the SMB server to Domain Controller (DC) will be encrypted.
required: false
- !ruby/object:Api::Type::KeyValueLabels
name: labels
description: |
Labels as key value pairs. Example: `{ "owner": "Bob", "department": "finance", "purpose": "testing" }`.
required: false
- !ruby/object:Api::Type::String
name: 'stateDetails'
description: |
The state details of the Active Directory.
output: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
resource "google_netapp_active_directory" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['active_directory_full_name'] %>"
location = "us-central1"
domain = "ad.internal"
dns = "172.30.64.3"
net_bios_prefix = "smbserver"
username = "user"
password = "pass"
aes_encryption = false
backup_operators = ["test1", "test2"]
description = "ActiveDirectory is the public representation of the active directory config."
encrypt_dc_connections = false
kdc_hostname = "hostname"
kdc_ip = "10.10.0.11"
labels = {
"foo": "bar"
}
ldap_signing = false
nfs_users_with_ldap = false
organizational_unit = "CN=Computers"
security_operators = ["test1", "test2"]
site = "test-site"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

// ----------------------------------------------------------------------------
//
// *** AUTO GENERATED CODE *** Type: MMv1 ***
//
// ----------------------------------------------------------------------------
//
// This file is automatically generated by Magic Modules and manual
// changes will be clobbered when the file is regenerated.
//
// Please read more about how to change this file in
// .github/CONTRIBUTING.md.
//
// ----------------------------------------------------------------------------

package netapp_test

import (
"testing"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"

"github.com/hashicorp/terraform-provider-google/google/acctest"
)

func TestAccNetappactiveDirectory_activeDirectory_FullUpdate(t *testing.T) {
t.Parallel()

context := map[string]interface{}{
"random_suffix": acctest.RandString(t, 10),
}

acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
Steps: []resource.TestStep{
{
Config: testAccNetappactiveDirectory_activeDirectoryCreateExample_Full(context),
},
{
ResourceName: "google_netapp_active_directory.test_active_directory_full",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"location", "name", "pass", "labels", "terraform_labels"},
},
{
Config: testAccNetappactiveDirectory_activeDirectoryCreateExample_Update(context),
},
{
ResourceName: "google_netapp_active_directory.test_active_directory_full",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"location", "name", "pass", "labels", "terraform_labels"},
},
},
})
}

func testAccNetappactiveDirectory_activeDirectoryCreateExample_Full(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_netapp_active_directory" "test_active_directory_full" {
name = "tf-test-test-active-directory-full%{random_suffix}"
location = "us-central1"
domain = "ad.internal"
dns = "172.30.64.3"
net_bios_prefix = "smbserver"
username = "user"
password = "pass"
aes_encryption = false
backup_operators = ["test1", "test2"]
description = "ActiveDirectory is the public representation of the active directory config."
encrypt_dc_connections = false
kdc_hostname = "hostname"
kdc_ip = "10.10.0.11"
labels = {
"foo": "bar"
}
ldap_signing = false
nfs_users_with_ldap = false
organizational_unit = "CN=Computers"
security_operators = ["test1", "test2"]
site = "test-site"
}
`, context)
}

func testAccNetappactiveDirectory_activeDirectoryCreateExample_Update(context map[string]interface{}) string {
paavan-gopala-reddy marked this conversation as resolved.
Show resolved Hide resolved
return acctest.Nprintf(`
resource "google_netapp_active_directory" "test_active_directory_full" {
name = "tf-test-test-active-directory-full%{random_suffix}"
location = "us-central1"
domain = "ad.internal"
dns = "172.30.64.3"
net_bios_prefix = "smbup"
username = "user"
password = "pass"
aes_encryption = false
backup_operators = ["test1", "test2"]
description = "ActiveDirectory is the public representation of the active directory config."
encrypt_dc_connections = false
kdc_hostname = "hostname"
kdc_ip = "10.10.0.11"
labels = {
"foo": "bar"
}
ldap_signing = true
nfs_users_with_ldap = true
organizational_unit = "CN=Computers"
security_operators = ["test1", "test2"]
site = "test-site"
}
`, context)
}