Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

ACM: service perimeter's vpc_accessible_services #371

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ Properties that can be accessed from the `google_access_context_manager_service_

* `restricted_services`: GCP services that are subject to the Service Perimeter restrictions. Must contain a list of services. For example, if `storage.googleapis.com` is specified, access to the storage buckets inside the perimeter must meet the perimeter's access restrictions.

* `vpc_accessible_services`: Specifies how APIs are allowed to communicate within the Service Perimeter.

* `enable_restriction`: Whether to restrict API calls within the Service Perimeter to the list of APIs specified in 'allowedServices'.

* `allowed_services`: The list of APIs usable within the Service Perimeter. Must be empty unless `enableRestriction` is True.

* `parent`: The AccessPolicy this ServicePerimeter lives in. Format: accessPolicies/{policy_id}

* `name`: Resource name for the ServicePerimeter. The short_name component must begin with a letter and only include alphanumeric and '_'. Format: accessPolicies/{policy_id}/servicePerimeters/{short_name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/accesscontextmanager/property/serviceperimeter_status_vpc_accessible_services'
module GoogleInSpec
module AccessContextManager
module Property
Expand All @@ -23,12 +24,15 @@ class ServicePerimeterStatus

attr_reader :restricted_services

attr_reader :vpc_accessible_services

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@resources = args['resources']
@access_levels = args['accessLevels']
@restricted_services = args['restrictedServices']
@vpc_accessible_services = GoogleInSpec::AccessContextManager::Property::ServicePerimeterStatusVPCAccessibleServices.new(args['vpcAccessibleServices'], to_s)
end

def to_s
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# 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 README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module AccessContextManager
module Property
class ServicePerimeterStatusVPCAccessibleServices
attr_reader :enable_restriction

attr_reader :allowed_services

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@enable_restriction = args['enableRestriction']
@allowed_services = args['allowedServices']
end

def to_s
"#{@parent_identifier} ServicePerimeterStatusVPCAccessibleServices"
end
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# ----------------------------------------------------------------------------
require 'gcp_backend'
require 'google/accesscontextmanager/property/serviceperimeter_status'
require 'google/accesscontextmanager/property/serviceperimeter_status_vpc_accessible_services'

# A provider to manage Access Context Manager resources.
class AccessContextManagerServicePerimeter < GcpResourceBase
Expand Down