Skip to content

Commit cb9ac98

Browse files
Update the GCF resource to reflect transition from Container Registry to Artifact Registry (#10058) (#7048)
[upstream:d9a016547e57b25a192bfb628f30d78b5a464ad8] Signed-off-by: Modular Magician <[email protected]>
1 parent 7641ebc commit cb9ac98

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

.changelog/10058.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:note
2+
cloudfunctions: Updated docs for Cloud Function's `docker_registry` field to reflect the change of default from Container Registry to Artifact Registry.
3+
```

google-beta/services/cloudfunctions/resource_cloudfunctions_function.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func ResourceCloudFunctionsFunction() *schema.Resource {
203203
Type: schema.TypeString,
204204
Optional: true,
205205
Computed: true,
206-
Description: `Docker Registry to use for storing the function's Docker images. Allowed values are CONTAINER_REGISTRY (default) and ARTIFACT_REGISTRY.`,
206+
Description: `Docker Registry to use for storing the function's Docker images. Allowed values are ARTIFACT_REGISTRY (default) and CONTAINER_REGISTRY.`,
207207
},
208208

209209
"docker_repository": {

google-beta/services/cloudfunctions/resource_cloudfunctions_function_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func TestAccCloudFunctionsFunction_basic(t *testing.T) {
5353
resource.TestCheckResourceAttr(funcResourceName,
5454
"description", "test function"),
5555
resource.TestCheckResourceAttr(funcResourceName,
56-
"docker_registry", "CONTAINER_REGISTRY"),
56+
"docker_registry", "ARTIFACT_REGISTRY"),
5757
resource.TestCheckResourceAttr(funcResourceName,
5858
"available_memory_mb", "128"),
5959
resource.TestCheckResourceAttr(funcResourceName,
@@ -656,7 +656,7 @@ resource "google_cloudfunctions_function" "function" {
656656
name = "%s"
657657
runtime = "nodejs10"
658658
description = "test function"
659-
docker_registry = "CONTAINER_REGISTRY"
659+
docker_registry = "ARTIFACT_REGISTRY"
660660
available_memory_mb = 128
661661
source_archive_bucket = google_storage_bucket.bucket.name
662662
source_archive_object = google_storage_bucket_object.archive.name
@@ -759,7 +759,7 @@ resource "google_cloudfunctions_function" "function" {
759759
name = "%[3]s"
760760
runtime = "nodejs10"
761761
description = "test function"
762-
docker_registry = "CONTAINER_REGISTRY"
762+
docker_registry = "ARTIFACT_REGISTRY"
763763
available_memory_mb = 128
764764
source_archive_bucket = google_storage_bucket.bucket.name
765765
source_archive_object = google_storage_bucket_object.archive.name

website/docs/r/cloudfunctions_function.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ Please refer to the field 'effective_labels' for all of the labels present on th
162162
* `source_repository` - (Optional) Represents parameters related to source repository where a function is hosted.
163163
Cannot be set alongside `source_archive_bucket` or `source_archive_object`. Structure is [documented below](#nested_source_repository). It must match the pattern `projects/{project}/locations/{location}/repositories/{repository}`.*
164164

165-
* `docker_registry` - (Optional) Docker Registry to use for storing the function's Docker images. Allowed values are CONTAINER_REGISTRY (default) and ARTIFACT_REGISTRY.
165+
* `docker_registry` - (Optional) Docker Registry to use for storing the function's Docker images. Allowed values are ARTIFACT_REGISTRY (default) and CONTAINER_REGISTRY.
166166

167-
* `docker_repository` - (Optional) User managed repository created in Artifact Registry optionally with a customer managed encryption key. If specified, deployments will use Artifact Registry. This is the repository to which the function docker image will be pushed after it is built by Cloud Build. If unspecified, Container Registry will be used by default, unless specified otherwise by other means.
167+
* `docker_repository` - (Optional) User-managed repository created in Artifact Registry to which the function's Docker image will be pushed after it is built by Cloud Build. May optionally be encrypted with a customer-managed encryption key (CMEK). If unspecified and `docker_registry` is not explicitly set to `CONTAINER_REGISTRY`, GCF will create and use a default Artifact Registry repository named 'gcf-artifacts' in the region.
168168

169169
* `kms_key_name` - (Optional) Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources. It must match the pattern `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
170170
If specified, you must also provide an artifact registry repository using the `docker_repository` field that was created with the same KMS crypto key. Before deploying, please complete all pre-requisites described in https://cloud.google.com/functions/docs/securing/cmek#granting_service_accounts_access_to_the_key

0 commit comments

Comments
 (0)