Skip to content

Commit

Permalink
Add vulnerability scanning config to Artifact Registry repository
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyqian2 committed Dec 10, 2024
1 parent 06ac55f commit 9d4ffa6
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
34 changes: 34 additions & 0 deletions mmv1/products/artifactregistry/Repository.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ examples:
# Ignore this field as it is INPUT_ONLY. AR will not return this in the
# response.
- 'remote_repository_config.0.disable_upstream_validation'
- name: 'artifact_registry_repository_vulnerability_scanning'
primary_resource_id: 'my-repo'
primary_resource_name: 'fmt.Sprintf("tf-test-my-repository%s", context["random_suffix"])'
vars:
repository_id: 'my-repository'
desc: 'example docker repository with vulnerability scanning config'
parameters:
- name: 'repository_id'
type: String
Expand Down Expand Up @@ -736,3 +742,31 @@ properties:
description: |-
If true, the cleanup pipeline is prevented from deleting versions in this
repository.
- name: 'vulnerabilityScanningConfig'
type: NestedObject
description: |-
Configuration for vulnerability scanning of artifacts stored in this repository.
allow_empty_object: true
default_from_api: true
properties:
- name: 'enablementConfig'
type: Enum
description: |-
This configures whether vulnerability scanning is automatically performed for artifacts pushed to this repository.
enum_values:
- 'INHERITED'
- 'DISABLED'
- name: 'enablementState'
type: Enum
description: |-
This field returns whether scanning is active for this repository.
output: true
enum_values:
- 'SCANNING_UNSUPPORTED'
- 'SCANNING_DISABLED'
- 'SCANNING_ACTIVE'
- name: 'enablementStateReason'
type: String
description: |-
This provides an explanation for the state of scanning on this repository.
output: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "google_artifact_registry_repository" "{{$.PrimaryResourceId}}" {
location = "us-central1"
repository_id = "{{index $.Vars "repository_id"}}"
description = "{{index $.Vars "desc"}}"
format = "DOCKER"
vulnerability_scanning_config {
enablement_config = "INHERITED"
}
}

0 comments on commit 9d4ffa6

Please sign in to comment.