You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* CMEK support for Cloud Functions (docker_repository and kms_key_name fields)
* separate tests for CMEK and AR; added role binding for the CMEK test
* Remaining IAM configs
* Formatting
* Granting additional permissions to the service accounts
* Another attempts at fixing the IAM (potentially a race) issue
* Accounting for feedback: create kms key via bootstraping util
* documentation update
* Remove refernces to beta in the docs (feedback)
Co-authored-by: Rustem Bekmukhametov <[email protected]>
Signed-off-by: Modular Magician <[email protected]>
Co-authored-by: Rustem Bekmukhametov <[email protected]>
Description: `User managed repository created in Artifact Registry optionally with a customer managed encryption key. If specified, deployments will use Artifact Registry for storing images built with Cloud Build.`,
153
+
},
154
+
155
+
"kms_key_name": {
156
+
Type: schema.TypeString,
157
+
Optional: true,
158
+
Description: `Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources.`,
159
+
},
160
+
149
161
"description": {
150
162
Type: schema.TypeString,
151
163
Optional: true,
@@ -498,6 +510,14 @@ func resourceCloudFunctionsCreate(d *schema.ResourceData, meta interface{}) erro
498
510
function.VpcConnectorEgressSettings=v.(string)
499
511
}
500
512
513
+
ifv, ok:=d.GetOk("docker_repository"); ok {
514
+
function.DockerRepository=v.(string)
515
+
}
516
+
517
+
ifv, ok:=d.GetOk("kms_key_name"); ok {
518
+
function.KmsKeyName=v.(string)
519
+
}
520
+
501
521
ifv, ok:=d.GetOk("max_instances"); ok {
502
522
function.MaxInstances=int64(v.(int))
503
523
}
@@ -629,6 +649,12 @@ func resourceCloudFunctionsRead(d *schema.ResourceData, meta interface{}) error
*`source_archive_object` - (Optional) The source archive object (file) in archive bucket.
147
147
148
148
*`source_repository` - (Optional) Represents parameters related to source repository where a function is hosted.
149
-
Cannot be set alongside `source_archive_bucket` or `source_archive_object`. Structure is [documented below](#nested_source_repository).
149
+
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}`.*
150
+
151
+
*`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.
152
+
153
+
*`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}`.
154
+
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
150
155
151
156
*`max_instances` - (Optional) The limit on the maximum number of function instances that may coexist at a given time.
0 commit comments