Vpc sc allow null for identity type (#1632)
* vpc-sc : allow null for identity_type * cloudsql-instance : fmt * vpc-sc: tfdoc * modules/vpc-sc: update the test result for the identity_type field * cloudsql-instance: remove empty line
This commit is contained in:
parent
c63884d52e
commit
c558d9b753
|
@ -185,7 +185,6 @@ module "test" {
|
|||
|
||||
<!-- TFDOC OPTS files:1 -->
|
||||
<!-- BEGIN TFDOC -->
|
||||
|
||||
## Files
|
||||
|
||||
| name | description | resources |
|
||||
|
@ -205,10 +204,10 @@ module "test" {
|
|||
| [access_policy](variables.tf#L56) | Access Policy name, set to null if creating one. | <code>string</code> | ✓ | |
|
||||
| [access_levels](variables.tf#L17) | Access level definitions. | <code title="map(object({ combining_function = optional(string) conditions = optional(list(object({ device_policy = optional(object({ allowed_device_management_levels = optional(list(string)) allowed_encryption_statuses = optional(list(string)) require_admin_approval = bool require_corp_owned = bool require_screen_lock = optional(bool) os_constraints = optional(list(object({ os_type = string minimum_version = optional(string) require_verified_chrome_os = optional(bool) }))) })) ip_subnetworks = optional(list(string), []) members = optional(list(string), []) negate = optional(bool) regions = optional(list(string), []) required_access_levels = optional(list(string), []) })), []) description = optional(string) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
| [access_policy_create](variables.tf#L61) | Access Policy configuration, fill in to create. Parent is in 'organizations/123456' format, scopes are in 'folders/456789' or 'projects/project_id' format. | <code title="object({ parent = string title = string scopes = optional(list(string), null) })">object({…})</code> | | <code>null</code> |
|
||||
| [egress_policies](variables.tf#L71) | Egress policy definitions that can be referenced in perimeters. | <code title="map(object({ from = object({ identity_type = optional(string, "ANY_IDENTITY") identities = optional(list(string)) }) to = object({ operations = optional(list(object({ method_selectors = optional(list(string)) permission_selectors = optional(list(string)) service_name = string })), []) resources = optional(list(string)) resource_type_external = optional(bool, false) }) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
| [ingress_policies](variables.tf#L101) | Ingress policy definitions that can be referenced in perimeters. | <code title="map(object({ from = object({ access_levels = optional(list(string), []) identity_type = optional(string) identities = optional(list(string)) resources = optional(list(string), []) }) to = object({ operations = optional(list(object({ method_selectors = optional(list(string)) permission_selectors = optional(list(string)) service_name = string })), []) resources = optional(list(string)) }) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
| [service_perimeters_bridge](variables.tf#L133) | Bridge service perimeters. | <code title="map(object({ spec_resources = optional(list(string)) status_resources = optional(list(string)) use_explicit_dry_run_spec = optional(bool, false) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
| [service_perimeters_regular](variables.tf#L143) | Regular service perimeters. | <code title="map(object({ spec = optional(object({ access_levels = optional(list(string)) resources = optional(list(string)) restricted_services = optional(list(string)) egress_policies = optional(list(string)) ingress_policies = optional(list(string)) vpc_accessible_services = optional(object({ allowed_services = list(string) enable_restriction = bool })) })) status = optional(object({ access_levels = optional(list(string)) resources = optional(list(string)) restricted_services = optional(list(string)) egress_policies = optional(list(string)) ingress_policies = optional(list(string)) vpc_accessible_services = optional(object({ allowed_services = list(string) enable_restriction = bool })) })) use_explicit_dry_run_spec = optional(bool, false) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
| [egress_policies](variables.tf#L71) | Egress policy definitions that can be referenced in perimeters. | <code title="map(object({ from = object({ identity_type = optional(string) identities = optional(list(string)) }) to = object({ operations = optional(list(object({ method_selectors = optional(list(string)) permission_selectors = optional(list(string)) service_name = string })), []) resources = optional(list(string)) resource_type_external = optional(bool, false) }) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
| [ingress_policies](variables.tf#L102) | Ingress policy definitions that can be referenced in perimeters. | <code title="map(object({ from = object({ access_levels = optional(list(string), []) identity_type = optional(string) identities = optional(list(string)) resources = optional(list(string), []) }) to = object({ operations = optional(list(object({ method_selectors = optional(list(string)) permission_selectors = optional(list(string)) service_name = string })), []) resources = optional(list(string)) }) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
| [service_perimeters_bridge](variables.tf#L134) | Bridge service perimeters. | <code title="map(object({ spec_resources = optional(list(string)) status_resources = optional(list(string)) use_explicit_dry_run_spec = optional(bool, false) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
| [service_perimeters_regular](variables.tf#L144) | Regular service perimeters. | <code title="map(object({ spec = optional(object({ access_levels = optional(list(string)) resources = optional(list(string)) restricted_services = optional(list(string)) egress_policies = optional(list(string)) ingress_policies = optional(list(string)) vpc_accessible_services = optional(object({ allowed_services = list(string) enable_restriction = bool })) })) status = optional(object({ access_levels = optional(list(string)) resources = optional(list(string)) restricted_services = optional(list(string)) egress_policies = optional(list(string)) ingress_policies = optional(list(string)) vpc_accessible_services = optional(object({ allowed_services = list(string) enable_restriction = bool })) })) use_explicit_dry_run_spec = optional(bool, false) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
|
||||
## Outputs
|
||||
|
||||
|
@ -221,5 +220,4 @@ module "test" {
|
|||
| [id](outputs.tf#L42) | Fully qualified access policy id. | |
|
||||
| [service_perimeters_bridge](outputs.tf#L47) | Bridge service perimeter resources. | |
|
||||
| [service_perimeters_regular](outputs.tf#L52) | Regular service perimeter resources. | |
|
||||
|
||||
<!-- END TFDOC -->
|
||||
|
|
|
@ -72,7 +72,7 @@ variable "egress_policies" {
|
|||
description = "Egress policy definitions that can be referenced in perimeters."
|
||||
type = map(object({
|
||||
from = object({
|
||||
identity_type = optional(string, "ANY_IDENTITY")
|
||||
identity_type = optional(string)
|
||||
identities = optional(list(string))
|
||||
})
|
||||
to = object({
|
||||
|
@ -89,10 +89,11 @@ variable "egress_policies" {
|
|||
nullable = false
|
||||
validation {
|
||||
condition = alltrue([
|
||||
for k, v in var.egress_policies : contains([
|
||||
for k, v in var.egress_policies :
|
||||
v.from.identity_type == null || contains([
|
||||
"IDENTITY_TYPE_UNSPECIFIED", "ANY_IDENTITY",
|
||||
"ANY_USER", "ANY_SERVICE_ACCOUNT", ""
|
||||
], v.from.identity_type)
|
||||
"ANY_USER", "ANY_SERVICE_ACCOUNT"
|
||||
], coalesce(v.from.identity_type, "-"))
|
||||
])
|
||||
error_message = "Invalid `from.identity_type` value in egress policy."
|
||||
}
|
||||
|
@ -126,7 +127,7 @@ variable "ingress_policies" {
|
|||
"ANY_USER", "ANY_SERVICE_ACCOUNT"
|
||||
], coalesce(v.from.identity_type, "-"))
|
||||
])
|
||||
error_message = "Invalid `from.identity_type` value in eress policy."
|
||||
error_message = "Invalid `from.identity_type` value in ingress policy."
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ values:
|
|||
- egress_from:
|
||||
- identities:
|
||||
- serviceAccount:foo@myproject.iam.gserviceaccount.com
|
||||
identity_type: ANY_IDENTITY
|
||||
identity_type: null
|
||||
egress_to:
|
||||
- external_resources: null
|
||||
operations:
|
||||
|
|
Loading…
Reference in New Issue