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 5 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
190 changes: 190 additions & 0 deletions mmv1/products/netapp/activeDirectory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
# 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:
'QUICKSTART_TITLE': 'https://cloud.google.com/netapp/volumes/docs/reference/rest/v1/projects.locations.activeDirectories'
paavan-gopala-reddy marked this conversation as resolved.
Show resolved Hide resolved
api: 'https://cloud.google.com/netapp/volumes/docs/reference/rest/v1/projects.locations.activeDirectories'

paavan-gopala-reddy marked this conversation as resolved.
Show resolved Hide resolved
base_url: projects/{{project}}/locations/{{location}}/activeDirectories

self_link: projects/{{project}}/locations/{{location}}/activeDirectories/{{active_directory_id}}

create_url: projects/{{project}}/locations/{{location}}/activeDirectories?activeDirectoryId={{active_directory_id}}

create_verb: :POST

update_url: projects/{{project}}/locations/{{location}}/activeDirectories/{{active_directory_id}}

update_verb: :PATCH

update_mask: true

delete_url: projects/{{project}}/locations/{{location}}/activeDirectories/{{active_directory_id}}

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/{{active_directory_id}}'
import_format: ['projects/{{project}}/locations/{{location}}/activeDirectories/{{active_directory_id}}']

parameters:
- !ruby/object:Api::Type::String
name: 'location'
required: true
immutable: true
url_param_only: true
description: |
LOCATION_DESCRIPTION
- !ruby/object:Api::Type::String
name: 'active_directory_id'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this parameter "name" like with any other Google resource?

description:
'ID of the active directory to create
`[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.'
required: true
immutable: true
url_param_only: true
examples:
- !ruby/object:Provider::Terraform::Examples
name: 'Active_Directory_Create'
paavan-gopala-reddy marked this conversation as resolved.
Show resolved Hide resolved
primary_resource_id: 'test_active_directory'
vars:
active_directory_name: 'test-active-directory'
properties:
# Fields go here
- !ruby/object:Api::Type::String
name: name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this is good for. "name" is the resourceID of this resource, as suggested above. IMHO this parameter here needs to get deleted.

output: true
description: |
The resource name of the active directory. Format: projects/{projectNumber}/locations/{locationId}/activeDirectories/{activeDirectoryId}.
- !ruby/object:Api::Type::String
name: 'createTime'
description: |
Create time of the active directory. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
output: true
- !ruby/object:Api::Type::Enum
name: 'state'
description: |
The state of the AD.
values:
- :STATE_UNSPECIFIED
- :CREATING
- :READY
- :UPDATING
- :DELETING
- :IN_USE
- :ERROR
output: true
- !ruby/object:Api::Type::String
name: 'domain'
description: |
Name of the Active Directory domain
required: true
- !ruby/object:Api::Type::String
name: 'site'
description: |
The Active Directory site the service will limit Domain Controller discovery too.
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: |
NetBIOSPrefix is used as a prefix for SMB server name.
required: true
- !ruby/object:Api::Type::String
name: 'organizationalUnit'
description: |
The Organizational Unit (OU) within the Windows Active Directory the user belongs to.
required: false
default_from_api: true
- !ruby/object:Api::Type::Boolean
name: 'aesEncryption'
description: |
If enabled, AES encryption will be enabled for SMB communication.
required: false
- !ruby/object:Api::Type::String
name: 'username'
description: |
Username of the Active Directory domain administrator.
required: true
- !ruby/object:Api::Type::String
name: 'password'
description: |
Password of the Active Directory domain administrator.
required: true
sensitive: true
paavan-gopala-reddy marked this conversation as resolved.
Show resolved Hide resolved
ignore_read: true
- !ruby/object:Api::Type::String
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acording to APi definiton, backOperators is an list of strings and not a string.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the error I got due to the misconfiguration when sending only a string:
│ Error: Error reading activeDirectory: backup_operators: '' expected type 'string', got unconvertible type '[]interface {}', value: '[bob1]' │ │ with google_netapp_active_directory.my-ad, │ on main.tf line 17, in resource "google_netapp_active_directory" "my-ad": │ 17: resource "google_netapp_active_directory" "my-ad" {

name: 'backupOperators'
description: |
Users to be added to the Built-in Backup Operator active directory group.
required: false
- !ruby/object:Api::Type::String
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acording to APi definiton, securityOperators is an list of strings and not a string.

name: 'securityOperators'
description: |
Domain users to be given the SeSecurityPrivilege.
required: false
- !ruby/object:Api::Type::String
name: 'kdcHostname'
description: |
Name of the active directory machine. This optional parameter is used only while creating kerberos volume
required: false
- !ruby/object:Api::Type::String
name: 'kdcIp'
description: |
KDC server IP address for the active directory machine.
required: false
- !ruby/object:Api::Type::Boolean
name: 'nfsUsersWithLdap'
description: |
If enabled, will allow access to local users and LDAP users. If access is needed for only LDAP users, it has to be disabled.
required: false
- !ruby/object:Api::Type::String
name: 'description'
description: |
Description of the active directory.
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.An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
required: false
- !ruby/object:Api::Type::String
name: 'stateDetails'
description: |
The state details of the Active Directory.
output: true
paavan-gopala-reddy marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "google_netapp_active_directory" "<%= ctx[:primary_resource_id] %>" {
active_directory_id = "<%= ctx[:vars]['active_directory_name'] %>"
location = "us-central1"
domain = "ad.internal"
dns = "172.30.64.3"
net_bios_prefix = "smbserver"
username = "user"
password = "pass"
}