diff --git a/mmv1/third_party/tgc/tests/data/kms_crypto_key.json b/mmv1/third_party/tgc/tests/data/kms_crypto_key.json new file mode 100644 index 000000000000..98bc0f8328c1 --- /dev/null +++ b/mmv1/third_party/tgc/tests/data/kms_crypto_key.json @@ -0,0 +1,51 @@ +[ +{ +"ancestors": [ +"projects/{{.Project.Number}}", +"organizations/{{.OrgID}}" +], +"assetType": "cloudkms.googleapis.com/CryptoKey", +"name": "//cloudkms.googleapis.com/projects/{{.Provider.project}}/locations/us-central1/keyRings/gg-asset-43537-eb9a/cryptoKeys/gg-asset-43537-eb9a", +"resource": { +"data": { +"createTime": "2025-10-31T20:46:17.80039332Z", +"destroyScheduledDuration": "2592000s", +"labels": { +"example-label": "example-value", +"goog-terraform-provisioned": "true" +}, +"name": "projects/{{.Provider.project}}/locations/us-central1/keyRings/gg-asset-43537-eb9a/cryptoKeys/gg-asset-43537-eb9a", +"purpose": "ASYMMETRIC_SIGN", +"versionTemplate": { +"algorithm": "EC_SIGN_P256_SHA256", +"protectionLevel": "HSM" +} +}, +"discoveryDocumentUri": "https://cloudkms.googleapis.com/$discovery/rest", +"discoveryName": "CryptoKey", +"location": "us-central1", +"parent": "//cloudkms.googleapis.com/projects/{{.Provider.project}}/locations/us-central1/keyRings/gg-asset-43537-eb9a", +"version": "v1" +}, +"updateTime": "2025-10-31T20:46:17.800393320Z" +}, +{ +"ancestors": [ +"projects/{{.Project.Number}}", +"organizations/{{.OrgID}}" +], +"assetType": "cloudkms.googleapis.com/KeyRing", +"name": "//cloudkms.googleapis.com/projects/{{.Provider.project}}/locations/us-central1/keyRings/gg-asset-43537-eb9a", +"resource": { +"data": { +"createTime": "2025-10-31T20:45:59.242702337Z", +"name": "projects/{{.Provider.project}}/locations/us-central1/keyRings/gg-asset-43537-eb9a" +}, +"discoveryDocumentUri": "https://cloudkms.googleapis.com/$discovery/rest", +"discoveryName": "KeyRing", +"location": "us-central1", +"version": "v1" +}, +"updateTime": "2025-10-31T20:45:59.242702337Z" +} +] diff --git a/mmv1/third_party/tgc/tests/data/kms_crypto_key.tf b/mmv1/third_party/tgc/tests/data/kms_crypto_key.tf new file mode 100644 index 000000000000..f0935561ff4f --- /dev/null +++ b/mmv1/third_party/tgc/tests/data/kms_crypto_key.tf @@ -0,0 +1,47 @@ +# Copyright 2024 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 +# 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. + +variable "project_id" { +description = "The project ID to host the crypto key." +type = string +default = "foobar" +} + +variable "organization_id" { +description = "The organization ID." +type = string +default = "12345" +} + +provider "google" { +project = "{{.Provider.project}}" +} + +resource "google_kms_key_ring" "gg-asset-43537-eb9a" { +name = "gg-asset-43537-eb9a" +location = "us-central1" +} + +resource "google_kms_crypto_key" "gg-asset-43537-eb9a" { +name = "gg-asset-43537-eb9a" +key_ring = google_kms_key_ring.gg-asset-43537-eb9a.id +purpose = "ASYMMETRIC_SIGN" +version_template { +algorithm = "EC_SIGN_P256_SHA256" +protection_level = "HSM" +} +labels = { +"example-label" = "example-value" +} +skip_initial_version_creation = true +}