Skip to content

Commit

Permalink
Add NetworkSecurity AddressGroup IAM support (GoogleCloudPlatform#9760)
Browse files Browse the repository at this point in the history
* add: NetworkSecurity AddressGroup IAM support

* Remove IAM condition support, since API does not seem to support it yet.

* Fix copyright

* Fix tests

* Add legacy_name

* Update legacy_name

Co-authored-by: Nick Elliot <nickelliot@google.com>

---------

Co-authored-by: Nick Elliot <nickelliot@google.com>
  • Loading branch information
2 people authored and bskaplan committed Jan 17, 2024
1 parent 6678112 commit 19109d0
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
65 changes: 65 additions & 0 deletions mmv1/products/networksecurity/ProjectAddressGroup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# 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: "ProjectAddressGroup"
legacy_name: 'google_network_security_address_group'
base_url: "projects/{{project}}/locations/{{location}}/addressGroups"
self_link: "projects/{{project}}/locations/{{location}}/addressGroups/{{name}}"
# This resource is only used to generate IAM resources. They do not correspond to real
# GCP resources, and should not be used to generate anything other than IAM support.
# IAM resources for AddressGroup are moved to a separate configuration because the AddressGroup
# resourcesupports both organization and project levels,
# but IAM support exists only on the project level Address Groups
description: |
Only used to generate IAM resources for project level address groups
exclude_tgc: true
exclude_resource: true
iam_policy: !ruby/object:Api::Resource::IamPolicy
method_name_separator: ":"
allowed_iam_role: 'roles/compute.networkAdmin'
parent_resource_type: "google_network_security_address_group"
parent_resource_attribute: "name"
skip_import_test: true
base_url: "projects/{{project}}/locations/{{location}}/addressGroups/{{name}}"
iam_conditions_request_type: null
example_config_body: "templates/terraform/iam/example_config_body/networksecurity_project_address_group.tf.erb"
import_format:
[
"projects/{{project}}/locations/{{location}}/addressGroups/{{name}}",
"{{project}}/{{location}}/{{name}}",
"{{location}}/{{name}}",
"{{name}}",
]
id_format: "projects/{{project}}/locations/{{location}}/addressGroups/{{name}}"
examples:
- !ruby/object:Provider::Terraform::Examples
name: "network_security_address_groups_basic"
primary_resource_id: "default"
vars:
resource_name: "my-project-address-group"
test_env_vars:
project: :PROJECT_NAME
properties:
- !ruby/object:Api::Type::String
name: "name"
required: true
url_param_only: true
description: |
Name of the AddressGroup resource.
- !ruby/object:Api::Type::String
name: "location"
required: true
description: |
The location of the gateway security policy.
url_param_only: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
project = "%{project}"
location = google_network_security_address_group.default.location
name = google_network_security_address_group.default.name

0 comments on commit 19109d0

Please sign in to comment.