Skip to content

Commit

Permalink
Update the GCF resource to reflect transition from Container Registry…
Browse files Browse the repository at this point in the history
… to Artifact Registry (#10058) (#17493)

[upstream:d9a016547e57b25a192bfb628f30d78b5a464ad8]

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician committed Mar 5, 2024
1 parent 063c48d commit 03376ee
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .changelog/10058.txt
@@ -0,0 +1,3 @@
```release-note:note
cloudfunctions: Updated docs for Cloud Function's `docker_registry` field to reflect the change of default from Container Registry to Artifact Registry.
```
Expand Up @@ -203,7 +203,7 @@ func ResourceCloudFunctionsFunction() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: `Docker Registry to use for storing the function's Docker images. Allowed values are CONTAINER_REGISTRY (default) and ARTIFACT_REGISTRY.`,
Description: `Docker Registry to use for storing the function's Docker images. Allowed values are ARTIFACT_REGISTRY (default) and CONTAINER_REGISTRY.`,
},

"docker_repository": {
Expand Down
Expand Up @@ -53,7 +53,7 @@ func TestAccCloudFunctionsFunction_basic(t *testing.T) {
resource.TestCheckResourceAttr(funcResourceName,
"description", "test function"),
resource.TestCheckResourceAttr(funcResourceName,
"docker_registry", "CONTAINER_REGISTRY"),
"docker_registry", "ARTIFACT_REGISTRY"),
resource.TestCheckResourceAttr(funcResourceName,
"available_memory_mb", "128"),
resource.TestCheckResourceAttr(funcResourceName,
Expand Down Expand Up @@ -599,7 +599,7 @@ resource "google_cloudfunctions_function" "function" {
name = "%s"
runtime = "nodejs10"
description = "test function"
docker_registry = "CONTAINER_REGISTRY"
docker_registry = "ARTIFACT_REGISTRY"
available_memory_mb = 128
source_archive_bucket = google_storage_bucket.bucket.name
source_archive_object = google_storage_bucket_object.archive.name
Expand Down Expand Up @@ -702,7 +702,7 @@ resource "google_cloudfunctions_function" "function" {
name = "%[3]s"
runtime = "nodejs10"
description = "test function"
docker_registry = "CONTAINER_REGISTRY"
docker_registry = "ARTIFACT_REGISTRY"
available_memory_mb = 128
source_archive_bucket = google_storage_bucket.bucket.name
source_archive_object = google_storage_bucket_object.archive.name
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/cloudfunctions_function.html.markdown
Expand Up @@ -162,9 +162,9 @@ Please refer to the field 'effective_labels' for all of the labels present on th
* `source_repository` - (Optional) Represents parameters related to source repository where a function is hosted.
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}`.*

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

* `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.
* `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.

* `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}`.
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
Expand Down

0 comments on commit 03376ee

Please sign in to comment.