1. Packages
  2. Okta
  3. API Docs
  4. app
  5. OauthRoleAssignment
Okta v4.8.1 published on Thursday, Apr 18, 2024 by Pulumi

okta.app.OauthRoleAssignment

Explore with Pulumi AI

okta logo
Okta v4.8.1 published on Thursday, Apr 18, 2024 by Pulumi

    Manages assignment of an admin role to an OAuth application.

    This resource allows you to assign an Okta admin role to a OAuth service application. This requires the Okta tenant feature flag for this function to be enabled.

    Example Usage

    Standard Role:

    import * as pulumi from "@pulumi/pulumi";
    import * as okta from "@pulumi/okta";
    
    const testOAuth = new okta.app.OAuth("testOAuth", {
        label: "test",
        type: "service",
        responseTypes: ["token"],
        grantTypes: ["client_credentials"],
        jwksUri: "https://example.com",
    });
    const testOauthRoleAssignment = new okta.app.OauthRoleAssignment("testOauthRoleAssignment", {
        clientId: testOAuth.clientId,
        type: "HELP_DESK_ADMIN",
    });
    
    import pulumi
    import pulumi_okta as okta
    
    test_o_auth = okta.app.OAuth("testOAuth",
        label="test",
        type="service",
        response_types=["token"],
        grant_types=["client_credentials"],
        jwks_uri="https://example.com")
    test_oauth_role_assignment = okta.app.OauthRoleAssignment("testOauthRoleAssignment",
        client_id=test_o_auth.client_id,
        type="HELP_DESK_ADMIN")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-okta/sdk/v4/go/okta/app"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		testOAuth, err := app.NewOAuth(ctx, "testOAuth", &app.OAuthArgs{
    			Label: pulumi.String("test"),
    			Type:  pulumi.String("service"),
    			ResponseTypes: pulumi.StringArray{
    				pulumi.String("token"),
    			},
    			GrantTypes: pulumi.StringArray{
    				pulumi.String("client_credentials"),
    			},
    			JwksUri: pulumi.String("https://example.com"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = app.NewOauthRoleAssignment(ctx, "testOauthRoleAssignment", &app.OauthRoleAssignmentArgs{
    			ClientId: testOAuth.ClientId,
    			Type:     pulumi.String("HELP_DESK_ADMIN"),
    		})
    		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 testOAuth = new Okta.App.OAuth("testOAuth", new()
        {
            Label = "test",
            Type = "service",
            ResponseTypes = new[]
            {
                "token",
            },
            GrantTypes = new[]
            {
                "client_credentials",
            },
            JwksUri = "https://example.com",
        });
    
        var testOauthRoleAssignment = new Okta.App.OauthRoleAssignment("testOauthRoleAssignment", new()
        {
            ClientId = testOAuth.ClientId,
            Type = "HELP_DESK_ADMIN",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.okta.app.OAuth;
    import com.pulumi.okta.app.OAuthArgs;
    import com.pulumi.okta.app.OauthRoleAssignment;
    import com.pulumi.okta.app.OauthRoleAssignmentArgs;
    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) {
            var testOAuth = new OAuth("testOAuth", OAuthArgs.builder()        
                .label("test")
                .type("service")
                .responseTypes("token")
                .grantTypes("client_credentials")
                .jwksUri("https://example.com")
                .build());
    
            var testOauthRoleAssignment = new OauthRoleAssignment("testOauthRoleAssignment", OauthRoleAssignmentArgs.builder()        
                .clientId(testOAuth.clientId())
                .type("HELP_DESK_ADMIN")
                .build());
    
        }
    }
    
    resources:
      testOAuth:
        type: okta:app:OAuth
        properties:
          label: test
          type: service
          responseTypes:
            - token
          grantTypes:
            - client_credentials
          jwksUri: https://example.com
      testOauthRoleAssignment:
        type: okta:app:OauthRoleAssignment
        properties:
          clientId: ${testOAuth.clientId}
          type: HELP_DESK_ADMIN
    

    Custom Role:

    Create OauthRoleAssignment Resource

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

    Constructor syntax

    new OauthRoleAssignment(name: string, args: OauthRoleAssignmentArgs, opts?: CustomResourceOptions);
    @overload
    def OauthRoleAssignment(resource_name: str,
                            args: OauthRoleAssignmentArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def OauthRoleAssignment(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            client_id: Optional[str] = None,
                            type: Optional[str] = None,
                            resource_set: Optional[str] = None,
                            role: Optional[str] = None)
    func NewOauthRoleAssignment(ctx *Context, name string, args OauthRoleAssignmentArgs, opts ...ResourceOption) (*OauthRoleAssignment, error)
    public OauthRoleAssignment(string name, OauthRoleAssignmentArgs args, CustomResourceOptions? opts = null)
    public OauthRoleAssignment(String name, OauthRoleAssignmentArgs args)
    public OauthRoleAssignment(String name, OauthRoleAssignmentArgs args, CustomResourceOptions options)
    
    type: okta:app:OauthRoleAssignment
    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 OauthRoleAssignmentArgs
    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 OauthRoleAssignmentArgs
    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 OauthRoleAssignmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args OauthRoleAssignmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args OauthRoleAssignmentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var oauthRoleAssignmentResource = new Okta.App.OauthRoleAssignment("oauthRoleAssignmentResource", new()
    {
        ClientId = "string",
        Type = "string",
        ResourceSet = "string",
        Role = "string",
    });
    
    example, err := app.NewOauthRoleAssignment(ctx, "oauthRoleAssignmentResource", &app.OauthRoleAssignmentArgs{
    	ClientId:    pulumi.String("string"),
    	Type:        pulumi.String("string"),
    	ResourceSet: pulumi.String("string"),
    	Role:        pulumi.String("string"),
    })
    
    var oauthRoleAssignmentResource = new OauthRoleAssignment("oauthRoleAssignmentResource", OauthRoleAssignmentArgs.builder()        
        .clientId("string")
        .type("string")
        .resourceSet("string")
        .role("string")
        .build());
    
    oauth_role_assignment_resource = okta.app.OauthRoleAssignment("oauthRoleAssignmentResource",
        client_id="string",
        type="string",
        resource_set="string",
        role="string")
    
    const oauthRoleAssignmentResource = new okta.app.OauthRoleAssignment("oauthRoleAssignmentResource", {
        clientId: "string",
        type: "string",
        resourceSet: "string",
        role: "string",
    });
    
    type: okta:app:OauthRoleAssignment
    properties:
        clientId: string
        resourceSet: string
        role: string
        type: string
    

    OauthRoleAssignment Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The OauthRoleAssignment resource accepts the following input properties:

    ClientId string
    Client ID for the role to be assigned to
    Type string
    Role type to assign. This can be one of the standard Okta roles, such as HELP_DESK_ADMIN, or CUSTOM. Using custom requires the resource_set and role attributes to be set.
    ResourceSet string
    Resource set for the custom role to assign, must be the ID of the created resource set.
    Role string
    Custom Role ID
    ClientId string
    Client ID for the role to be assigned to
    Type string
    Role type to assign. This can be one of the standard Okta roles, such as HELP_DESK_ADMIN, or CUSTOM. Using custom requires the resource_set and role attributes to be set.
    ResourceSet string
    Resource set for the custom role to assign, must be the ID of the created resource set.
    Role string
    Custom Role ID
    clientId String
    Client ID for the role to be assigned to
    type String
    Role type to assign. This can be one of the standard Okta roles, such as HELP_DESK_ADMIN, or CUSTOM. Using custom requires the resource_set and role attributes to be set.
    resourceSet String
    Resource set for the custom role to assign, must be the ID of the created resource set.
    role String
    Custom Role ID
    clientId string
    Client ID for the role to be assigned to
    type string
    Role type to assign. This can be one of the standard Okta roles, such as HELP_DESK_ADMIN, or CUSTOM. Using custom requires the resource_set and role attributes to be set.
    resourceSet string
    Resource set for the custom role to assign, must be the ID of the created resource set.
    role string
    Custom Role ID
    client_id str
    Client ID for the role to be assigned to
    type str
    Role type to assign. This can be one of the standard Okta roles, such as HELP_DESK_ADMIN, or CUSTOM. Using custom requires the resource_set and role attributes to be set.
    resource_set str
    Resource set for the custom role to assign, must be the ID of the created resource set.
    role str
    Custom Role ID
    clientId String
    Client ID for the role to be assigned to
    type String
    Role type to assign. This can be one of the standard Okta roles, such as HELP_DESK_ADMIN, or CUSTOM. Using custom requires the resource_set and role attributes to be set.
    resourceSet String
    Resource set for the custom role to assign, must be the ID of the created resource set.
    role String
    Custom Role ID

    Outputs

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

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

    Look up Existing OauthRoleAssignment Resource

    Get an existing OauthRoleAssignment 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?: OauthRoleAssignmentState, opts?: CustomResourceOptions): OauthRoleAssignment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            client_id: Optional[str] = None,
            label: Optional[str] = None,
            resource_set: Optional[str] = None,
            role: Optional[str] = None,
            status: Optional[str] = None,
            type: Optional[str] = None) -> OauthRoleAssignment
    func GetOauthRoleAssignment(ctx *Context, name string, id IDInput, state *OauthRoleAssignmentState, opts ...ResourceOption) (*OauthRoleAssignment, error)
    public static OauthRoleAssignment Get(string name, Input<string> id, OauthRoleAssignmentState? state, CustomResourceOptions? opts = null)
    public static OauthRoleAssignment get(String name, Output<String> id, OauthRoleAssignmentState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    ClientId string
    Client ID for the role to be assigned to
    Label string
    Label of the role assignment
    ResourceSet string
    Resource set for the custom role to assign, must be the ID of the created resource set.
    Role string
    Custom Role ID
    Status string
    Status of the role assignment
    Type string
    Role type to assign. This can be one of the standard Okta roles, such as HELP_DESK_ADMIN, or CUSTOM. Using custom requires the resource_set and role attributes to be set.
    ClientId string
    Client ID for the role to be assigned to
    Label string
    Label of the role assignment
    ResourceSet string
    Resource set for the custom role to assign, must be the ID of the created resource set.
    Role string
    Custom Role ID
    Status string
    Status of the role assignment
    Type string
    Role type to assign. This can be one of the standard Okta roles, such as HELP_DESK_ADMIN, or CUSTOM. Using custom requires the resource_set and role attributes to be set.
    clientId String
    Client ID for the role to be assigned to
    label String
    Label of the role assignment
    resourceSet String
    Resource set for the custom role to assign, must be the ID of the created resource set.
    role String
    Custom Role ID
    status String
    Status of the role assignment
    type String
    Role type to assign. This can be one of the standard Okta roles, such as HELP_DESK_ADMIN, or CUSTOM. Using custom requires the resource_set and role attributes to be set.
    clientId string
    Client ID for the role to be assigned to
    label string
    Label of the role assignment
    resourceSet string
    Resource set for the custom role to assign, must be the ID of the created resource set.
    role string
    Custom Role ID
    status string
    Status of the role assignment
    type string
    Role type to assign. This can be one of the standard Okta roles, such as HELP_DESK_ADMIN, or CUSTOM. Using custom requires the resource_set and role attributes to be set.
    client_id str
    Client ID for the role to be assigned to
    label str
    Label of the role assignment
    resource_set str
    Resource set for the custom role to assign, must be the ID of the created resource set.
    role str
    Custom Role ID
    status str
    Status of the role assignment
    type str
    Role type to assign. This can be one of the standard Okta roles, such as HELP_DESK_ADMIN, or CUSTOM. Using custom requires the resource_set and role attributes to be set.
    clientId String
    Client ID for the role to be assigned to
    label String
    Label of the role assignment
    resourceSet String
    Resource set for the custom role to assign, must be the ID of the created resource set.
    role String
    Custom Role ID
    status String
    Status of the role assignment
    type String
    Role type to assign. This can be one of the standard Okta roles, such as HELP_DESK_ADMIN, or CUSTOM. Using custom requires the resource_set and role attributes to be set.

    Import

    OAuth Role assignment can be imported by passing the Client ID and Role Assignment ID for the specific client role.

    $ pulumi import okta:app/oauthRoleAssignment:OauthRoleAssignment test <clientID>/<roleAssignmentID>`
    

    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
    Okta v4.8.1 published on Thursday, Apr 18, 2024 by Pulumi