Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the GCF resource to reflect transition from Container Registry to Artifact Registry #10058

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,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
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,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 @@ -659,7 +659,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 @@ -762,7 +762,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
Original file line number Diff line number Diff line change
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
Loading