### Example Usage of tableau_datasources Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/datasources.md This example demonstrates how to use the tableau_datasources data source to retrieve a list of available datasources. It requires no specific input parameters. ```terraform data "tableau_datasources" "example" { } ``` -------------------------------- ### Example Usage of tableau_virtual_connection Data Source Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/virtual_connection.md Demonstrates how to use the `tableau_virtual_connection` data source to retrieve a specific virtual connection by its ID. It first fetches all virtual connections using the `tableau_virtual_connections` data source and then selects the first one to get its ID for retrieving detailed information. ```terraform data "tableau_virtual_connections" "vcs" {} data "tableau_virtual_connection" "vc0" { id = data.tableau_virtual_connections.vcs.virtual_connections[0].id } ``` -------------------------------- ### Retrieve Tableau Datasource Details Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/datasource.md This example demonstrates how to use the `tableau_datasource` data source to fetch details of a specific Tableau datasource. It takes the datasource 'name' as an argument and exposes various read-only attributes about the datasource. ```terraform data "tableau_datasource" "example" { name = "moo" } ``` -------------------------------- ### Create Tableau Group, Users, and Project with Permissions (Terraform) Source: https://context7.com/gthesheep/terraform-provider-tableau/llms.txt This Terraform configuration defines a new Tableau group named 'Product Analytics Team', adds two users ('member1' and 'member2') with specific roles and SAML authentication, associates these users with the group, creates a 'Product Analytics' project, and grants 'Write' permissions to the group for that project. An output variable confirms the setup completion with group and project IDs. ```terraform resource "tableau_group" "new_team" { name = "Product Analytics Team" minimum_site_role = "Explorer" } resource "tableau_user" "team_member_1" { name = "member1@company.com" email = "member1@company.com" full_name = "Team Member One" site_role = "ExplorerCanPublish" auth_setting = "SAML" } resource "tableau_user" "team_member_2" { name = "member2@company.com" email = "member2@company.com" full_name = "Team Member Two" site_role = "Explorer" auth_setting = "SAML" } resource "tableau_group_user" "member1_in_group" { group_id = tableau_group.new_team.id user_id = tableau_user.team_member_1.id } resource "tableau_group_user" "member2_in_group" { group_id = tableau_group.new_team.id user_id = tableau_user.team_member_2.id } resource "tableau_project" "team_project" { name = "Product Analytics" description = "Project for product analytics team" content_permissions = "LockedToProject" owner_id = tableau_user.team_member_1.id } resource "tableau_project_permission" "team_access" { project_id = tableau_project.team_project.id group_id = tableau_group.new_team.id capability_name = "Write" capability_mode = "Allow" } output "team_setup_complete" { value = { group_id = tableau_group.new_team.id project_id = tableau_project.team_project.id member_count = 2 } } ``` -------------------------------- ### Retrieve Virtual Connection Revisions Details Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/virtual_connection_revisions.md This example demonstrates how to use the `tableau_virtual_connection_revisions` data source to fetch details of virtual connection revisions. It requires the ID of an existing virtual connection, which is typically obtained from another data source or resource. ```terraform data "tableau_virtual_connection_revisions" "example" { id = data.tableau_virtual_connections.vc[0].id } ``` -------------------------------- ### Grant Datasource Access to Users and Groups (Terraform) Source: https://context7.com/gthesheep/terraform-provider-tableau/llms.txt Grants access to Tableau datasources for users and groups. This example shows how to reference a datasource using the `tableau_datasource` data source, which requires the datasource name and project ID. ```terraform data "tableau_datasource" "sales_data" { name = "Sales Analytics" project_id = data.tableau_project.existing_project.id } ``` -------------------------------- ### Enable Tableau Server Acceptance Testing Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/README.md This command-line flag enables acceptance testing for Tableau Server-specific resources within the Terraform provider. This is useful for testing resources that might not be available in Tableau Cloud's API. ```bash TF_ACC_SERVER=1 ``` -------------------------------- ### Query Datasource Information (Terraform) Source: https://context7.com/gthesheep/terraform-provider-tableau/llms.txt Demonstrates how to query information about Tableau datasources, both all available datasources and specific ones by name and project. This data can then be used in other resources or for outputting details like ID, name, and owner. ```terraform data "tableau_datasources" "all_datasources" {} data "tableau_datasource" "specific_datasource" { name = "Customer Data" project_id = tableau_project.parent_project.id } output "datasource_details" { value = { id = data.tableau_datasource.specific_datasource.id name = data.tableau_datasource.specific_datasource.name project_id = data.tableau_datasource.specific_datasource.project_id owner_id = data.tableau_datasource.specific_datasource.owner_id } } ``` -------------------------------- ### Create Tableau Projects with Hierarchy (Terraform) Source: https://context7.com/gthesheep/terraform-provider-tableau/llms.txt Defines and manages Tableau projects, including hierarchical structures, using the `tableau_project` resource. Projects can have descriptions, content permissions, and parent project associations. The `tableau_project` and `tableau_projects` data sources can be used to query existing and all projects. ```terraform resource "tableau_project" "parent_project" { name = "Data Science" description = "Parent project for data science teams" content_permissions = "ManagedByOwner" } resource "tableau_project" "child_project" { name = "Machine Learning" description = "ML models and experiments" parent_project_id = tableau_project.parent_project.id content_permissions = "LockedToProject" owner_id = tableau_user.site_admin.id } # Query project data "tableau_project" "existing_project" { name = "Finance" } data "tableau_projects" "all_projects" {} output "project_ids" { value = { for p in data.tableau_projects.all_projects.projects : p.name => p.id } } ``` -------------------------------- ### Configure Tableau Provider Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/index.md This code snippet demonstrates how to configure the Tableau Terraform provider. It requires the server URL, server version, and site name as input. Authentication details like username, password, or personal access tokens can be provided directly or through environment variables. ```terraform provider "tableau" { server_url = "https://my.tableau.server.com" server_version = "3.13" site = "my_site" } ``` -------------------------------- ### Import Tableau Project Resource Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/project.md Demonstrates how to import an existing Tableau project into Terraform management. This command associates a pre-existing project with its Terraform resource identifier. ```shell terraform import tableau_project.example "project_id" ``` -------------------------------- ### tableau_projects Data Source Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/projects.md Retrieve project details as a list of projects available to read. This data source fetches information about Tableau projects and their attributes. ```APIDOC ## tableau_projects Data Source ### Description Retrieve project details as a list of projects available to read. This data source fetches information about Tableau projects and their attributes. ### Method GET ### Endpoint /api/projects ### Parameters #### Query Parameters - `fields` (string) - Optional - Comma-separated list of fields to include in the response. #### Request Body This endpoint does not accept a request body. ### Request Example ```json { "fields": "id,name,parent_project_id" } ``` ### Response #### Success Response (200) - `id` (string) - The ID of the list of projects. - `projects` (list of attributes) - A list of projects and their attributes. - `id` (string) - Project ID. - `name` (string) - Project name. - `parent_project_id` (string) - Parent project ID. #### Response Example ```json { "id": "projects_list_123", "projects": [ { "id": "project_abc", "name": "Sales", "parent_project_id": null }, { "id": "project_def", "name": "Marketing", "parent_project_id": null } ] } ``` ``` -------------------------------- ### Import Virtual Connection Permission (Terraform) Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/virtual_connection_permission.md Provides the command for importing an existing virtual connection permission into Terraform state. The import command requires the virtual connection ID, entity type, entity ID, capability name, and capability mode. ```shell terraform import tableau_virtual_connection_permission.example "virtualconnections//permissions////" ``` -------------------------------- ### Import Tableau Site Resource Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/site.md Imports an existing Tableau site resource into Terraform management using its site ID. ```shell terraform import tableau_site.example "site_id" ``` -------------------------------- ### Create Virtual Connection Permission (Terraform) Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/virtual_connection_permission.md Defines a virtual connection permission resource in Terraform. It requires the virtual connection ID, user ID, capability name, and capability mode. Optionally, a group ID can be specified instead of a user ID. Capabilities include Read, Connect, Overwrite, ChangeHierarchy, Delete, and ChangePermissions, with modes of Allow or Deny. ```terraform resource "tableau_virtual_connection_permission" "test_permission" { virtual_connection_id = "xxxxx-xxxxx-xxxxx" user_id = "xxxxx-xxxxx-xxxxx" capability_name = "Write" capability_mode = "Deny" } ``` -------------------------------- ### Configure Default Project Permissions (Terraform) Source: https://context7.com/gthesheep/terraform-provider-tableau/llms.txt Allows the configuration of default permissions for Tableau projects, which are inherited by new datasources and workbooks within that project. This is useful for establishing baseline security settings. It can output default workbook and datasource permissions. ```terraform data "tableau_default_permissions" "project_defaults" { project_id = tableau_project.parent_project.id } output "default_workbook_permissions" { value = data.tableau_default_permissions.project_defaults.default_workbook_permissions } output "default_datasource_permissions" { value = data.tableau_default_permissions.project_defaults.default_datasource_permissions } ``` -------------------------------- ### Create Tableau Groups and Manage Membership (Terraform) Source: https://context7.com/gthesheep/terraform-provider-tableau/llms.txt Manages Tableau groups and their memberships using `tableau_group` and `tableau_group_user` resources. Groups can be created with minimum site roles, and users can be added to these groups. Data sources `tableau_group` and `tableau_groups` allow querying existing and all groups. ```terraform resource "tableau_group" "analytics_team" { name = "Analytics Team" minimum_site_role = "Explorer" } resource "tableau_group" "power_users" { name = "Power Users" minimum_site_role = "ExplorerCanPublish" } # Add user to group resource "tableau_group_user" "analyst_membership" { group_id = tableau_group.analytics_team.id user_id = tableau_user.data_analyst.id } # Query groups data "tableau_group" "existing_group" { name = "Existing Team" } data "tableau_groups" "all_groups" {} ``` -------------------------------- ### Manage Tableau Sites (Terraform) Source: https://context7.com/gthesheep/terraform-provider-tableau/llms.txt Manages Tableau sites using the `tableau_site` resource, allowing the creation of new sites with specified names and content URLs. The `tableau_site` data source can be used to query information about a specific site. ```terraform resource "tableau_site" "development" { name = "Development Site" content_url = "dev-site" } resource "tableau_site" "production" { name = "Production Site" content_url = "prod" } data "tableau_site" "current_site" { content_url = "my_site" } output "site_info" { value = { id = data.tableau_site.current_site.id name = data.tableau_site.current_site.name content_url = data.tableau_site.current_site.content_url } } ``` -------------------------------- ### Create Tableau Project Resource Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/project.md Defines a Tableau project resource using Terraform. It specifies the project's name, description, content permissions, and optionally its parent project. This resource manages the lifecycle of a Tableau project. ```terraform resource "tableau_project" "test" { name = "test" description = "Moo" content_permissions = "LockedToProject" parent_project_id = tableau_project.test_parent.id } ``` -------------------------------- ### Retrieve Project Permissions using Terraform Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/project_permissions.md This snippet demonstrates how to retrieve project details and then fetch the specific permissions for a project using the Terraform Tableau provider. It first fetches all projects and then uses the ID of the first project to query its permissions. ```terraform data "tableau_projects" "all" { } data "tableau_project_permissions" "project_permissions" { id = data.tableau_projects.all.projects[0].id } ``` -------------------------------- ### Retrieve Tableau Workbook Connections Details (Terraform) Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/workbook_connections.md This Terraform code snippet demonstrates how to use the `tableau_workbook_connections` data source to fetch details of workbook connections. It requires the ID of the workbook, which is assumed to be obtained from another data source `tableau_workbooks.wb[0].id`. The output provides a list of connection details. ```terraform data "tableau_workbook_connections" "example" { id = data.tableau_workbooks.wb[0].id } ``` -------------------------------- ### Import Tableau User Resource Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/user.md Imports an existing Tableau user resource into Terraform management using the user's ID. ```shell terraform import tableau_user.example "user_id" ``` -------------------------------- ### Retrieve Tableau Workbooks Data Source Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/workbooks.md This Terraform configuration block defines the `tableau_workbooks` data source, which is used to fetch details about workbooks from a Tableau environment. It has no required inputs and outputs a list of workbooks with various attributes. ```terraform data "tableau_workbooks" "example" { } ``` -------------------------------- ### Import Project Permission Resource Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/project_permission.md Imports an existing Tableau project permission into Terraform state. Requires the project ID, entity type (user/group), entity ID, capability name, and capability mode. ```shell terraform import tableau_project_permission.example "projects//permissions////" ``` -------------------------------- ### Create Tableau Site Resource Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/site.md Defines a Tableau site resource with a name and content URL. The content URL must contain only alphabetic characters, numbers, hyphens, or underscores. This resource is managed by the Terraform Tableau Provider. ```terraform resource "tableau_site" "test" { name = "test" content_url = "Moo" } ``` -------------------------------- ### Create Project Permission Resource Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/project_permission.md Defines a new project permission resource in Terraform, specifying the project, user, capability name, and mode (Allow/Deny). ```terraform resource "tableau_project_permission" "test_permission" { project_id = "xxxxx-xxxxx-xxxxx" user_id = "xxxxx-xxxxx-xxxxx" capability_name = "Write" capability_mode = "Deny" } ``` -------------------------------- ### Import Tableau Datasource Permission Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/datasource_permission.md Provides the command-line syntax for importing an existing Tableau data source permission into Terraform state. This is useful for managing pre-existing resources. ```shell terraform import tableau_datasource_permission.example "datasources//permissions////" ``` -------------------------------- ### Configure Terraform Tableau Provider Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/README.md This snippet shows how to declare the Tableau provider in your Terraform configuration. It specifies the source and version required for the provider. Ensure you replace '' with the actual version number. ```terraform terraform { required_providers { tableau = { source = "GtheSheep/tableau" version = "" } } } ``` -------------------------------- ### Configure Tableau Provider with Username and Password (Terraform) Source: https://context7.com/gthesheep/terraform-provider-tableau/llms.txt Configures the Tableau Terraform provider using username and password for authentication. It requires the server URL, version, site, username, and password. The site can be an empty string for the default site on Tableau Server. ```terraform provider "tableau" { server_url = "https://10ay.online.tableau.com" server_version = "3.13" site = "" # Empty string for default site on Tableau Server username = "admin@tableau.com" password = "secure-password" } ``` -------------------------------- ### Retrieve Groups Details with Terraform Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/groups.md This Terraform configuration block demonstrates how to use the tableau_groups data source to fetch details about groups within a Tableau environment. It requires no specific input parameters and outputs a list of groups with their attributes. ```terraform data "tableau_groups" "example" { } ``` -------------------------------- ### Configure Tableau Provider with Personal Access Token (Terraform) Source: https://context7.com/gthesheep/terraform-provider-tableau/llms.txt Configures the Tableau Terraform provider using a personal access token for authentication. It specifies the server URL, version, site, username, and token details. Environment variables can also be used as an alternative. ```terraform terraform { required_providers { tableau = { source = "GtheSheep/tableau" version = "~> 1.0" } } } provider "tableau" { server_url = "https://my.tableau.server.com" server_version = "3.13" site = "my_site" username = "admin@tableau.com" personal_access_token_name = "terraform-token" personal_access_token_secret = "your-secret-token" } # Alternative: Use environment variables # TABLEAU_SERVER_URL # TABLEAU_SERVER_VERSION # TABLEAU_SITE_NAME # TABLEAU_USERNAME # TABLEAU_PERSONAL_ACCESS_TOKEN_NAME # TABLEAU_PERSONAL_ACCESS_TOKEN_SECRET ``` -------------------------------- ### Create Tableau Workbook Permission - Terraform Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/workbook_permission.md Defines a Tableau workbook permission resource. It requires the workbook ID, capability name, and capability mode. User or group ID can be optionally provided to specify the target entity. ```terraform resource "tableau_workbook_permission" "test_permission" { workbook_id = "xxxxx-xxxxx-xxxxx" user_id = "xxxxx-xxxxx-xxxxx" capability_name = "Write" capability_mode = "Deny" } ``` -------------------------------- ### Import Tableau Workbook Permission - Terraform Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/workbook_permission.md Imports an existing Tableau workbook permission resource using its unique identifier. The import command requires details about the workbook, entity type, entity ID, capability name, and capability mode. ```shell terraform import tableau_workbook_permission.example "workbooks//permissions////" ``` -------------------------------- ### Terraform Import: tableau_view_permission Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/view_permission.md Demonstrates the command to import an existing Tableau view permission into Terraform state. The import command requires the view ID, entity type (user or group), entity ID, capability name, and capability mode. ```shell terraform import tableau_view_permission.example "views//permissions////" ``` -------------------------------- ### Terraform Import Command for tableau_group_user Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/group_user.md Provides the command syntax for importing an existing tableau_group_user resource into Terraform state. This is useful when managing infrastructure that was not initially provisioned by Terraform. ```shell terraform import group_user.example "group_id:user_id" ``` -------------------------------- ### tableau_project Resource Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/project.md Manages a Tableau project. This resource allows you to create, update, and delete projects within Tableau Server or Tableau Cloud. ```APIDOC ## tableau_project Resource ### Description Manages a Tableau project. This resource allows you to create, update, and delete projects within Tableau Server or Tableau Cloud. ### Method Not applicable (Terraform resource) ### Endpoint Not applicable (Terraform resource) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```terraform resource "tableau_project" "test" { name = "test" description = "Moo" content_permissions = "LockedToProject" parent_project_id = tableau_project.test_parent.id } ``` ### Response #### Success Response (200) None (Terraform resource) #### Response Example None (Terraform resource) ### Schema #### Required - **content_permissions** (String) - Permissions for the project content - ManagedByOwner is the default - **name** (String) - Display name for project #### Optional - **description** (String) - Description for the project - **owner_id** (String) - Identifier for the project owner - **parent_project_id** (String) - Identifier for the parent project #### Read-Only - **id** (String) - The ID of this resource. - **last_updated** (String) - Timestamp of the last Terraform update of the project ### Import Import is supported using the following syntax: ```shell terraform import tableau_project.example "project_id" ``` ``` -------------------------------- ### Create tableau_group Resource Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/group.md Defines a Tableau group with a specified name, license mode, and minimum site role. This resource is managed by Terraform and requires the `name` argument. ```terraform resource "tableau_group" "example" { grant_license_mode = "onLogin" minimum_site_role = "Explorer" name = "Test Users" } ``` -------------------------------- ### Retrieve Tableau Site Details using Terraform Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/site.md This Terraform configuration defines a data source to retrieve details of a Tableau site. It requires the site's ID as input and can output its content URL and name. ```terraform data "tableau_site" "example" { id = "abc" } ``` -------------------------------- ### Retrieve Default Permissions for Tableau Project Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/default_permissions.md This Terraform code snippet demonstrates how to retrieve the default permissions for a specific project and target type in Tableau. It first fetches all projects using the `tableau_projects` data source and then uses the `tableau_default_permissions` data source, referencing the first project's ID and specifying 'workbooks' as the target type. ```terraform data "tableau_projects" "all" { } data "tableau_default_permissions" "default_permissions" { project_id = data.tableau_projects.all.projects[0].id target_type = "workbooks" } ``` -------------------------------- ### Control Workbook Access Permissions (Terraform) Source: https://context7.com/gthesheep/terraform-provider-tableau/llms.txt Facilitates the management of permissions for Tableau workbooks, controlling who can read, export, or modify them. This resource allows setting specific capabilities for groups on individual workbooks. Ensure workbook IDs and group IDs are correctly specified. ```terraform data "tableau_workbooks" "all_workbooks" {} resource "tableau_workbook_permission" "dashboard_viewer" { workbook_id = data.tableau_workbooks.all_workbooks.workbooks[0].id group_id = tableau_group.analytics_team.id capability_name = "Read" capability_mode = "Allow" } resource "tableau_workbook_permission" "prevent_download" { workbook_id = data.tableau_workbooks.all_workbooks.workbooks[0].id group_id = tableau_group.analytics_team.id capability_name = "ExportImage" capability_mode = "Deny" } # Available workbook capabilities: Read, Write, ExportImage, ExportData, # ViewComments, AddComment, Filter, ViewUnderlyingData, WebAuthoring, Delete, ChangePermissions ``` -------------------------------- ### tableau_workbooks Data Source Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/workbooks.md Retrieve Tableau workbooks and their attributes. ```APIDOC ## tableau_workbooks (Data Source) ### Description Retrieve workbooks details. ### Method GET ### Endpoint /api/workbooks ### Parameters #### Query Parameters - **id** (String) - Optional - ID of the workbooks ### Request Example ```terraform data "tableau_workbooks" "example" { } ``` ### Response #### Success Response (200) - **workbooks** (Attributes List) - List of workbooks and their attributes: - **content_url** (String) - Content URL for the workbook - **created_at** (String) - Workbook was created at - **default_view_id** (String) - ID of the workbook default view - **description** (String) - Description for the workbook - **encrypt_extracts** (String) - Whether or not extracts are encrypted - **id** (String) - ID of the workbook - **location_id** (String) - ID of the workbook location - **name** (String) - Name for the workbook - **owner_id** (String) - ID of the workbook owner - **project_id** (String) - ID of the workbook project - **show_tabs** (String) - Whether or not this workbook show tabs - **size** (String) - Workbook size in mega bytes - **updated_at** (String) - Workbook was updated at - **web_page_url** (String) - Web page URL for the workbook #### Response Example ```json { "workbooks": [ { "content_url": "/Workbooks/Sales/SalesDashboard", "created_at": "2023-10-27T10:00:00Z", "default_view_id": "view-123", "description": "Sales performance dashboard", "encrypt_extracts": "true", "id": "workbook-abc", "location_id": "proj-xyz", "name": "Sales Dashboard", "owner_id": "user-456", "project_id": "proj-xyz", "show_tabs": "true", "size": "150", "updated_at": "2023-10-27T10:30:00Z", "web_page_url": "https://your-tableau-server.com/#/site/default/workbooks/workbook-abc" } ] } ``` ``` -------------------------------- ### Manage Project Permissions (Terraform) Source: https://context7.com/gthesheep/terraform-provider-tableau/llms.txt Enables control over project-level permissions in Tableau, allowing administrators to define access rights for groups and users. This can grant roles like 'ProjectLeader' or 'Read' access to specific projects. Project and user/group IDs are essential inputs. ```terraform resource "tableau_project_permission" "team_project_access" { project_id = tableau_project.child_project.id group_id = tableau_group.analytics_team.id capability_name = "ProjectLeader" capability_mode = "Allow" } resource "tableau_project_permission" "read_only_access" { project_id = tableau_project.parent_project.id user_id = tableau_user.data_analyst.id capability_name = "Read" capability_mode = "Allow" } # Query project permissions data "tableau_project_permissions" "current_permissions" { project_id = tableau_project.parent_project.id } ``` -------------------------------- ### Retrieve Tableau Virtual Connection Details Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/virtual_connection_connections.md This Terraform code snippet demonstrates how to fetch the details of connections within a specific Tableau virtual connection. It uses the `tableau_virtual_connection_connections` data source, requiring the ID of the virtual connection to be provided. ```Terraform data "tableau_virtual_connection_connections" "example" { id = data.tableau_virtual_connections.vc[0].id } ``` -------------------------------- ### Control Virtual Connection Access (Terraform) Source: https://context7.com/gthesheep/terraform-provider-tableau/llms.txt Enables management of permissions for Tableau virtual connections, defining access rights for groups to connect to data sources. This resource allows granting or denying capabilities like 'Read' access. Virtual connection IDs and group IDs are necessary inputs. ```terraform data "tableau_virtual_connection" "data_warehouse" { name = "Enterprise DW" } resource "tableau_virtual_connection_permission" "connection_access" { virtual_connection_id = data.tableau_virtual_connection.data_warehouse.id group_id = tableau_group.power_users.id capability_name = "Read" capability_mode = "Allow" } data "tableau_virtual_connection_connections" "vc_connections" { virtual_connection_id = data.tableau_virtual_connection.data_warehouse.id } ``` -------------------------------- ### Manage Datasource Permissions (Terraform) Source: https://context7.com/gthesheep/terraform-provider-tableau/llms.txt Allows configuration of permissions for Tableau datasources, enabling fine-grained access control for users and groups. This includes granting or denying capabilities such as Read, Write, or Delete. Ensure datasource and user/group IDs are correctly referenced. ```terraform resource "tableau_datasource_permission" "user_read" { datasource_id = data.tableau_datasource.sales_data.id user_id = tableau_user.data_analyst.id capability_name = "Read" capability_mode = "Allow" } resource "tableau_datasource_permission" "group_write" { datasource_id = data.tableau_datasource.sales_data.id group_id = tableau_group.power_users.id capability_name = "Write" capability_mode = "Allow" } resource "tableau_datasource_permission" "deny_delete" { datasource_id = data.tableau_datasource.sales_data.id group_id = tableau_group.analytics_team.id capability_name = "Delete" capability_mode = "Deny" } # Available capabilities: ChangePermissions, Connect, Delete, ExportXml, Read, Write, SaveAs ``` -------------------------------- ### Import tableau_group Resource Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/group.md Imports an existing Tableau group into Terraform management. The import command requires the `group_id` of the group to be imported. ```shell terraform import tableau_group.example "group_id" ``` -------------------------------- ### tableau_site Data Source Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/site.md The `tableau_site` data source allows you to retrieve information about a specific Tableau site. You can use this to access details such as the site's ID, content URL, and name. ```APIDOC ## tableau_site Data Source ### Description Retrieve site details. ### Method GET ### Endpoint /api/sites/{site_id} ### Parameters #### Path Parameters - **site_id** (String) - Required - The ID of the site to retrieve. #### Query Parameters None #### Request Body None ### Request Example ```terraform data "tableau_site" "example" { id = "abc" } ``` ### Response #### Success Response (200) - **id** (String) - ID of the site. - **content_url** (String) - The subdomain name of the site's URL. - **name** (String) - Name for the site #### Response Example ```json { "id": "abc", "content_url": "example-site", "name": "Example Site" } ``` ``` -------------------------------- ### Retrieve Tableau Group Details using Terraform Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/group.md This Terraform configuration demonstrates how to use the `tableau_group` data source to fetch information about a group. It requires the group's `id` as input and populates read-only fields like `minimum_site_role` and `name`. ```terraform data "tableau_group" "example" { id = "abc" } ``` -------------------------------- ### Retrieve Tableau Virtual Connections Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/virtual_connections.md This Terraform data source retrieves details for virtual connections in Tableau. It requires no input and outputs a list of virtual connections with their attributes. ```terraform data "tableau_virtual_connections" "example" { } ``` -------------------------------- ### Create Tableau User Resource Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/user.md Defines a Tableau user resource with specified authentication settings, email, full name, display name, and site role. This resource is managed by Terraform. ```terraform resource "tableau_user" "example" { auth_setting = "SAML" email = "test.user@email.com" full_name = "test.user@email.com" name = "test.user@email.com" site_role = "SiteAdministratorCreator" } ``` -------------------------------- ### Create Tableau Datasource Permission Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/datasource_permission.md Defines a Terraform resource for managing permissions on a Tableau data source. It requires the data source ID, user ID, capability name, and capability mode. Optionally, a group ID can be specified instead of a user ID. ```terraform resource "tableau_datasource_permission" "test_permission" { datasource_id = "xxxxx-xxxxx-xxxxx" user_id = "xxxxx-xxxxx-xxxxx" capability_name = "Write" capability_mode = "Deny" } ``` -------------------------------- ### Terraform Resource: tableau_view_permission Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/view_permission.md Defines a Tableau view permission resource with specified capabilities for a user. It requires the view ID, user ID, capability name, and capability mode. The capability mode can be 'Allow' or 'Deny', and the capability name is selected from a predefined list. ```terraform resource "tableau_view_permission" "test_permission" { view_id = "xxxxx-xxxxx-xxxxx" user_id = "xxxxx-xxxxx-xxxxx" capability_name = "Write" capability_mode = "Deny" } ``` -------------------------------- ### tableau_datasource Data Source Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/datasource.md Retrieve datasource details using the tableau_datasource data source. ```APIDOC ## tableau_datasource (Data Source) ### Description Retrieve datasource details. ### Method GET ### Endpoint /api/datasources/{id} ### Parameters #### Query Parameters - **name** (String) - Required - Name for the datasource #### Request Body This endpoint does not accept a request body. ### Request Example ```terraform data "tableau_datasource" "example" { name = "moo" } ``` ### Response #### Success Response (200) - **id** (String) - ID of the datasource - **name** (String) - Name for the datasource - **certification_note** (String) - Certification note - **content_url** (String) - URL of the datasource content - **description** (String) - Datasource description - **encrypt_extracts** (String) - Whether or not this datasource encrypts extracts - **has_extracts** (Boolean) - Whether or not this datasource has extracts - **is_certified** (Boolean) - Whether or not this datasource is certified - **owner_id** (String) - Datasource Owner ID - **project_id** (String) - Datasource Project ID - **tags** (List of String) - List of tags on the datasource - **type** (String) - Type of datasource - **use_remote_query_agent** (Boolean) - Whether or not this datasource uses a remote query agent - **web_page_url** (String) - Web page URL for the datasource #### Response Example ```json { "id": "example-datasource-id", "name": "moo", "certification_note": "", "content_url": "https://your-tableau-server.com/data/moo/1", "description": "Example Datasource", "encrypt_extracts": "false", "has_extracts": true, "is_certified": false, "owner_id": "user-id-123", "project_id": "project-id-abc", "tags": ["example", "data"], "type": "hyper", "use_remote_query_agent": false, "web_page_url": "https://your-tableau-server.com/data/moo" } ``` ``` -------------------------------- ### Manage View-Level Permissions (Terraform) Source: https://context7.com/gthesheep/terraform-provider-tableau/llms.txt Provides the capability to manage access control at the view level within Tableau dashboards. This allows for granular permission settings on individual views, such as restricting data export for specific groups. View IDs and user/group IDs are required. ```terraform resource "tableau_view_permission" "view_access" { view_id = "view-uuid-here" user_id = tableau_user.data_analyst.id capability_name = "Read" capability_mode = "Allow" } resource "tableau_view_permission" "restrict_export" { view_id = "view-uuid-here" group_id = tableau_group.analytics_team.id capability_name = "ExportData" capability_mode = "Deny" } ``` -------------------------------- ### tableau_datasources Data Source Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/datasources.md Retrieve datasource details as a list of datasources available to read. ```APIDOC ## tableau_datasources Data Source ### Description Retrieve datasource details as a list of datasources available to read. ### Method GET ### Endpoint /api/v3/datasources ### Parameters #### Query Parameters - **fields** (string) - Optional - Comma-separated list of fields to return for each datasource. #### Request Body This endpoint does not accept a request body. ### Response #### Success Response (200) - **datasources** (array of objects) - List of datasources and their attributes. - **id** (string) - ID of the datasource. - **name** (string) - Datasource name. - **owner_id** (string) - Datasource Owner ID. - **project_id** (string) - Datasource Project ID. - **type** (string) - Type of datasource. #### Response Example ```json { "datasources": [ { "id": "123e4567-e89b-12d3-a456-426614174000", "name": "Sales Data", "owner_id": "user-abc-123", "project_id": "project-xyz-789", "type": "live" }, { "id": "987e6543-e21b-3d12-a456-426614174000", "name": "Inventory Report", "owner_id": "user-def-456", "project_id": "project-uvw-012", "type": "extract" } ] } ``` ``` -------------------------------- ### Retrieve Tableau User Details Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/user.md This Terraform data source allows you to fetch details of a specific user from Tableau by providing their ID. It returns various attributes of the user, including their authentication settings, email, full name, name, and site role. The `id` is a required input. ```terraform data "tableau_user" "example" { id = "abc" } ``` -------------------------------- ### Data Source: tableau_virtual_connection_connections Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/virtual_connection_connections.md This data source can be used to retrieve details about the connections associated with a Tableau virtual connection. It requires the ID of the virtual connection. ```APIDOC ## Data Source: tableau_virtual_connection_connections ### Description This data source retrieves the details of connections within a Tableau virtual connection. It requires the ID of the virtual connection. ### Method DATA (Terraform) ### Endpoint N/A (Terraform data source) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```terraform data "tableau_virtual_connection_connections" "example" { id = data.tableau_virtual_connections.vc[0].id } ``` ### Response #### Success Response (200) - **connections** (Attributes List) - List of database connections and their attributes. - **db_class** (String) - DB class of the connection. - **id** (String) - ID of the connection within the Virtual Connection. - **server_address** (String) - Server address of the connection. - **server_port** (String) - Server port of the connection. - **username** (String) - Username for the connection. #### Response Example ```json { "connections": [ { "db_class": "PostgreSQL", "id": "conn-123", "server_address": "db.example.com", "server_port": "5432", "username": "admin" } ] } ``` ``` -------------------------------- ### Retrieve Users - Terraform Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/users.md This data source retrieves user details as a list of users available to read from Tableau. It does not require any specific inputs but outputs a list of users with their attributes. ```terraform data "tableau_users" "example" { } ``` -------------------------------- ### tableau_virtual_connection Data Source Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/virtual_connection.md This data source retrieves details for a specific Tableau virtual connection using its ID. It allows you to access information like the connection's name, owner, project, and its JSON definition. ```APIDOC ## tableau_virtual_connection (Data Source) ### Description Retrieve virtual Connection details. ### Method GET ### Endpoint /api/3.0/sites/{site_luid}/virtualconnections/{virtual_connection_luid} ### Parameters #### Path Parameters - **id** (String) - Required - ID of the virtual Connection. This is typically the `virtual_connection_luid` from the Tableau API. #### Query Parameters None #### Request Body None ### Request Example ```terraform data "tableau_virtual_connection" "vc0" { id = data.tableau_virtual_connections.vcs.virtual_connections[0].id } ``` ### Response #### Success Response (200) - **id** (String) - The unique identifier of the virtual connection. - **name** (String) - The name of the virtual connection. - **content** (String) - The definition of the virtual connection in JSON format. - **owner_id** (String) - The ID of the user who owns the virtual connection. - **project_id** (String) - The ID of the project to which the virtual connection belongs. #### Response Example ```json { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "name": "MyVirtualConnection", "content": "{\"connectionInfo\": {\"type\": \"postgresql\", \"username\": \"user\"}}", "owner_id": "user-12345", "project_id": "project-abcde" } ``` ``` -------------------------------- ### tableau_virtual_connection_revisions Data Source Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/virtual_connection_revisions.md This data source retrieves details about virtual connection revisions. It requires the ID of the virtual connection. ```APIDOC ## tableau_virtual_connection_revisions (Data Source) ### Description Retrieve virtual connection revisions details. ### Method GET ### Endpoint /api/v3/sites/{siteId}/virtualconnections/{virtualConnectionId}/revisions ### Parameters #### Path Parameters - **siteId** (string) - Required - The ID of the site. - **virtualConnectionId** (string) - Required - The ID of the virtual connection. #### Query Parameters None #### Request Body None ### Request Example ```terraform data "tableau_virtual_connection_revisions" "example" { id = data.tableau_virtual_connections.vc[0].id } ``` ### Response #### Success Response (200) - **revisions** (Array of Objects) - List of virtual connection revisions. - **current** (Boolean) - Indicates if this is the current revision. - **deleted** (Boolean) - Indicates if the revision has been deleted. - **published_at** (String) - The timestamp when the revision was published. - **publisher_id** (String) - The ID of the user who published the revision. - **revision_number** (String) - The unique number of the revision. #### Response Example ```json { "revisions": [ { "current": true, "deleted": false, "published_at": "2023-10-27T10:00:00Z", "publisher_id": "user123", "revision_number": "1" } ] } ``` ``` -------------------------------- ### Terraform Data Source for Tableau Workbook Revisions Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/workbook_revisions.md This Terraform configuration retrieves the revision details for a specified Tableau workbook revision. It depends on the workbook ID, which is expected to be provided by another data source or resource. The output is a list of attributes for each revision. ```terraform data "tableau_workbook_revisions" "example" { id = data.tableau_workbooks.wb[0].id } ``` -------------------------------- ### Terraform Resource Definition for tableau_group_user Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/resources/group_user.md Defines a Terraform resource for managing users within Tableau groups. It requires the group ID and user ID as input, and outputs resource identifiers and last updated timestamp. This is used to programmatically manage group memberships. ```terraform resource "tableau_group_user" "example" { group_id = tableau_group.test_users.id user_id = tableau_user.test_user.id } ``` -------------------------------- ### tableau_user Data Source Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/user.md The tableau_user data source is used to retrieve information about a specific user in Tableau. ```APIDOC ## tableau_user (Data Source) ### Description Retrieve user details. ### Method GET ### Endpoint /api/v3/sites/{site_id}/users/{user_id} ### Parameters #### Path Parameters - **site_id** (string) - Required - The ID of the Tableau site. - **user_id** (string) - Required - The ID of the user to retrieve. #### Query Parameters None #### Request Body None ### Request Example ```terraform data "tableau_user" "example" { id = "abc" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the user. - **name** (string) - The username for the user. - **full_name** (string) - The full name of the user. - **email** (string) - The email address of the user. - **auth_setting** (string) - The authentication setting for the user (e.g., "Local", "SAML"). - **site_role** (string) - The role assigned to the user within the site (e.g., "Creator", "Explorer", "Viewer"). #### Response Example ```json { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "name": "jsmith", "full_name": "John Smith", "email": "john.smith@example.com", "auth_setting": "Local", "site_role": "Creator" } ``` ``` -------------------------------- ### tableau_group Data Source Source: https://github.com/gthesheep/terraform-provider-tableau/blob/main/docs/data-sources/group.md The tableau_group data source is used to retrieve information about a Tableau group. ```APIDOC ## tableau_group (Data Source) ### Description Retrieve group details ### Method GET (Implicit - data source retrieval) ### Endpoint Not directly applicable as this is a data source configuration within Terraform. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```terraform data "tableau_group" "example" { id = "abc" } ``` ### Response #### Success Response (Implicit - data source read) - **id** (String) - ID of the group - **minimum_site_role** (String) - Minimum site role for the group - **name** (String) - Name for the group #### Response Example (Response details are populated into Terraform state after successful data source read) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.