Allows configuring a single access level condition to be appended to an access level's conditions.
This resource is intended to be used in cases where it is not possible to compile a full list
of conditions to include in a google_access_context_manager_access_level
resource,
to enable them to be added separately.
To get more information about AccessLevelCondition, see:
resource "google_access_context_manager_access_level" "access-level-service-account" {
parent = "accessPolicies/${google_access_context_manager_access_policy.access-policy.name}"
name = "accessPolicies/${google_access_context_manager_access_policy.access-policy.name}/accessLevels/chromeos_no_lock"
title = "chromeos_no_lock"
basic {
conditions {
device_policy {
require_screen_lock = true
os_constraints {
os_type = "DESKTOP_CHROME_OS"
}
}
regions = [
"CH",
"IT",
"US",
]
}
}
lifecycle {
ignore_changes = [basic.0.conditions]
}
}
resource "google_service_account" "created-later" {
account_id = "my-account-id"
}
resource "google_access_context_manager_access_level_condition" "access-level-conditions" {
access_level = google_access_context_manager_access_level.access-level-service-account.name
ip_subnetworks = ["192.0.4.0/24"]
members = ["user:test@google.com", "user:test2@google.com", "serviceAccount:${google_service_account.created-later.email}"]
negate = false
device_policy {
require_screen_lock = false
require_admin_approval = false
require_corp_owned = true
os_constraints {
os_type = "DESKTOP_CHROME_OS"
}
}
regions = [
"IT",
"US",
]
}
resource "google_access_context_manager_access_policy" "access-policy" {
parent = "organizations/123456789"
title = "my policy"
}
The following arguments are supported:
access_level
-
(Required)
The name of the Access Level to add this condition to.ip_subnetworks
-
(Optional)
A list of CIDR block IP subnetwork specification. May be IPv4
or IPv6.
Note that for a CIDR IP address block, the specified IP address
portion must be properly truncated (i.e. all the host bits must
be zero) or the input is considered malformed. For example,
"192.0.2.0/24" is accepted but "192.0.2.1/24" is not. Similarly,
for IPv6, "2001:db8::/32" is accepted whereas "2001:db8::1/32"
is not. The originating IP of a request must be in one of the
listed subnets in order for this Condition to be true.
If empty, all IP addresses are allowed.
required_access_levels
-
(Optional)
A list of other access levels defined in the same Policy,
referenced by resource name. Referencing an AccessLevel which
does not exist is an error. All access levels listed must be
granted for the Condition to be true.
Format: accessPolicies/{policy_id}/accessLevels/{short_name}
members
-
(Optional)
An allowed list of members (users, service accounts).
Using groups is not supported yet.
The signed-in user originating the request must be a part of one
of the provided members. If not specified, a request may come
from any user (logged in/not logged in, not present in any
groups, etc.).
Formats: user:{emailid}
, serviceAccount:{emailid}
negate
-
(Optional)
Whether to negate the Condition. If true, the Condition becomes
a NAND over its non-empty fields, each field must be false for
the Condition overall to be satisfied. Defaults to false.
device_policy
-
(Optional)
Device specific restrictions, all restrictions must hold for
the Condition to be true. If not specified, all devices are
allowed.
Structure is documented below.
regions
-
(Optional)
The request must originate from one of the provided
countries/regions.
Format: A valid ISO 3166-1 alpha-2 code.
vpc_network_sources
-
(Optional)
The request must originate from one of the provided VPC networks in Google Cloud. Cannot specify this field together with ip_subnetworks
.
Structure is documented below.
The device_policy
block supports:
require_screen_lock
-
(Optional)
Whether or not screenlock is required for the DevicePolicy
to be true. Defaults to false.
allowed_encryption_statuses
-
(Optional)
A list of allowed encryptions statuses.
An empty list allows all statuses.
Each value may be one of: ENCRYPTION_UNSPECIFIED
, ENCRYPTION_UNSUPPORTED
, UNENCRYPTED
, ENCRYPTED
.
allowed_device_management_levels
-
(Optional)
A list of allowed device management levels.
An empty list allows all management levels.
Each value may be one of: MANAGEMENT_UNSPECIFIED
, NONE
, BASIC
, COMPLETE
.
os_constraints
-
(Optional)
A list of allowed OS versions.
An empty list allows all types and all versions.
Structure is documented below.
require_admin_approval
-
(Optional)
Whether the device needs to be approved by the customer admin.
require_corp_owned
-
(Optional)
Whether the device needs to be corp owned.
The os_constraints
block supports:
minimum_version
-
(Optional)
The minimum allowed OS version. If not set, any version
of this OS satisfies the constraint.
Format: "major.minor.patch" such as "10.5.301", "9.2.1".
os_type
-
(Required)
The operating system type of the device.
Possible values are: OS_UNSPECIFIED
, DESKTOP_MAC
, DESKTOP_WINDOWS
, DESKTOP_LINUX
, DESKTOP_CHROME_OS
, ANDROID
, IOS
.
The vpc_network_sources
block supports:
vpc_subnetwork
-
(Optional)
Sub networks within a VPC network.
Structure is documented below.The vpc_subnetwork
block supports:
network
-
(Required)
Required. Network name to be allowed by this Access Level. Networks of foreign organizations requires compute.network.get
permission to be granted to caller.
vpc_ip_subnetworks
-
(Optional)
CIDR block IP subnetwork specification. Must be IPv4.
In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format {{access_level}}
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.delete
- Default is 20 minutes.This resource does not support import.