1. Registry
  2. Packages
  3. Okta Provider
  4. API Docs
  5. RoleSubscription
Viewing docs for Okta v7.0.1
published on Tuesday, Oct 13, 2026 by Pulumi
okta logo
Viewing docs for Okta v7.0.1
published on Tuesday, Oct 13, 2026 by Pulumi

    Manages role subscription.

    This resource allows you to configure subscriptions of a Role with a specific notification type. Check configure email notifications page regarding what notifications are available for specific admin roles.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as okta from "@pulumi/okta";
    
    const test = new okta.RoleSubscription("test", {
        roleRef: "SUPER_ADMIN",
        notificationType: "APP_IMPORT",
    });
    
    import pulumi
    import pulumi_okta as okta
    
    test = okta.RoleSubscription("test",
        role_ref="SUPER_ADMIN",
        notification_type="APP_IMPORT")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-okta/sdk/v7/go/okta"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := okta.NewRoleSubscription(ctx, "test", &okta.RoleSubscriptionArgs{
    			RoleRef:          pulumi.String("SUPER_ADMIN"),
    			NotificationType: pulumi.String("APP_IMPORT"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Okta = Pulumi.Okta;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Okta.RoleSubscription("test", new()
        {
            RoleRef = "SUPER_ADMIN",
            NotificationType = "APP_IMPORT",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.okta.RoleSubscription;
    import com.pulumi.okta.RoleSubscriptionArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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) {
            var test = new RoleSubscription("test", RoleSubscriptionArgs.builder()
                .roleRef("SUPER_ADMIN")
                .notificationType("APP_IMPORT")
                .build());
    
        }
    }
    
    resources:
      test:
        type: okta:RoleSubscription
        properties:
          roleRef: SUPER_ADMIN
          notificationType: APP_IMPORT
    
    terraform {
      required_providers {
        okta = {
          source = "pulumi/okta"
        }
      }
    }
    
    resource "okta_role_subscription" "test" {
      lifecycle {
        create_before_destroy = true
      }
      role_ref          = "SUPER_ADMIN"
      notification_type = "APP_IMPORT"
    }
    

    Create RoleSubscription Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new RoleSubscription(name: string, args: RoleSubscriptionArgs, opts?: CustomResourceOptions);
    @overload
    def RoleSubscription(resource_name: str,
                         args: RoleSubscriptionArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def RoleSubscription(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         notification_type: Optional[str] = None,
                         role_ref: Optional[str] = None,
                         channels: Optional[Sequence[str]] = None)
    func NewRoleSubscription(ctx *Context, name string, args RoleSubscriptionArgs, opts ...ResourceOption) (*RoleSubscription, error)
    public RoleSubscription(string name, RoleSubscriptionArgs args, CustomResourceOptions? opts = null)
    public RoleSubscription(String name, RoleSubscriptionArgs args)
    public RoleSubscription(String name, RoleSubscriptionArgs args, CustomResourceOptions options)
    
    type: okta:RoleSubscription
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "okta_role_subscription" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args RoleSubscriptionArgs
    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 RoleSubscriptionArgs
    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 RoleSubscriptionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RoleSubscriptionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RoleSubscriptionArgs
    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 roleSubscriptionResource = new Okta.RoleSubscription("roleSubscriptionResource", new()
    {
        NotificationType = "string",
        RoleRef = "string",
        Channels = new[]
        {
            "string",
        },
    });
    
    example, err := okta.NewRoleSubscription(ctx, "roleSubscriptionResource", &okta.RoleSubscriptionArgs{
    	NotificationType: pulumi.String("string"),
    	RoleRef:          pulumi.String("string"),
    	Channels: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    resource "okta_role_subscription" "roleSubscriptionResource" {
      lifecycle {
        create_before_destroy = true
      }
      notification_type = "string"
      role_ref          = "string"
      channels          = ["string"]
    }
    
    var roleSubscriptionResource = new RoleSubscription("roleSubscriptionResource", RoleSubscriptionArgs.builder()
        .notificationType("string")
        .roleRef("string")
        .channels("string")
        .build());
    
    role_subscription_resource = okta.RoleSubscription("roleSubscriptionResource",
        notification_type="string",
        role_ref="string",
        channels=["string"])
    
    const roleSubscriptionResource = new okta.RoleSubscription("roleSubscriptionResource", {
        notificationType: "string",
        roleRef: "string",
        channels: ["string"],
    });
    
    type: okta:RoleSubscription
    properties:
        channels:
            - string
        notificationType: string
        roleRef: string
    

    RoleSubscription 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 RoleSubscription resource accepts the following input properties:

    NotificationType string
    Type of the notification
    RoleRef string
    A reference to an existing role
    Channels List<string>
    An array of sources send notifications to users.
    NotificationType string
    Type of the notification
    RoleRef string
    A reference to an existing role
    Channels []string
    An array of sources send notifications to users.
    notification_type string
    Type of the notification
    role_ref string
    A reference to an existing role
    channels list(string)
    An array of sources send notifications to users.
    notificationType String
    Type of the notification
    roleRef String
    A reference to an existing role
    channels List<String>
    An array of sources send notifications to users.
    notificationType string
    Type of the notification
    roleRef string
    A reference to an existing role
    channels string[]
    An array of sources send notifications to users.
    notification_type str
    Type of the notification
    role_ref str
    A reference to an existing role
    channels Sequence[str]
    An array of sources send notifications to users.
    notificationType String
    Type of the notification
    roleRef String
    A reference to an existing role
    channels List<String>
    An array of sources send notifications to users.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the RoleSubscription resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the subscription
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the subscription
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the subscription
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the subscription
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the subscription
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the subscription
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the subscription

    Look up Existing RoleSubscription Resource

    Get an existing RoleSubscription 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?: RoleSubscriptionState, opts?: CustomResourceOptions): RoleSubscription
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            channels: Optional[Sequence[str]] = None,
            notification_type: Optional[str] = None,
            role_ref: Optional[str] = None,
            status: Optional[str] = None) -> RoleSubscription
    func GetRoleSubscription(ctx *Context, name string, id IDInput, state *RoleSubscriptionState, opts ...ResourceOption) (*RoleSubscription, error)
    public static RoleSubscription Get(string name, Input<string> id, RoleSubscriptionState? state, CustomResourceOptions? opts = null)
    public static RoleSubscription get(String name, Output<String> id, RoleSubscriptionState state, CustomResourceOptions options)
    resources:  _:    type: okta:RoleSubscription    get:      id: ${id}
    import {
      to = okta_role_subscription.example
      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.
    The following state arguments are supported:
    Channels List<string>
    An array of sources send notifications to users.
    NotificationType string
    Type of the notification
    RoleRef string
    A reference to an existing role
    Status string
    The status of the subscription
    Channels []string
    An array of sources send notifications to users.
    NotificationType string
    Type of the notification
    RoleRef string
    A reference to an existing role
    Status string
    The status of the subscription
    channels list(string)
    An array of sources send notifications to users.
    notification_type string
    Type of the notification
    role_ref string
    A reference to an existing role
    status string
    The status of the subscription
    channels List<String>
    An array of sources send notifications to users.
    notificationType String
    Type of the notification
    roleRef String
    A reference to an existing role
    status String
    The status of the subscription
    channels string[]
    An array of sources send notifications to users.
    notificationType string
    Type of the notification
    roleRef string
    A reference to an existing role
    status string
    The status of the subscription
    channels Sequence[str]
    An array of sources send notifications to users.
    notification_type str
    Type of the notification
    role_ref str
    A reference to an existing role
    status str
    The status of the subscription
    channels List<String>
    An array of sources send notifications to users.
    notificationType String
    Type of the notification
    roleRef String
    A reference to an existing role
    status String
    The status of the subscription

    Import

    $ pulumi import okta:index/roleSubscription:RoleSubscription example <role_ref>/<notification_type>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Okta pulumi/pulumi-okta
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the okta Terraform Provider.
    okta logo
    Viewing docs for Okta v7.0.1
    published on Tuesday, Oct 13, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial