authentik.PolicyBinding
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as authentik from "@pulumi/authentik";
// Create a policy binding for a resource
const policy = new authentik.PolicyExpression("policy", {expression: "return True"});
const nameApplication = new authentik.Application("nameApplication", {slug: "test-app"});
const app_accessPolicyBinding = new authentik.PolicyBinding("app-accessPolicyBinding", {
    target: nameApplication.uuid,
    policy: policy.policyExpressionId,
    order: 0,
});
// Create a binding to a group
const admins = authentik.getGroup({
    name: "authentik Admins",
});
const nameIndex_applicationApplication = new authentik.Application("nameIndex/applicationApplication", {slug: "test-app"});
const app_accessIndex_policyBindingPolicyBinding = new authentik.PolicyBinding("app-accessIndex/policyBindingPolicyBinding", {
    target: nameApplication.uuid,
    group: admins.then(admins => admins.id),
    order: 0,
});
import pulumi
import pulumi_authentik as authentik
# Create a policy binding for a resource
policy = authentik.PolicyExpression("policy", expression="return True")
name_application = authentik.Application("nameApplication", slug="test-app")
app_access_policy_binding = authentik.PolicyBinding("app-accessPolicyBinding",
    target=name_application.uuid,
    policy=policy.policy_expression_id,
    order=0)
