Skip to content
Merged
16 changes: 16 additions & 0 deletions mmv1/products/accesscontextmanager/ServicePerimeter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ properties:
- status.0.access_levels
- status.0.restricted_services
item_type: Api::Type::String
is_set: true
- !ruby/object:Api::Type::Array
name: 'accessLevels'
description: |
Expand All @@ -175,6 +176,7 @@ properties:
- status.0.access_levels
- status.0.restricted_services
item_type: Api::Type::String
is_set: true
- !ruby/object:Api::Type::Array
name: 'restrictedServices'
description: |
Expand Down Expand Up @@ -236,6 +238,7 @@ properties:
- !ruby/object:Api::Type::Array
name: 'identities'
item_type: Api::Type::String
is_set: true
description: |
A list of identities that are allowed access through this ingress policy.
Should be in the format of email address. The email address should represent
Expand Down Expand Up @@ -275,6 +278,7 @@ properties:
- !ruby/object:Api::Type::Array
name: 'resources'
item_type: Api::Type::String
is_set: true
description: |
A list of resources, currently only projects in the form
`projects/<projectnumber>`, protected by this `ServicePerimeter`
Expand Down Expand Up @@ -348,6 +352,7 @@ properties:
A list of identities that are allowed access through this `EgressPolicy`.
Should be in the format of email address. The email address should
represent individual user or service account only.
is_set: true
item_type: Api::Type::String
- !ruby/object:Api::Type::NestedObject
name: 'egressTo'
Expand All @@ -357,6 +362,7 @@ properties:
properties:
- !ruby/object:Api::Type::Array
name: 'resources'
is_set: true
item_type: Api::Type::String
description: |
A list of resources, currently only projects in the form
Expand All @@ -366,6 +372,7 @@ properties:
the perimeter.
- !ruby/object:Api::Type::Array
name: 'externalResources'
is_set: true
item_type: Api::Type::String
description: |
A list of external resources that are allowed to be accessed. A request
Expand Down Expand Up @@ -423,6 +430,7 @@ properties:
- spec.0.access_levels
- spec.0.restricted_services
item_type: Api::Type::String
is_set: true
- !ruby/object:Api::Type::Array
name: 'accessLevels'
description: |
Expand All @@ -441,6 +449,7 @@ properties:
- spec.0.access_levels
- spec.0.restricted_services
item_type: Api::Type::String
is_set: true
- !ruby/object:Api::Type::Array
name: 'restrictedServices'
description: |
Expand All @@ -454,6 +463,7 @@ properties:
- spec.0.access_levels
- spec.0.restricted_services
item_type: Api::Type::String
is_set: true
- !ruby/object:Api::Type::NestedObject
name: 'vpcAccessibleServices'
description: |
Expand All @@ -471,6 +481,7 @@ properties:
The list of APIs usable within the Service Perimeter.
Must be empty unless `enableRestriction` is True.
item_type: Api::Type::String
is_set: true
- !ruby/object:Api::Type::Array
name: 'ingressPolicies'
description: |
Expand Down Expand Up @@ -500,6 +511,7 @@ properties:
- !ruby/object:Api::Type::Array
name: 'identities'
item_type: Api::Type::String
is_set: true
description: |
A list of identities that are allowed access through this ingress policy.
Should be in the format of email address. The email address should represent
Expand Down Expand Up @@ -539,6 +551,7 @@ properties:
- !ruby/object:Api::Type::Array
name: 'resources'
item_type: Api::Type::String
is_set: true
description: |
A list of resources, currently only projects in the form
`projects/<projectnumber>`, protected by this `ServicePerimeter`
Expand Down Expand Up @@ -613,6 +626,7 @@ properties:
Should be in the format of email address. The email address should
represent individual user or service account only.
item_type: Api::Type::String
is_set: true
- !ruby/object:Api::Type::NestedObject
name: 'egressTo'
description: |
Expand All @@ -622,6 +636,7 @@ properties:
- !ruby/object:Api::Type::Array
name: 'resources'
item_type: Api::Type::String
is_set: true
description: |
A list of resources, currently only projects in the form
`projects/<projectnumber>`, that match this to stanza. A request matches
Expand All @@ -631,6 +646,7 @@ properties:
- !ruby/object:Api::Type::Array
name: 'externalResources'
item_type: Api::Type::String
is_set: true
description: |
A list of external resources that are allowed to be accessed. A request
matches if it contains an external resource in this list (Example:
Expand Down
18 changes: 17 additions & 1 deletion mmv1/products/accesscontextmanager/ServicePerimeters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ properties:
name: 'servicePerimeters'
description: |
The desired Service Perimeters that should replace all existing Service Perimeters in the Access Policy.
is_set: true
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
Expand Down Expand Up @@ -133,6 +132,7 @@ properties:
# - status.0.access_levels
# - status.0.restricted_services
item_type: Api::Type::String
is_set: true
- !ruby/object:Api::Type::Array
name: 'accessLevels'
description: |
Expand All @@ -153,6 +153,7 @@ properties:
# - status.0.access_levels
# - status.0.restricted_services
item_type: Api::Type::String
is_set: true
- !ruby/object:Api::Type::Array
name: 'restrictedServices'
description: |
Expand Down Expand Up @@ -194,6 +195,7 @@ properties:
have multiple `IngressPolicies`, each of which is evaluated
separately. Access is granted if any `Ingress Policy` grants it.
Must be empty for a perimeter bridge.
is_set: true
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::NestedObject
Expand All @@ -215,6 +217,7 @@ properties:
- :ANY_SERVICE_ACCOUNT
- !ruby/object:Api::Type::Array
name: 'identities'
is_set: true
item_type: Api::Type::String
description: |
A list of identities that are allowed access through this ingress policy.
Expand Down Expand Up @@ -255,6 +258,7 @@ properties:
- !ruby/object:Api::Type::Array
name: 'resources'
item_type: Api::Type::String
is_set: true
description: |
A list of resources, currently only projects in the form
`projects/<projectnumber>`, protected by this `ServicePerimeter`
Expand Down Expand Up @@ -328,6 +332,7 @@ properties:
A list of identities that are allowed access through this `EgressPolicy`.
Should be in the format of email address. The email address should
represent individual user or service account only.
is_set: true
item_type: Api::Type::String
- !ruby/object:Api::Type::NestedObject
name: 'egressTo'
Expand All @@ -338,6 +343,7 @@ properties:
- !ruby/object:Api::Type::Array
name: 'resources'
item_type: Api::Type::String
is_set: true
description: |
A list of resources, currently only projects in the form
`projects/<projectnumber>`, that match this to stanza. A request matches
Expand All @@ -347,6 +353,7 @@ properties:
- !ruby/object:Api::Type::Array
name: 'externalResources'
item_type: Api::Type::String
is_set: true
description: |
A list of external resources that are allowed to be accessed. A request
matches if it contains an external resource in this list (Example:
Expand Down Expand Up @@ -404,9 +411,11 @@ properties:
# - spec.0.resources
# - spec.0.access_levels
# - spec.0.restricted_services
is_set: true
item_type: Api::Type::String
- !ruby/object:Api::Type::Array
name: 'accessLevels'
is_set: true
description: |
A list of AccessLevel resource names that allow resources within
the ServicePerimeter to be accessed from the internet.
Expand Down Expand Up @@ -440,6 +449,7 @@ properties:
# - spec.0.access_levels
# - spec.0.restricted_services
item_type: Api::Type::String
is_set: true
- !ruby/object:Api::Type::NestedObject
name: 'vpcAccessibleServices'
description: |
Expand All @@ -457,6 +467,7 @@ properties:
The list of APIs usable within the Service Perimeter.
Must be empty unless `enableRestriction` is True.
item_type: Api::Type::String
is_set: true
- !ruby/object:Api::Type::Array
name: 'ingressPolicies'
description: |
Expand Down Expand Up @@ -485,6 +496,7 @@ properties:
- :ANY_SERVICE_ACCOUNT
- !ruby/object:Api::Type::Array
name: 'identities'
is_set: true
item_type: Api::Type::String
description: |
A list of identities that are allowed access through this ingress policy.
Expand Down Expand Up @@ -525,6 +537,7 @@ properties:
- !ruby/object:Api::Type::Array
name: 'resources'
item_type: Api::Type::String
is_set: true
description: |
A list of resources, currently only projects in the form
`projects/<projectnumber>`, protected by this `ServicePerimeter`
Expand Down Expand Up @@ -599,6 +612,7 @@ properties:
Should be in the format of email address. The email address should
represent individual user or service account only.
item_type: Api::Type::String
is_set: true
- !ruby/object:Api::Type::NestedObject
name: 'egressTo'
description: |
Expand All @@ -608,6 +622,7 @@ properties:
- !ruby/object:Api::Type::Array
name: 'resources'
item_type: Api::Type::String
is_set: true
description: |
A list of resources, currently only projects in the form
`projects/<projectnumber>`, that match this to stanza. A request matches
Expand All @@ -617,6 +632,7 @@ properties:
- !ruby/object:Api::Type::Array
name: 'externalResources'
item_type: Api::Type::String
is_set: true
description: |
A list of external resources that are allowed to be accessed. A request
matches if it contains an external resource in this list (Example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,83 @@ resource "google_access_context_manager_service_perimeter" "test-access" {
name = "accessPolicies/${google_access_context_manager_access_policy.test-access.name}/servicePerimeters/%s"
title = "%s"
perimeter_type = "PERIMETER_TYPE_REGULAR"
use_explicit_dry_run_spec = true
spec {
restricted_services = ["bigquery.googleapis.com", "storage.googleapis.com"]
access_levels = [google_access_context_manager_access_level.test-access.name]

vpc_accessible_services {
enable_restriction = true
allowed_services = ["bigquery.googleapis.com", "storage.googleapis.com"]
}

ingress_policies {
ingress_from {
sources {
access_level = google_access_context_manager_access_level.test-access.name
}
identity_type = "ANY_IDENTITY"
}

ingress_to {
resources = [ "*" ]
operations {
service_name = "bigquery.googleapis.com"

method_selectors {
method = "BigQueryStorage.ReadRows"
}

method_selectors {
method = "TableService.ListTables"
}

method_selectors {
permission = "bigquery.jobs.get"
}
}

operations {
service_name = "storage.googleapis.com"

method_selectors {
method = "google.storage.objects.create"
}
}
}
}
ingress_policies {
ingress_from {
identities = ["user:test@google.com"]
}
ingress_to {
resources = ["*"]
}
}

egress_policies {
egress_from {
identity_type = "ANY_USER_ACCOUNT"
}
egress_to {
operations {
service_name = "bigquery.googleapis.com"
method_selectors {
permission = "externalResource.read"
}
}
external_resources = ["s3://bucket1"]
}
}
egress_policies {
egress_from {
identities = ["user:test@google.com"]
}
egress_to {
resources = ["*"]
}
}
}
status {
restricted_services = ["bigquery.googleapis.com", "storage.googleapis.com"]
access_levels = [google_access_context_manager_access_level.test-access.name]
Expand Down Expand Up @@ -251,11 +328,36 @@ resource "google_access_context_manager_service_perimeter" "test-access" {
}
}
}
ingress_policies {
ingress_from {
identities = ["user:test@google.com"]
}
ingress_to {
resources = ["*"]
}
}

egress_policies {
egress_from {
identity_type = "ANY_USER_ACCOUNT"
}
egress_to {
operations {
service_name = "bigquery.googleapis.com"
method_selectors {
permission = "externalResource.read"
}
}
external_resources = ["s3://bucket1"]
}
}
egress_policies {
egress_from {
identities = ["user:test@google.com"]
}
egress_to {
resources = ["*"]
}
}
}
}
Expand Down
Loading