Skip to content

Commit 44b0b94

Browse files
Add new resource WorkforcePool (#6719) (#12863)
* added workforce pool * fixed bugs * renamed the product and fixed an error message * updated version setting * changed to provider-beta * updated id validator * updated parent field * fixed bugs Signed-off-by: Modular Magician <[email protected]> Signed-off-by: Modular Magician <[email protected]>
1 parent 7809b2f commit 44b0b94

4 files changed

+157
-0
lines changed

.changelog/6719.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
`google_iam_workforce_pool`
3+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package google
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package google
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
---
2+
# ----------------------------------------------------------------------------
3+
#
4+
# *** AUTO GENERATED CODE *** Type: MMv1 ***
5+
#
6+
# ----------------------------------------------------------------------------
7+
#
8+
# This file is automatically generated by Magic Modules and manual
9+
# changes will be clobbered when the file is regenerated.
10+
#
11+
# Please read more about how to change this file in
12+
# .github/CONTRIBUTING.md.
13+
#
14+
# ----------------------------------------------------------------------------
15+
subcategory: "Cloud IAM"
16+
page_title: "Google: google_iam_workforce_pool"
17+
description: |-
18+
Represents a collection of external workforces.
19+
---
20+
21+
# google\_iam\_workforce\_pool
22+
23+
Represents a collection of external workforces. Provides namespaces for
24+
federated users that can be referenced in IAM policies.
25+
Note: Ask your Google Cloud account team to request access to workforce identity
26+
federation for your billing/quota project. The account team notifies you when the project is
27+
granted access.
28+
29+
~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
30+
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.
31+
32+
To get more information about WorkforcePool, see:
33+
34+
* [API documentation](https://cloud.google.com/iam/docs/reference/rest/v1/locations.workforcePools)
35+
* How-to Guides
36+
* [Manage pools](https://cloud.google.com/iam/docs/manage-workforce-identity-pools-providers#manage_pools)
37+
38+
## Example Usage - Iam Workforce Pool Basic
39+
40+
41+
```hcl
42+
resource "google_iam_workforce_pool" "example" {
43+
provider = google-beta
44+
45+
workforce_pool_id = "example-pool"
46+
parent = "organizations/123456789"
47+
location = "global"
48+
}
49+
```
50+
## Example Usage - Iam Workforce Pool Full
51+
52+
53+
```hcl
54+
resource "google_iam_workforce_pool" "example" {
55+
provider = google-beta
56+
57+
workforce_pool_id = "example-pool"
58+
parent = "organizations/123456789"
59+
location = "global"
60+
display_name = "Display name"
61+
description = "A sample workforce pool."
62+
disabled = false
63+
session_duration = "7200s"
64+
}
65+
```
66+
67+
## Argument Reference
68+
69+
The following arguments are supported:
70+
71+
72+
* `location` -
73+
(Required)
74+
The location for the resource.
75+
76+
* `workforce_pool_id` -
77+
(Required)
78+
The name of the pool. The ID must be a globally unique string of 6 to 63 lowercase letters,
79+
digits, or hyphens. It must start with a letter, and cannot have a trailing hyphen.
80+
The prefix `gcp-` is reserved for use by Google, and may not be specified.
81+
82+
* `parent` -
83+
(Required)
84+
Immutable. The resource name of the parent. Format: `organizations/{org-id}`.
85+
86+
87+
- - -
88+
89+
90+
* `display_name` -
91+
(Optional)
92+
A user-specified display name of the pool in Google Cloud Console. Cannot exceed 32 characters.
93+
94+
* `description` -
95+
(Optional)
96+
A user-specified description of the pool. Cannot exceed 256 characters.
97+
98+
* `disabled` -
99+
(Optional)
100+
Whether the pool is disabled. You cannot use a disabled pool to exchange tokens,
101+
or use existing tokens to access resources. If the pool is re-enabled, existing tokens grant access again.
102+
103+
* `session_duration` -
104+
(Optional)
105+
Duration that the Google Cloud access tokens, console sign-in sessions,
106+
and `gcloud` sign-in sessions from this pool are valid.
107+
Must be greater than 15 minutes (900s) and less than 12 hours (43200s).
108+
If `sessionDuration` is not configured, minted credentials have a default duration of one hour (3600s).
109+
A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: "`3.5s`".
110+
111+
112+
## Attributes Reference
113+
114+
In addition to the arguments listed above, the following computed attributes are exported:
115+
116+
* `id` - an identifier for the resource with format `locations/{{location}}/workforcePools/{{workforce_pool_id}}`
117+
118+
* `name` -
119+
Output only. The resource name of the pool.
120+
Format: `locations/{location}/workforcePools/{workforcePoolId}`
121+
122+
* `state` -
123+
Output only. The state of the pool.
124+
* STATE_UNSPECIFIED: State unspecified.
125+
* ACTIVE: The pool is active, and may be used in Google Cloud policies.
126+
* DELETED: The pool is soft-deleted. Soft-deleted pools are permanently deleted
127+
after approximately 30 days. You can restore a soft-deleted pool using
128+
[UndeleteWorkforcePool][WorkforcePools.UndeleteWorkforcePool].
129+
You cannot reuse the ID of a soft-deleted pool until it is permanently deleted.
130+
While a pool is deleted, you cannot use it to exchange tokens, or use
131+
existing tokens to access resources. If the pool is undeleted, existing
132+
tokens grant access again.
133+
134+
135+
## Timeouts
136+
137+
This resource provides the following
138+
[Timeouts](/docs/configuration/resources.html#timeouts) configuration options:
139+
140+
- `create` - Default is 20 minutes.
141+
- `update` - Default is 20 minutes.
142+
- `delete` - Default is 20 minutes.
143+
144+
## Import
145+
146+
147+
WorkforcePool can be imported using any of these accepted formats:
148+
149+
```
150+
$ terraform import google_iam_workforce_pool.default locations/{{location}}/workforcePools/{{workforce_pool_id}}
151+
$ terraform import google_iam_workforce_pool.default {{location}}/{{workforce_pool_id}}
152+
```

0 commit comments

Comments
 (0)