# Create a binding to a group
admins = authentik.get_group(name="authentik Admins")
name_index_application_application = authentik.Application("nameIndex/applicationApplication", slug="test-app")
app_access_index_policy_binding_policy_binding = authentik.PolicyBinding("app-accessIndex/policyBindingPolicyBinding",
    target=name_application.uuid,
    group=admins.id,
    order=0)
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/authentik/v2025/authentik"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Create a policy binding for a resource
		policy, err := authentik.NewPolicyExpression(ctx, "policy", &authentik.PolicyExpressionArgs{
			Expression: pulumi.String("return True"),
		})
		if err != nil {
			return err
		}
		nameApplication, err := authentik.NewApplication(ctx, "nameApplication", &authentik.ApplicationArgs{
			Slug: pulumi.String("test-app"),
		})
		if err != nil {
			return err
		}
		_, err = authentik.NewPolicyBinding(ctx, "app-accessPolicyBinding", &authentik.PolicyBindingArgs{
			Target: nameApplication.Uuid,
			Policy: policy.PolicyExpressionId,
			Order:  pulumi.Float64(0),
		})
		if err != nil {
			return err
		}
		admins, err := authentik.LookupGroup(ctx, &authentik.LookupGroupArgs{
			Name: pulumi.StringRef("authentik Admins"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = authentik.NewApplication(ctx, "nameIndex/applicationApplication", &authentik.ApplicationArgs{
			Slug: pulumi.String("test-app"),
		})
		if err != nil {
			return err
		}
		_, err = authentik.NewPolicyBinding(ctx, "app-accessIndex/policyBindingPolicyBinding", &authentik.PolicyBindingArgs{
			Target: nameApplication.Uuid,
			Group:  pulumi.String(admins.Id),
			Order:  pulumi.Float64(0),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Authentik = Pulumi.Authentik;
return await Deployment.RunAsync(() => 
{
    // Create a policy binding for a resource
    var policy = new Authentik.PolicyExpression("policy", new()
    {
        Expression = "return True",
    });
    var nameApplication = new Authentik.Application("nameApplication", new()
    {
        Slug = "test-app",
    });
    var app_accessPolicyBinding = new Authentik.PolicyBinding("app-accessPolicyBinding", new()
    {
        Target = nameApplication.Uuid,
        Policy = policy.PolicyExpressionId,
        Order = 0,
    });
    // Create a binding to a group
    var admins = Authentik.GetGroup.Invoke(new()
    {
        Name = "authentik Admins",
    });
    var nameIndex_applicationApplication = new Authentik.Application("nameIndex/applicationApplication", new()
    {
        Slug = "test-app",
    });
    var app_accessIndex_policyBindingPolicyBinding = new Authentik.PolicyBinding("app-accessIndex/policyBindingPolicyBinding", new()
    {
        Target = nameApplication.Uuid,
        Group = admins.Apply(getGroupResult => getGroupResult.Id),
        Order = 0,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.authentik.PolicyExpression;
import com.pulumi.authentik.PolicyExpressionArgs;
import com.pulumi.authentik.Application;
import com.pulumi.authentik.ApplicationArgs;
import com.pulumi.authentik.PolicyBinding;
import com.pulumi.authentik.PolicyBindingArgs;
import com.pulumi.authentik.AuthentikFunctions;
import com.pulumi.authentik.inputs.GetGroupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        // Create a policy binding for a resource
        var policy = new PolicyExpression("policy", PolicyExpressionArgs.builder()
            .expression("return True")
            .build());
        var nameApplication = new Application("nameApplication", ApplicationArgs.builder()
            .slug("test-app")
            .build());
        var app_accessPolicyBinding = new PolicyBinding("app-accessPolicyBinding", PolicyBindingArgs.builder()
            .target(nameApplication.uuid())
            .policy(policy.policyExpressionId())
            .order(0)
            .build());
        // Create a binding to a group
        final var admins = AuthentikFunctions.getGroup(GetGroupArgs.builder()
            .name("authentik Admins")
            .build());
        var nameIndex_applicationApplication = new Application("nameIndex/applicationApplication", ApplicationArgs.builder()
            .slug("test-app")
            .build());
        var app_accessIndex_policyBindingPolicyBinding = new PolicyBinding("app-accessIndex/policyBindingPolicyBinding", PolicyBindingArgs.builder()
            .target(nameApplication.uuid())
            .group(admins.applyValue(getGroupResult -> getGroupResult.id()))
            .order(0)
            .build());
    }
}
resources:
  # Create a policy binding for a resource
  policy:
    type: authentik:PolicyExpression
    properties:
      expression: return True
  nameApplication:
    type: authentik:Application
    properties:
      slug: test-app
  app-accessPolicyBinding: # Create a binding to a group
    type: authentik:PolicyBinding
    properties:
      target: ${nameApplication.uuid}
      policy: ${policy.policyExpressionId}
      order: 0
  nameIndex/applicationApplication:
    type: authentik:Application
    properties:
      slug: test-app
  app-accessIndex/policyBindingPolicyBinding:
    type: authentik:PolicyBinding
    properties:
      target: ${nameApplication.uuid}
      group: ${admins.id}
      order: 0
variables:
  admins:
    fn::invoke:
      function: authentik:getGroup
      arguments:
        name: authentik Admins
Create PolicyBinding Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PolicyBinding(name: string, args: PolicyBindingArgs, opts?: CustomResourceOptions);@overload
def PolicyBinding(resource_name: str,
                  args: PolicyBindingArgs,
                  opts: Optional[ResourceOptions] = None)
@overload
def PolicyBinding(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  order: Optional[float] = None,
                  target: Optional[str] = None,
                  enabled: Optional[bool] = None,
                  failure_result: Optional[bool] = None,
                  group: Optional[str] = None,
                  negate: Optional[bool] = None,
                  policy: Optional[str] = None,
                  policy_binding_id: Optional[str] = None,
                  timeout: Optional[float] = None,
                  user: Optional[float] = None)func NewPolicyBinding(ctx *Context, name string, args PolicyBindingArgs, opts ...ResourceOption) (*PolicyBinding, error)public PolicyBinding(string name, PolicyBindingArgs args, CustomResourceOptions? opts = null)
public PolicyBinding(String name, PolicyBindingArgs args)
public PolicyBinding(String name, PolicyBindingArgs args, CustomResourceOptions options)
type: authentik:PolicyBinding
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
 - The unique name of the resource.
 - args PolicyBindingArgs
 - The arguments to resource properties.
 - opts CustomResourceOptions
 - Bag of options to control resource's behavior.
 
- resource_name str
 - The unique name of the resource.
 - args PolicyBindingArgs
 - The arguments to resource properties.
 - opts ResourceOptions
 - Bag of options to control resource's behavior.
 
- ctx Context
 - Context object for the current deployment.
 - name string
 - The unique name of the resource.
 - args PolicyBindingArgs
 - The arguments to resource properties.
 - opts ResourceOption
 - Bag of options to control resource's behavior.
 
- name string
 - The unique name of the resource.
 - args PolicyBindingArgs
 - The arguments to resource properties.
 - opts CustomResourceOptions
 - Bag of options to control resource's behavior.
 
- name String
 - The unique name of the resource.
 - args PolicyBindingArgs
 - The arguments to resource properties.
 - options CustomResourceOptions
 - Bag of options to control resource's behavior.
 
Constructor example
The following reference example uses placeholder values for all input properties.
var policyBindingResource = new Authentik.PolicyBinding("policyBindingResource", new()
{
    Order = 0,
    Target = "string",
    Enabled = false,
    FailureResult = false,
    Group = "string",
    Negate = false,
    Policy = "string",
    PolicyBindingId = "string",
    Timeout = 0,
    User = 0,
});
example, err := authentik.NewPolicyBinding(ctx, "policyBindingResource", &authentik.PolicyBindingArgs{
	Order:           pulumi.Float64(0),
	Target:          pulumi.String("string"),
	Enabled:         pulumi.Bool(false),
	FailureResult:   pulumi.Bool(false),
	Group:           pulumi.String("string"),
	Negate:          pulumi.Bool(false),
	Policy:          pulumi.String("string"),
	PolicyBindingId: pulumi.String("string"),
	Timeout:         pulumi.Float64(0),
	User:            pulumi.Float64(0),
})
var policyBindingResource = new PolicyBinding("policyBindingResource", PolicyBindingArgs.builder()
    .order(0)
    .target("string")
    .enabled(false)
    .failureResult(false)
    .group("string")
    .negate(false)
    .policy("string")
    .policyBindingId("string")
    .timeout(0)
    .user(0)
    .build());
policy_binding_resource = authentik.PolicyBinding("policyBindingResource",
    order=0,
    target="string",
    enabled=False,
    failure_result=False,
    group="string",
    negate=False,
    policy="string",
    policy_binding_id="string",
    timeout=0,
    user=0)
const policyBindingResource = new authentik.PolicyBinding("policyBindingResource", {
    order: 0,
    target: "string",
    enabled: false,
    failureResult: false,
    group: "string",
    negate: false,
    policy: "string",
    policyBindingId: "string",
    timeout: 0,
    user: 0,
});
type: authentik:PolicyBinding
properties:
    enabled: false
    failureResult: false
    group: string
    negate: false
    order: 0
    policy: string
    policyBindingId: string
    target: string
    timeout: 0
    user: 0
PolicyBinding Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The PolicyBinding resource accepts the following input properties:
- Order double
 - Target string
 - ID of the object this binding should apply to
 - Enabled bool
 - Defaults to 
true. - Failure
Result bool - Defaults to 
false. - Group string
 - UUID of the group
 - Negate bool
 - Defaults to 
false. - Policy string
 - UUID of the policy
 - Policy
Binding stringId  - The ID of this resource.
 - Timeout double
 - Defaults to 
30. - User double
 - PK of the user
 
- Order float64
 - Target string
 - ID of the object this binding should apply to
 - Enabled bool
 - Defaults to 
true. - Failure
Result bool - Defaults to 
false. - Group string
 - UUID of the group
 - Negate bool
 - Defaults to 
false. - Policy string
 - UUID of the policy
 - Policy
Binding stringId  - The ID of this resource.
 - Timeout float64
 - Defaults to 
30. - User float64
 - PK of the user
 
- order Double
 - target String
 - ID of the object this binding should apply to
 - enabled Boolean
 - Defaults to 
true. - failure
Result Boolean - Defaults to 
false. - group String
 - UUID of the group
 - negate Boolean
 - Defaults to 
false. - policy String
 - UUID of the policy
 - policy
Binding StringId  - The ID of this resource.
 - timeout Double
 - Defaults to 
30. - user Double
 - PK of the user
 
- order number
 - target string
 - ID of the object this binding should apply to
 - enabled boolean
 - Defaults to 
true. - failure
Result boolean - Defaults to 
false. - group string
 - UUID of the group
 - negate boolean
 - Defaults to 
false. - policy string
 - UUID of the policy
 - policy
Binding stringId  - The ID of this resource.
 - timeout number
 - Defaults to 
30. - user number
 - PK of the user
 
- order float
 - target str
 - ID of the object this binding should apply to
 - enabled bool
 - Defaults to 
true. - failure_
result bool - Defaults to 
false. - group str
 - UUID of the group
 - negate bool
 - Defaults to 
false. - policy str
 - UUID of the policy
 - policy_
binding_ strid  - The ID of this resource.
 - timeout float
 - Defaults to 
30. - user float
 - PK of the user
 
- order Number
 - target String
 - ID of the object this binding should apply to
 - enabled Boolean
 - Defaults to 
true. - failure
Result Boolean - Defaults to 
false. - group String
 - UUID of the group
 - negate Boolean
 - Defaults to 
false. - policy String
 - UUID of the policy
 - policy
Binding StringId  - The ID of this resource.
 - timeout Number
 - Defaults to 
30. - user Number
 - PK of the user
 
Outputs
All input properties are implicitly available as output properties. Additionally, the PolicyBinding resource produces the following output properties:
- Id string
 - The provider-assigned unique ID for this managed resource.
 
- Id string
 - The provider-assigned unique ID for this managed resource.
 
- id String
 - The provider-assigned unique ID for this managed resource.
 
- id string
 - The provider-assigned unique ID for this managed resource.
 
- id str
 - The provider-assigned unique ID for this managed resource.
 
- id String
 - The provider-assigned unique ID for this managed resource.
 
Look up Existing PolicyBinding Resource
Get an existing PolicyBinding resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: PolicyBindingState, opts?: CustomResourceOptions): PolicyBinding@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        enabled: Optional[bool] = None,
        failure_result: Optional[bool] = None,
        group: Optional[str] = None,
        negate: Optional[bool] = None,
        order: Optional[float] = None,
        policy: Optional[str] = None,
        policy_binding_id: Optional[str] = None,
        target: Optional[str] = None,
        timeout: Optional[float] = None,
        user: Optional[float] = None) -> PolicyBindingfunc GetPolicyBinding(ctx *Context, name string, id IDInput, state *PolicyBindingState, opts ...ResourceOption) (*PolicyBinding, error)public static PolicyBinding Get(string name, Input<string> id, PolicyBindingState? state, CustomResourceOptions? opts = null)public static PolicyBinding get(String name, Output<String> id, PolicyBindingState state, CustomResourceOptions options)resources:  _:    type: authentik:PolicyBinding    get:      id: ${id}- name
 - The unique name of the resulting resource.
 - id
 - The unique provider ID of the resource to lookup.
 - state
 - Any extra arguments used during the lookup.
 - opts
 - A bag of options that control this resource's behavior.
 
- resource_name
 - The unique name of the resulting resource.
 - id
 - The unique provider ID of the resource to lookup.
 
- name
 - The unique name of the resulting resource.
 - id
 - The unique provider ID of the resource to lookup.
 - state
 - Any extra arguments used during the lookup.
 - opts
 - A bag of options that control this resource's behavior.
 
- name
 - The unique name of the resulting resource.
 - id
 - The unique provider ID of the resource to lookup.
 - state
 - Any extra arguments used during the lookup.
 - opts
 - A bag of options that control this resource's behavior.
 
- name
 - The unique name of the resulting resource.
 - id
 - The unique provider ID of the resource to lookup.
 - state
 - Any extra arguments used during the lookup.
 - opts
 - A bag of options that control this resource's behavior.
 
- Enabled bool
 - Defaults to 
true. - Failure
Result bool - Defaults to 
false. - Group string
 - UUID of the group
 - Negate bool
 - Defaults to 
false. - Order double
 - Policy string
 - UUID of the policy
 - Policy
Binding stringId  - The ID of this resource.
 - Target string
 - ID of the object this binding should apply to
 - Timeout double
 - Defaults to 
30. - User double
 - PK of the user
 
- Enabled bool
 - Defaults to 
true. - Failure
Result bool - Defaults to 
false. - Group string
 - UUID of the group
 - Negate bool
 - Defaults to 
false. - Order float64
 - Policy string
 - UUID of the policy
 - Policy
Binding stringId  - The ID of this resource.
 - Target string
 - ID of the object this binding should apply to
 - Timeout float64
 - Defaults to 
30. - User float64
 - PK of the user
 
- enabled Boolean
 - Defaults to 
true. - failure
Result Boolean - Defaults to 
false. - group String
 - UUID of the group
 - negate Boolean
 - Defaults to 
false. - order Double
 - policy String
 - UUID of the policy
 - policy
Binding StringId  - The ID of this resource.
 - target String
 - ID of the object this binding should apply to
 - timeout Double
 - Defaults to 
30. - user Double
 - PK of the user
 
- enabled boolean
 - Defaults to 
true. - failure
Result boolean - Defaults to 
false. - group string
 - UUID of the group
 - negate boolean
 - Defaults to 
false. - order number
 - policy string
 - UUID of the policy
 - policy
Binding stringId  - The ID of this resource.
 - target string
 - ID of the object this binding should apply to
 - timeout number
 - Defaults to 
30. - user number
 - PK of the user
 
- enabled bool
 - Defaults to 
true. - failure_
result bool - Defaults to 
false. - group str
 - UUID of the group
 - negate bool
 - Defaults to 
false. - order float
 - policy str
 - UUID of the policy
 - policy_
binding_ strid  - The ID of this resource.
 - target str
 - ID of the object this binding should apply to
 - timeout float
 - Defaults to 
30. - user float
 - PK of the user
 
- enabled Boolean
 - Defaults to 
true. - failure
Result Boolean - Defaults to 
false. - group String
 - UUID of the group
 - negate Boolean
 - Defaults to 
false. - order Number
 - policy String
 - UUID of the policy
 - policy
Binding StringId  - The ID of this resource.
 - target String
 - ID of the object this binding should apply to
 - timeout Number
 - Defaults to 
30. - user Number
 - PK of the user
 
Package Details
- Repository
 - authentik goauthentik/terraform-provider-authentik
 - License
 - Notes
 - This Pulumi package is based on the 
authentikTerraform Provider.