powerplatform_connection_share (Resource)
Example Usage
terraform {
  required_providers {
    powerplatform = {
      source = "microsoft/power-platform"
    }
  }
}
provider "powerplatform" {
  use_cli = true
}
resource "powerplatform_connection" "new_sql_connection" {
  environment_id = var.environment_id
  name           = "shared_sql"
  display_name   = "My SQL Connection"
  connection_parameters_set = jsonencode({
    "name" : "oauthSP",
    "values" : {
      "token" : {
        "value" : "https://global.consent.azure-apim.net/redirect/sql"
      },
      "token:TenantId" : {
        "value" : "${var.tenant_id}"
      },
      "token:clientId" : {
        "value" : "${var.client_id}"
      },
      "token:clientSecret" : {
        "value" : "${var.client_secret}"
      }
    }
  })
  lifecycle {
    ignore_changes = [
      connection_parameters_set
    ]
  }
}
resource "powerplatform_connection_share" "share_with_admin" {
  environment_id = var.environment_id
  connector_name = powerplatform_connection.new_sql_connection.name
  connection_id  = powerplatform_connection.new_sql_connection.id
  role_name      = "CanEdit"
  principal = {
    entra_object_id = var.user_object_id
  }
}
Schema
Required
- connection_id(String) Unique identifier of the connection
- connector_name(String) Name of the connector
- environment_id(String) Unique identifier of the environment
- principal(Attributes) Principal to share the connection with (see below for nested schema)
- role_name(String) Name of the role to assign to the principal
Optional
- timeouts(Attributes) (see below for nested schema)
Read-Only
- id(String) Unique identifier of the connection share
Nested Schema for principal
Required:
- entra_object_id(String) Entra Object Id of the principal
Read-Only:
- display_name(String) Display name of the principal
Nested Schema for timeouts
Optional:
- create(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- delete(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- read(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- update(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).