diff --git a/modules/artifact-registry/README.md b/modules/artifact-registry/README.md
index 90853ab19..96638798f 100644
--- a/modules/artifact-registry/README.md
+++ b/modules/artifact-registry/README.md
@@ -300,19 +300,19 @@ module "additive_iam" {
| name | description | type | required | default |
|---|---|:---:|:---:|:---:|
| [cleanup_policies](variables.tf#L17) | Object containing details about the cleanup policies for an Artifact Registry repository. | map(object({…default = null | ✓ | |
-| [format](variables.tf#L63) | Repository format. | object({…}) | ✓ | |
-| [location](variables.tf#L213) | Registry location. Use `gcloud beta artifacts locations list' to get valid values. | string | ✓ | |
-| [name](variables.tf#L218) | Registry name. | string | ✓ | |
-| [project_id](variables.tf#L223) | Registry project id. | string | ✓ | |
+| [format](variables.tf#L62) | Repository format. | object({…}) | ✓ | |
+| [location](variables.tf#L212) | Registry location. Use `gcloud beta artifacts locations list' to get valid values. | string | ✓ | |
+| [name](variables.tf#L217) | Registry name. | string | ✓ | |
+| [project_id](variables.tf#L222) | Registry project id. | string | ✓ | |
| [cleanup_policy_dry_run](variables.tf#L38) | If true, the cleanup pipeline is prevented from deleting versions in this repository. | bool | | null |
| [description](variables.tf#L44) | An optional description for the repository. | string | | "Terraform-managed registry" |
-| [enable_vulnerability_scanning](variables.tf#L50) | Whether vulnerability scanning should be enabled in the repository. | bool | | true |
-| [encryption_key](variables.tf#L57) | The KMS key name to use for encryption at rest. | string | | null |
+| [enable_vulnerability_scanning](variables.tf#L50) | Whether vulnerability scanning should be enabled in the repository. | bool | | null |
+| [encryption_key](variables.tf#L56) | The KMS key name to use for encryption at rest. | string | | null |
| [iam](variables-iam.tf#L36) | IAM bindings in {ROLE => [MEMBERS]} format. | map(list(string)) | | {} |
| [iam_bindings](variables-iam.tf#L43) | Authoritative IAM bindings in {KEY => {role = ROLE, members = [], condition = {}}}. Keys are arbitrary. | map(object({…})) | | {} |
| [iam_bindings_additive](variables-iam.tf#L58) | Individual additive IAM bindings. Keys are arbitrary. | map(object({…})) | | {} |
| [iam_by_principals](variables-iam.tf#L73) | Authoritative IAM binding in {PRINCIPAL => [ROLES]} format. Principals need to be statically defined to avoid cycle errors. Merged internally with the `iam` variable. | map(list(string)) | | {} |
-| [labels](variables.tf#L207) | Labels to be attached to the registry. | map(string) | | {} |
+| [labels](variables.tf#L206) | Labels to be attached to the registry. | map(string) | | {} |
## Outputs
diff --git a/modules/artifact-registry/main.tf b/modules/artifact-registry/main.tf
index 665b85602..aa47cbbbe 100644
--- a/modules/artifact-registry/main.tf
+++ b/modules/artifact-registry/main.tf
@@ -33,7 +33,11 @@ resource "google_artifact_registry_repository" "registry" {
cleanup_policy_dry_run = var.cleanup_policy_dry_run
vulnerability_scanning_config {
- enablement_config = var.enable_vulnerability_scanning ? "INHERITED" : "DISABLED"
+ enablement_config = (
+ var.enable_vulnerability_scanning == true
+ ? "INHERITED"
+ : var.enable_vulnerability_scanning == false ? "DISABLED" : null
+ )
}
dynamic "cleanup_policies" {
diff --git a/modules/artifact-registry/variables.tf b/modules/artifact-registry/variables.tf
index 88c47215d..102b8374a 100644
--- a/modules/artifact-registry/variables.tf
+++ b/modules/artifact-registry/variables.tf
@@ -50,8 +50,7 @@ variable "description" {
variable "enable_vulnerability_scanning" {
description = "Whether vulnerability scanning should be enabled in the repository."
type = bool
- default = true
- nullable = false
+ default = null
}
variable "encryption_key" {