-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add resource dbtcloud_partial_license_map
- Loading branch information
Showing
10 changed files
with
715 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
page_title: "dbtcloud_partial_license_map Resource - dbtcloud" | ||
subcategory: "" | ||
description: |- | ||
Set up partial license maps with only a subset of SSO groups for a given license type. | ||
This resource is different from dbtcloud_license_map as it allows having different resources setting up different groups for the same license type. | ||
If a company uses only one Terraform project/workspace to manage all their dbt Cloud Account config, it is recommended to use dbt_cloud_license_map instead of dbt_cloud_group_partial_license_map. | ||
~> This is a new resource like other "partial" ones and any feedback is welcome in the GitHub repository. | ||
--- | ||
|
||
# dbtcloud_partial_license_map (Resource) | ||
|
||
|
||
Set up partial license maps with only a subset of SSO groups for a given license type. | ||
|
||
This resource is different from `dbtcloud_license_map` as it allows having different resources setting up different groups for the same license type. | ||
|
||
If a company uses only one Terraform project/workspace to manage all their dbt Cloud Account config, it is recommended to use `dbt_cloud_license_map` instead of `dbt_cloud_group_partial_license_map`. | ||
|
||
~> This is a new resource like other "partial" ones and any feedback is welcome in the GitHub repository. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
# Developer license group mapping | ||
resource "dbtcloud_partial_license_map" "dev_license_map" { | ||
license_type = "developer" | ||
sso_license_mapping_groups = ["DEV-SSO-GROUP"] | ||
} | ||
# Read-only license mapping | ||
resource "dbtcloud_partial_license_map" "read_only_license_map" { | ||
license_type = "read_only" | ||
sso_license_mapping_groups = ["READ-ONLY-SSO-GROUP"] | ||
} | ||
# IT license mapping | ||
resource "dbtcloud_partial_license_map" "it_license_map" { | ||
license_type = "it" | ||
sso_license_mapping_groups = ["IT-SSO-GROUP"] | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `license_type` (String) The license type to update | ||
- `sso_license_mapping_groups` (Set of String) List of SSO groups to map to the license type. | ||
|
||
### Read-Only | ||
|
||
- `id` (Number) The ID of the notification |
17 changes: 17 additions & 0 deletions
17
examples/resources/dbtcloud_partial_license_map/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Developer license group mapping | ||
resource "dbtcloud_partial_license_map" "dev_license_map" { | ||
license_type = "developer" | ||
sso_license_mapping_groups = ["DEV-SSO-GROUP"] | ||
} | ||
|
||
# Read-only license mapping | ||
resource "dbtcloud_partial_license_map" "read_only_license_map" { | ||
license_type = "read_only" | ||
sso_license_mapping_groups = ["READ-ONLY-SSO-GROUP"] | ||
} | ||
|
||
# IT license mapping | ||
resource "dbtcloud_partial_license_map" "it_license_map" { | ||
license_type = "it" | ||
sso_license_mapping_groups = ["IT-SSO-GROUP"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package partial_license_map | ||
|
||
import ( | ||
"github.com/dbt-labs/terraform-provider-dbtcloud/pkg/dbt_cloud" | ||
"github.com/hashicorp/terraform-plugin-framework/types" | ||
) | ||
|
||
// TODO: Move the model to the non partial when moved to the Framework | ||
type LicenseMapResourceModel struct { | ||
ID types.Int64 `tfsdk:"id"` | ||
LicenseType types.String `tfsdk:"license_type"` | ||
SSOLicenseMappingGroups types.Set `tfsdk:"sso_license_mapping_groups"` | ||
} | ||
|
||
func matchPartial( | ||
licenseMapModel LicenseMapResourceModel, | ||
licenseTypeResponse dbt_cloud.LicenseMap, | ||
) bool { | ||
return licenseMapModel.LicenseType == types.StringValue(licenseTypeResponse.LicenseType) | ||
} |
Oops, something went wrong.