|
| 1 | +# Copyright 2025 Google Inc. |
| 2 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | +# you may not use this file except in compliance with the License. |
| 4 | +# You may obtain a copy of the License at |
| 5 | +# |
| 6 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | +# |
| 8 | +# Unless required by applicable law or agreed to in writing, software |
| 9 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | +# See the License for the specific language governing permissions and |
| 12 | +# limitations under the License. |
| 13 | + |
| 14 | +--- |
| 15 | +name: 'WorkloadIdentityPoolNamespace' |
| 16 | +description: | |
| 17 | + Represents a namespace for a workload identity pool. Namespaces are used to segment identities |
| 18 | + within the pool. |
| 19 | +references: |
| 20 | + guides: |
| 21 | + 'Configure managed workload identity authentication for Compute Engine': 'https://cloud.google.com/iam/docs/create-managed-workload-identities' |
| 22 | + 'Configure managed workload identity authentication for GKE': 'https://cloud.google.com/iam/docs/create-managed-workload-identities-gke' |
| 23 | + api: 'https://cloud.google.com/iam/docs/reference/rest/v1/projects.locations.workloadIdentityPools.namespaces' |
| 24 | +min_version: beta |
| 25 | +base_url: 'projects/{{project}}/locations/global/workloadIdentityPools/{{workload_identity_pool_id}}/namespaces' |
| 26 | +self_link: 'projects/{{project}}/locations/global/workloadIdentityPools/{{workload_identity_pool_id}}/namespaces/{{workload_identity_pool_namespace_id}}' |
| 27 | +create_url: 'projects/{{project}}/locations/global/workloadIdentityPools/{{workload_identity_pool_id}}/namespaces?workloadIdentityPoolNamespaceId={{workload_identity_pool_namespace_id}}' |
| 28 | +create_verb: 'POST' |
| 29 | +update_url: 'projects/{{project}}/locations/global/workloadIdentityPools/{{workload_identity_pool_id}}/namespaces/{{workload_identity_pool_namespace_id}}' |
| 30 | +update_verb: 'PATCH' |
| 31 | +update_mask: true |
| 32 | +delete_url: 'projects/{{project}}/locations/global/workloadIdentityPools/{{workload_identity_pool_id}}/namespaces/{{workload_identity_pool_namespace_id}}' |
| 33 | +delete_verb: 'DELETE' |
| 34 | +import_format: |
| 35 | + - 'projects/{{project}}/locations/global/workloadIdentityPools/{{workload_identity_pool_id}}/namespaces/{{workload_identity_pool_namespace_id}}' |
| 36 | +timeouts: |
| 37 | + insert_minutes: 20 |
| 38 | + update_minutes: 20 |
| 39 | + delete_minutes: 20 |
| 40 | +autogen_async: true |
| 41 | +async: |
| 42 | + actions: ['create', 'delete', 'update'] |
| 43 | + type: 'OpAsync' |
| 44 | + operation: |
| 45 | + base_url: '{{op_id}}' |
| 46 | + result: |
| 47 | + resource_inside_response: false |
| 48 | +custom_code: |
| 49 | + constants: 'templates/terraform/constants/iam_workload_identity_pool_namespace.go.tmpl' |
| 50 | + decoder: 'templates/terraform/decoders/treat_deleted_state_as_gone.go.tmpl' |
| 51 | + test_check_destroy: 'templates/terraform/custom_check_destroy/iam_workload_identity_pool_namespace.go.tmpl' |
| 52 | +examples: |
| 53 | + - name: 'iam_workload_identity_pool_namespace_basic' |
| 54 | + primary_resource_id: 'example' |
| 55 | + vars: |
| 56 | + workload_identity_pool_id: 'example-pool' |
| 57 | + workload_identity_pool_namespace_id: 'example-nmspc' |
| 58 | + - name: 'iam_workload_identity_pool_namespace_full' |
| 59 | + primary_resource_id: 'example' |
| 60 | + vars: |
| 61 | + workload_identity_pool_id: 'example-pool' |
| 62 | + workload_identity_pool_namespace_id: 'example-nmspc' |
| 63 | +parameters: |
| 64 | + - name: 'workload_identity_pool_id' |
| 65 | + type: String |
| 66 | + required: true |
| 67 | + immutable: true |
| 68 | + url_param_only: true |
| 69 | + description: | |
| 70 | + The ID to use for the pool, which becomes the final component of the resource name. This |
| 71 | + value should be 4-32 characters, and may contain the characters [a-z0-9-]. The prefix |
| 72 | + `gcp-` is reserved for use by Google, and may not be specified. |
| 73 | + - name: 'workload_identity_pool_namespace_id' |
| 74 | + type: String |
| 75 | + required: true |
| 76 | + immutable: true |
| 77 | + url_param_only: true |
| 78 | + description: | |
| 79 | + The ID to use for the namespace. This value must: |
| 80 | + * contain at most 63 characters |
| 81 | + * contain only lowercase alphanumeric characters or `-` |
| 82 | + * start with an alphanumeric character |
| 83 | + * end with an alphanumeric character |
| 84 | +
|
| 85 | +
|
| 86 | + The prefix `gcp-` will be reserved for future uses. |
| 87 | + validation: |
| 88 | + function: 'ValidateWorkloadIdentityPoolNamespaceId' |
| 89 | +properties: |
| 90 | + - name: 'name' |
| 91 | + type: String |
| 92 | + description: | |
| 93 | + The resource name of the namespace as |
| 94 | + `projects/{project_number}/locations/global/workloadIdentityPools/{workload_identity_pool_id}/namespaces/{workload_identity_pool_namespace_id}`. |
| 95 | + output: true |
| 96 | + - name: 'description' |
| 97 | + type: String |
| 98 | + description: | |
| 99 | + A description of the namespace. Cannot exceed 256 characters. |
| 100 | + validation: |
| 101 | + function: 'ValidateWorkloadIdentityPoolNamespaceDescription' |
| 102 | + - name: 'state' |
| 103 | + type: Enum |
| 104 | + description: | |
| 105 | + The current state of the namespace. |
| 106 | + * `STATE_UNSPECIFIED`: State unspecified. |
| 107 | + * `ACTIVE`: The namespace is active. |
| 108 | + * `DELETED`: The namespace is soft-deleted. Soft-deleted namespaces are permanently deleted |
| 109 | + after approximately 30 days. You can restore a soft-deleted namespace using |
| 110 | + UndeleteWorkloadIdentityPoolNamespace. You cannot reuse the ID of a soft-deleted namespace |
| 111 | + until it is permanently deleted. |
| 112 | + output: true |
| 113 | + enum_values: |
| 114 | + - 'STATE_UNSPECIFIED' |
| 115 | + - 'ACTIVE' |
| 116 | + - 'DELETED' |
| 117 | + - name: 'disabled' |
| 118 | + type: Boolean |
| 119 | + description: | |
| 120 | + Whether the namespace is disabled. If disabled, credentials may no longer be issued for |
| 121 | + identities within this namespace, however existing credentials will still be accepted until |
| 122 | + they expire. |
| 123 | + - name: 'ownerService' |
| 124 | + type: NestedObject |
| 125 | + description: | |
| 126 | + Defines the owner that is allowed to mutate this resource. If present, this resource can only |
| 127 | + be mutated by the owner. |
| 128 | + output: true |
| 129 | + properties: |
| 130 | + - name: 'principalSubject' |
| 131 | + type: String |
| 132 | + description: | |
| 133 | + The service agent principal subject, e.g. |
| 134 | + `serviceAccount:[email protected]`. |
| 135 | + required: true |
0 commit comments