|
| 1 | +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. |
| 2 | +// Licensed under the Mozilla Public License v2.0 |
| 3 | + |
| 4 | +variable "auth_token_auth_token_count" { |
| 5 | + default = 10 |
| 6 | +} |
| 7 | + |
| 8 | +variable "auth_token_authorization" { |
| 9 | + default = "authorization" |
| 10 | +} |
| 11 | + |
| 12 | +variable "auth_token_description" { |
| 13 | + default = "description" |
| 14 | +} |
| 15 | + |
| 16 | +variable "auth_token_expires_on" { |
| 17 | + default = "2030-01-01T00:00:00Z" |
| 18 | +} |
| 19 | + |
| 20 | +variable "auth_token_start_index" { |
| 21 | + default = 1 |
| 22 | +} |
| 23 | + |
| 24 | +variable "auth_token_status" { |
| 25 | + default = "ACTIVE" |
| 26 | +} |
| 27 | + |
| 28 | +variable "auth_token_tags_key" { |
| 29 | + default = "key" |
| 30 | +} |
| 31 | + |
| 32 | +variable "auth_token_tags_value" { |
| 33 | + default = "value" |
| 34 | +} |
| 35 | + |
| 36 | +variable "auth_token_urnietfparamsscimschemasoracleidcsextensionself_change_user_allow_self_change" { |
| 37 | + default = false |
| 38 | +} |
| 39 | + |
| 40 | + |
| 41 | +resource "oci_identity_domains_auth_token" "test_auth_token" { |
| 42 | + #Required |
| 43 | + idcs_endpoint = data.oci_identity_domain.test_domain.url |
| 44 | + schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:authToken"] |
| 45 | + |
| 46 | + #Optional |
| 47 | + attribute_sets = [] |
| 48 | + attributes = "" |
| 49 | + authorization = var.auth_token_authorization |
| 50 | + description = var.auth_token_description |
| 51 | + expires_on = var.auth_token_expires_on |
| 52 | + #use the latest if not provided |
| 53 | + # resource_type_schema_version = var.auth_token_resource_type_schema_version |
| 54 | + status = var.auth_token_status |
| 55 | + tags { |
| 56 | + #Required |
| 57 | + key = var.auth_token_tags_key |
| 58 | + value = var.auth_token_tags_value |
| 59 | + } |
| 60 | + urnietfparamsscimschemasoracleidcsextensionself_change_user { |
| 61 | + |
| 62 | + #Optional |
| 63 | + allow_self_change = var.auth_token_urnietfparamsscimschemasoracleidcsextensionself_change_user_allow_self_change |
| 64 | + } |
| 65 | + user { |
| 66 | + |
| 67 | + #Optional |
| 68 | + #use the ocid of the same user set in value |
| 69 | + ocid = oci_identity_domains_user.test_user.ocid |
| 70 | + #must be a user that exists |
| 71 | + value = oci_identity_domains_user.test_user.id |
| 72 | + } |
| 73 | +} |
| 74 | + |
| 75 | +data "oci_identity_domains_auth_tokens" "test_auth_tokens" { |
| 76 | + #Required |
| 77 | + idcs_endpoint = data.oci_identity_domain.test_domain.url |
| 78 | + |
| 79 | + #Optional |
| 80 | + auth_token_count = var.auth_token_auth_token_count |
| 81 | + auth_token_filter = "user.value eq \"${oci_identity_domains_user.test_user.id}\"" |
| 82 | + attribute_sets = [] |
| 83 | + attributes = "" |
| 84 | + authorization = var.auth_token_authorization |
| 85 | + #use the latest if not provided |
| 86 | + # resource_type_schema_version = var.auth_token_resource_type_schema_version |
| 87 | + start_index = var.auth_token_start_index |
| 88 | +} |
| 89 | + |
0 commit comments