Skip to content

Commit

Permalink
Update ACM service perimeter resources to support Granular Controls
Browse files Browse the repository at this point in the history
groups
  • Loading branch information
Charles Leon committed Feb 29, 2024
1 parent 1253916 commit 6a5a915
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 25 deletions.
20 changes: 10 additions & 10 deletions mmv1/products/accesscontextmanager/ServicePerimeter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ properties:
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
individual user or service account only.
A list of identities that are allowed access through this `IngressPolicy`.
Should be in the format of an email address. The email address should
represent an individual user, service account, or Google group.
- !ruby/object:Api::Type::Array
name: 'sources'
description: |
Expand Down Expand Up @@ -365,8 +365,8 @@ properties:
name: 'identities'
description: |
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.
Should be in the format of an email address. The email address should
represent an individual user, service account, or Google group.
is_set: true
item_type: Api::Type::String
- !ruby/object:Api::Type::NestedObject
Expand Down Expand Up @@ -528,9 +528,9 @@ properties:
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
individual user or service account only.
A list of identities that are allowed access through this `IngressPolicy`.
Should be in the format of an email address. The email address should
represent an individual user, service account, or Google group.
- !ruby/object:Api::Type::Array
name: 'sources'
description: |
Expand Down Expand Up @@ -653,8 +653,8 @@ properties:
name: 'identities'
description: |
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.
Should be in the format of an email address. The email address should
represent an individual user, service account, or Google group.
item_type: Api::Type::String
is_set: true
- !ruby/object:Api::Type::NestedObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ properties:
name: 'identities'
description: |
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.
Should be in the format of an email address. The email address should
represent an individual user, service account, or Google group.
item_type: Api::Type::String
- !ruby/object:Api::Type::Array
name: 'sources'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ properties:
name: 'identities'
item_type: Api::Type::String
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
individual user or service account only.
A list of identities that are allowed access through this `IngressPolicy`.
Should be in the format of an email address. The email address should represent
an individual user, service account, or Google group.
- !ruby/object:Api::Type::Array
name: 'sources'
description: |
Expand Down
20 changes: 10 additions & 10 deletions mmv1/products/accesscontextmanager/ServicePerimeters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ properties:
is_set: true
item_type: Api::Type::String
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
individual user or service account only.
A list of identities that are allowed access through this `IngressPolicy`.
Should be in the format of an email address. The email address should
represent an individual user, service account, or Google group.
- !ruby/object:Api::Type::Array
name: 'sources'
description: |
Expand Down Expand Up @@ -330,8 +330,8 @@ properties:
name: 'identities'
description: |
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.
Should be in the format of an email address. The email address should
represent an individual user, service account, or Google group.
is_set: true
item_type: Api::Type::String
- !ruby/object:Api::Type::Array
Expand Down Expand Up @@ -514,9 +514,9 @@ properties:
is_set: true
item_type: Api::Type::String
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
individual user or service account only.
A list of identities that are allowed access through this `IngressPolicy`.
Should be in the format of an email address. The email address should
represent an individual user, service account, or Google group.
- !ruby/object:Api::Type::Array
name: 'sources'
description: |
Expand Down Expand Up @@ -624,8 +624,8 @@ properties:
name: 'identities'
description: |
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.
Should be in the format of an email address. The email address should
represent an individual user, service account, or Google group.
item_type: Api::Type::String
is_set: true
- !ruby/object:Api::Type::Array
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
resource "google_access_context_manager_access_policy" "access-policy" {
parent = "organizations/123456789"
title = "Policy with Granular Controls Group Support"
}

resource "google_access_context_manager_service_perimeter" "test-access" {
parent = "accessPolicies/${google_access_context_manager_access_policy.test-access.name}"
name = "accessPolicies/${google_access_context_manager_access_policy.test-access.name}/servicePerimeters/%s"
title = "%s"
perimeter_type = "PERIMETER_TYPE_REGULAR"
status {
restricted_services = ["bigquery.googleapis.com", "storage.googleapis.com"]

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
}
identities = ["group:database-admins@google.com"]
}

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

method_selectors {
method = "google.storage.objects.create"
}
}
}
}

egress_policies {
egress_from {
identities = ["group:database-admins@google.com"]
}
egress_to {
resources = [ "*" ]
operations {
service_name = "storage.googleapis.com"

method_selectors {
method = "google.storage.objects.create"
}
}
}
}
}
}

0 comments on commit 6a5a915

Please sign in to comment.