artifact-registry: support common_repository in maven, npm, and python remote formats (#3944)

Add `common_repository` support to `maven`, `npm`, and `python` remote repository configurations in the `artifact-registry` module. This replaces the deprecated `custom_repository` feature which is now discouraged by the provider.

Existing README example `registry-mirror` has been updated to use `common_repository`. A legacy test case `legacy_custom_repo` has been added to the bottom of `README.md` to ensure backward compatibility for `custom_repository` continues to work.

TAG=agy
CONV=ffe77e65-ccef-4701-95e6-4ba2d2446f1b
This commit is contained in:
Ludovico Magnocavallo
2026-05-07 12:00:40 +02:00
committed by GitHub
parent bf9ccb7547
commit 48fdf03233
8 changed files with 163 additions and 17 deletions

View File

@@ -0,0 +1,57 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
values:
module.legacy_custom_repo.google_artifact_registry_repository.registry:
cleanup_policies: []
cleanup_policy_dry_run: null
description: Terraform-managed registry
docker_config: []
effective_labels:
goog-terraform-provisioned: 'true'
format: MAVEN
kms_key_name: null
labels: null
location: europe-west1
maven_config: []
mode: REMOTE_REPOSITORY
project: myproject
remote_repository_config:
- apt_repository: []
common_repository: []
description: null
disable_upstream_validation: null
docker_repository: []
maven_repository:
- custom_repository:
- uri: https://example.com
public_repository: null
npm_repository: []
python_repository: []
upstream_credentials: []
yum_repository: []
repository_id: legacy-custom
terraform_labels:
goog-terraform-provisioned: 'true'
timeouts: null
virtual_repository_config: []
vulnerability_scanning_config:
- enablement_config: null
counts:
google_artifact_registry_repository: 1
modules: 1
resources: 1
outputs: {}

View File

@@ -4,7 +4,7 @@
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -58,13 +58,11 @@ values:
project: test-ar
remote_repository_config:
- apt_repository: []
common_repository: []
common_repository:
- uri: https://example.com
description: null
disable_upstream_validation: null
docker_repository:
- custom_repository:
- uri: https://example.com
public_repository: null
docker_repository: []
maven_repository: []
npm_repository: []
python_repository: []

View File

@@ -0,0 +1,26 @@
/**
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
project_id = "my-project"
location = "europe-west1"
name = "maven-remote"
format = {
maven = {
remote = {
common_repository = "https://repo1.maven.org/maven2/"
}
}
}

View File

@@ -0,0 +1,24 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
values:
google_artifact_registry_repository.registry:
format: MAVEN
mode: REMOTE_REPOSITORY
location: europe-west1
project: my-project
repository_id: maven-remote
remote_repository_config:
- common_repository:
- uri: https://repo1.maven.org/maven2/

View File

@@ -17,3 +17,4 @@ module: modules/artifact-registry
tests:
context:
universe:
remote_maven_common: