Skip to content

Commit fab4fc0

Browse files
author
iru
authored
docs: clarify options for 409 workload
1 parent 670ad80 commit fab4fc0

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

README.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -202,43 +202,43 @@ https://cloud.google.com/iam/docs/manage-workload-identity-pools-providers#delet
202202
<br/>S: For the moment, federation workload identity pool+provider have fixed name.
203203
Therea are several options here
204204
205-
In case you want to reuse it, you can make use of the `reuse_workload_identity_pool` attribute available in some
205+
- For single-account, in case you want to reuse it, you can make use of the `reuse_workload_identity_pool` attribute available in some
206206
examples.
207-
208-
Alternatively, you can reactivate and import it, into your terraform state manually.
209-
```bash
210-
# re-activate pool and provider
211-
$ gcloud iam workload-identity-pools undelete sysdigcloud --location=global
212-
$ gcloud iam workload-identity-pools providers undelete sysdigcloud --workload-identity-pool="sysdigcloud" --location=global
213-
214-
# import to terraform state
215-
# for this you have to adapt the import resource to your specific usage
216-
# ex.: for single-project, input your project-id
217-
$ terraform import 'module.secure-for-cloud_example_single-project.module.cloud_bench[0].module.trust_relationship["<PROJECT_ID>"].google_iam_workload_identity_pool.pool' <PROJECT_ID>/sysdigcloud
218-
$ terraform import 'module.secure-for-cloud_example_single-project.module.cloud_bench[0].module.trust_relationship["<PROJECT_ID>"].google_iam_workload_identity_pool_provider.pool_provider' <PROJECT_ID>/sysdigcloud/sysdigcloud
219-
220-
# ex.: for organization example you should change its reference too, per project
221-
$ terraform import 'module.secure-for-cloud_example_organization.module.cloud_bench[0].module.trust_relationship["<PROJECT_ID>"].google_iam_workload_identity_pool.pool' <PROJECT_ID>/sysdigcloud
222-
$ terraform import 'module.secure-for-cloud_example_organization.module.cloud_bench[0].module.trust_relationship["<PROJECT_ID>"].google_iam_workload_identity_pool_provider.pool_provider' <PROJECT_ID>/sysdigcloud/sysdigcloud
223-
```
224-
225-
The import resource to use, is the one pointed out in your terraform plan/apply error messsage
226-
```
227-
-- for
228-
Error: Error creating WorkloadIdentityPool: googleapi: Error 409: Requested entity already exists
229-
with module.secure-for-cloud_example_organization.module.cloud_bench[0].module.trust_relationship["org-child-project-1"].google_iam_workload_identity_pool.pool,
230-
on .... in resource "google_iam_workload_identity_pool" "pool":
231-
resource "google_iam_workload_identity_pool" "pool" {
232-
233-
-- use
234-
' module.secure-for-cloud_example_organization.module.cloud_bench[0].module.trust_relationship["org-child-project-1"].google_iam_workload_identity_pool.pool' as your import resource
235-
236-
-- such as
237-
$ terraform import 'module.secure-for-cloud_example_organization.module.cloud_bench[0].module.trust_relationship["org-child-project-1"].google_iam_workload_identity_pool.pool' 'org-child-project-1/sysdigcloud'
238-
239-
```
240-
241-
Note: if you're using terragrunt, run `terragrunt import`
207+
- For organizational setups, you can make use of a single workload-identity for all the organization, with the [/organization-org_compliance](./examples/organization-org_compliance)
208+
- Alternatively, you can reactivate and import it, into your terraform state manually.
209+
```bash
210+
# re-activate pool and provider
211+
$ gcloud iam workload-identity-pools undelete sysdigcloud --location=global
212+
$ gcloud iam workload-identity-pools providers undelete sysdigcloud --workload-identity-pool="sysdigcloud" --location=global
213+
214+
# import to terraform state
215+
# for this you have to adapt the import resource to your specific usage
216+
# ex.: for single-project, input your project-id
217+
$ terraform import 'module.secure-for-cloud_example_single-project.module.cloud_bench[0].module.trust_relationship["<PROJECT_ID>"].google_iam_workload_identity_pool.pool' <PROJECT_ID>/sysdigcloud
218+
$ terraform import 'module.secure-for-cloud_example_single-project.module.cloud_bench[0].module.trust_relationship["<PROJECT_ID>"].google_iam_workload_identity_pool_provider.pool_provider' <PROJECT_ID>/sysdigcloud/sysdigcloud
219+
220+
# ex.: for organization example you should change its reference too, per project
221+
$ terraform import 'module.secure-for-cloud_example_organization.module.cloud_bench[0].module.trust_relationship["<PROJECT_ID>"].google_iam_workload_identity_pool.pool' <PROJECT_ID>/sysdigcloud
222+
$ terraform import 'module.secure-for-cloud_example_organization.module.cloud_bench[0].module.trust_relationship["<PROJECT_ID>"].google_iam_workload_identity_pool_provider.pool_provider' <PROJECT_ID>/sysdigcloud/sysdigcloud
223+
```
224+
225+
The import resource to use, is the one pointed out in your terraform plan/apply error messsage
226+
```
227+
-- for
228+
Error: Error creating WorkloadIdentityPool: googleapi: Error 409: Requested entity already exists
229+
with module.secure-for-cloud_example_organization.module.cloud_bench[0].module.trust_relationship["org-child-project-1"].google_iam_workload_identity_pool.pool,
230+
on .... in resource "google_iam_workload_identity_pool" "pool":
231+
resource "google_iam_workload_identity_pool" "pool" {
232+
233+
-- use
234+
' module.secure-for-cloud_example_organization.module.cloud_bench[0].module.trust_relationship["org-child-project-1"].google_iam_workload_identity_pool.pool' as your import resource
235+
236+
-- such as
237+
$ terraform import 'module.secure-for-cloud_example_organization.module.cloud_bench[0].module.trust_relationship["org-child-project-1"].google_iam_workload_identity_pool.pool' 'org-child-project-1/sysdigcloud'
238+
239+
```
240+
241+
Note: if you're using terragrunt, run `terragrunt import`
242242

243243
### Q: Getting "Error creating Topic: googleapi: Error 409: Resource already exists in the project (resource=gcr)"
244244
```text

0 commit comments

Comments
 (0)