Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add requireVerifiedChromeOs as optional #9071

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
3 changes: 3 additions & 0 deletions .changelog/4758.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
accesscontextmanager: added support for `require_verified_chrome_os` in basic access levels.
```
25 changes: 23 additions & 2 deletions google/resource_access_context_manager_access_level.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ An empty list allows all types and all versions.`,
of this OS satisfies the constraint.
Format: "major.minor.patch" such as "10.5.301", "9.2.1".`,
},
"require_verified_chrome_os": {
Type: schema.TypeBool,
Optional: true,
Description: `If you specify DESKTOP_CHROME_OS for osType, you can optionally include requireVerifiedChromeOs to require Chrome Verified Access.`,
},
},
},
},
Expand Down Expand Up @@ -695,8 +700,9 @@ func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstrai
continue
}
transformed = append(transformed, map[string]interface{}{
"minimum_version": flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsMinimumVersion(original["minimumVersion"], d, config),
"os_type": flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsOsType(original["osType"], d, config),
"minimum_version": flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsMinimumVersion(original["minimumVersion"], d, config),
"require_verified_chrome_os": flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsRequireVerifiedChromeOs(original["requireVerifiedChromeOs"], d, config),
"os_type": flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsOsType(original["osType"], d, config),
})
}
return transformed
Expand All @@ -705,6 +711,10 @@ func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstrai
return v
}

func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsRequireVerifiedChromeOs(v interface{}, d *schema.ResourceData, config *Config) interface{} {
return v
}

func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsOsType(v interface{}, d *schema.ResourceData, config *Config) interface{} {
return v
}
Expand Down Expand Up @@ -967,6 +977,13 @@ func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstrain
transformed["minimumVersion"] = transformedMinimumVersion
}

transformedRequireVerifiedChromeOs, err := expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsRequireVerifiedChromeOs(original["require_verified_chrome_os"], d, config)
if err != nil {
return nil, err
} else if val := reflect.ValueOf(transformedRequireVerifiedChromeOs); val.IsValid() && !isEmptyValue(val) {
transformed["requireVerifiedChromeOs"] = transformedRequireVerifiedChromeOs
}

transformedOsType, err := expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsOsType(original["os_type"], d, config)
if err != nil {
return nil, err
Expand All @@ -983,6 +1000,10 @@ func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstrain
return v, nil
}

func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsRequireVerifiedChromeOs(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
return v, nil
}

func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsOsType(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
return v, nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ resource "google_access_context_manager_access_level" "test-access" {
require_screen_lock = true
os_constraints {
os_type = "DESKTOP_CHROME_OS"
require_verified_chrome_os = true
}
}
regions = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ resource "google_access_context_manager_access_level" "test-access" {
require_corp_owned = true
os_constraints {
os_type = "DESKTOP_CHROME_OS"
require_verified_chrome_os = true
}
}
regions = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ The `os_constraints` block supports:
of this OS satisfies the constraint.
Format: "major.minor.patch" such as "10.5.301", "9.2.1".

* `require_verified_chrome_os` -
(Optional)
If you specify DESKTOP_CHROME_OS for osType, you can optionally include requireVerifiedChromeOs to require Chrome Verified Access.

* `os_type` -
(Required)
The operating system type of the device.
Expand Down