|
8 | 8 | // |
9 | 9 | // This code is generated by Magic Modules using the following: |
10 | 10 | // |
11 | | -// Source file: https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services/privilegedaccessmanager/resource_privileged_access_manager_entitlement_test.go |
| 11 | +// Source file: https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services/privilegedaccessmanager/resource_privileged_access_manager_entitlement_test.go.tmpl |
12 | 12 | // |
13 | 13 | // DO NOT EDIT this file directly. Any changes made to this file will be |
14 | 14 | // overwritten during the next generation cycle. |
@@ -60,6 +60,77 @@ func TestAccPrivilegedAccessManagerEntitlement_privilegedAccessManagerEntitlemen |
60 | 60 | }) |
61 | 61 | } |
62 | 62 |
|
| 63 | +func TestAccPrivilegedAccessManagerEntitlement_roleBindingId_beta(t *testing.T) { |
| 64 | + t.Parallel() |
| 65 | + |
| 66 | + context := map[string]interface{}{ |
| 67 | + "random_suffix": acctest.RandString(t, 10), |
| 68 | + "project_name": envvar.GetTestProjectFromEnv(), |
| 69 | + } |
| 70 | + |
| 71 | + acctest.VcrTest(t, resource.TestCase{ |
| 72 | + PreCheck: func() { acctest.AccTestPreCheck(t) }, |
| 73 | + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), |
| 74 | + CheckDestroy: testAccCheckPrivilegedAccessManagerEntitlementDestroyProducer(t), |
| 75 | + Steps: []resource.TestStep{ |
| 76 | + { |
| 77 | + Config: testAccPrivilegedAccessManagerEntitlement_privilegedAccessManagerEntitlementBasicExample_basic_beta(context), |
| 78 | + Check: resource.ComposeTestCheckFunc( |
| 79 | + // Checks the output-only role binding id field |
| 80 | + resource.TestCheckResourceAttrSet( |
| 81 | + "google_privileged_access_manager_entitlement.tfentitlement", |
| 82 | + "privileged_access.0.gcp_iam_access.0.role_bindings.0.id", |
| 83 | + ), |
| 84 | + ), |
| 85 | + }, |
| 86 | + }, |
| 87 | + }) |
| 88 | +} |
| 89 | + |
| 90 | +func testAccPrivilegedAccessManagerEntitlement_privilegedAccessManagerEntitlementBasicExample_basic_beta(context map[string]interface{}) string { |
| 91 | + return acctest.Nprintf(` |
| 92 | +resource "google_privileged_access_manager_entitlement" "tfentitlement" { |
| 93 | + provider = google-beta |
| 94 | + entitlement_id = "tf-test-example-entitlement%{random_suffix}" |
| 95 | + location = "global" |
| 96 | + max_request_duration = "43200s" |
| 97 | + parent = "projects/%{project_name}" |
| 98 | + requester_justification_config { |
| 99 | + unstructured{} |
| 100 | + } |
| 101 | + eligible_users { |
| 102 | + principals = ["group:[email protected]"] |
| 103 | + } |
| 104 | + privileged_access{ |
| 105 | + gcp_iam_access{ |
| 106 | + role_bindings{ |
| 107 | + role = "roles/storage.admin" |
| 108 | + condition_expression = "request.time < timestamp(\"2024-04-23T18:30:00.000Z\")" |
| 109 | + } |
| 110 | + resource = "//cloudresourcemanager.googleapis.com/projects/%{project_name}" |
| 111 | + resource_type = "cloudresourcemanager.googleapis.com/Project" |
| 112 | + } |
| 113 | + } |
| 114 | + additional_notification_targets { |
| 115 | + admin_email_recipients = ["[email protected]"] |
| 116 | + requester_email_recipients = ["[email protected]"] |
| 117 | + } |
| 118 | + approval_workflow { |
| 119 | + manual_approvals { |
| 120 | + require_approver_justification = true |
| 121 | + steps { |
| 122 | + approvals_needed = 1 |
| 123 | + approver_email_recipients = ["[email protected]"] |
| 124 | + approvers { |
| 125 | + principals = ["group:[email protected]"] |
| 126 | + } |
| 127 | + } |
| 128 | + } |
| 129 | + } |
| 130 | +} |
| 131 | +`, context) |
| 132 | +} |
| 133 | + |
63 | 134 | func testAccPrivilegedAccessManagerEntitlement_privilegedAccessManagerEntitlementBasicExample_basic(context map[string]interface{}) string { |
64 | 135 | return acctest.Nprintf(` |
65 | 136 | resource "google_privileged_access_manager_entitlement" "tfentitlement" { |
|
0 commit comments