Example Usage
Import and Manage Existing Token
import * as pulumi from "@pulumi/pulumi";
import * as okta from "@pulumi/okta";
// Import an existing refresh token
const example = new okta.app.Token("example", {
clientId: "0oardd5r32PWsF4421d7",
idProperty: "oar1godmqw4QUiX4C1d7",
});
import pulumi
import pulumi_okta as okta
# Import an existing refresh token
example = okta.app.Token("example",
client_id="0oardd5r32PWsF4421d7",
id_property="oar1godmqw4QUiX4C1d7")
package main
import (
"github.com/pulumi/pulumi-okta/sdk/v6/go/okta/app"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Import an existing refresh token
_, err := app.NewToken(ctx, "example", &app.TokenArgs{
ClientId: pulumi.String("0oardd5r32PWsF4421d7"),
IdProperty: pulumi.String("oar1godmqw4QUiX4C1d7"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Okta = Pulumi.Okta;
return await Deployment.RunAsync(() =>
{
// Import an existing refresh token
var example = new Okta.App.Token("example", new()
{
ClientId = "0oardd5r32PWsF4421d7",
IdProperty = "oar1godmqw4QUiX4C1d7",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.okta.app.Token;
import com.pulumi.okta.app.TokenArgs;
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) {
// Import an existing refresh token
var example = new Token("example", TokenArgs.builder()
.clientId("0oardd5r32PWsF4421d7")
.idProperty("oar1godmqw4QUiX4C1d7")
.build());
}
}
resources:
# Import an existing refresh token
example:
type: okta:app:Token
properties:
clientId: 0oardd5r32PWsF4421d7
idProperty: oar1godmqw4QUiX4C1d7
Create Token Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Token(name: string, args: TokenArgs, opts?: CustomResourceOptions);@overload
def Token(resource_name: str,
args: TokenArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Token(resource_name: str,
opts: Optional[ResourceOptions] = None,
client_id: Optional[str] = None,
id_property: Optional[str] = None)func NewToken(ctx *Context, name string, args TokenArgs, opts ...ResourceOption) (*Token, error)public Token(string name, TokenArgs args, CustomResourceOptions? opts = null)type: okta:app:Token
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 TokenArgs
- 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 TokenArgs
- 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 TokenArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TokenArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TokenArgs
- 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 tokenResource = new Okta.App.Token("tokenResource", new()
{
ClientId = "string",
IdProperty = "string",
});
example, err := app.NewToken(ctx, "tokenResource", &app.TokenArgs{
ClientId: pulumi.String("string"),
IdProperty: pulumi.String("string"),
})
var tokenResource = new Token("tokenResource", TokenArgs.builder()
.clientId("string")
.idProperty("string")
.build());
token_resource = okta.app.Token("tokenResource",
client_id="string",
id_property="string")
const tokenResource = new okta.app.Token("tokenResource", {
clientId: "string",
idProperty: "string",
});
type: okta:app:Token
properties:
clientId: string
idProperty: string
Token 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 Token resource accepts the following input properties:
- Client
Id string - The unique Okta ID of the application associated with this token. This is typically the
client_idof an refresh application. - Id
Property string - The unique Okta ID of the refresh token.
- Client
Id string - The unique Okta ID of the application associated with this token. This is typically the
client_idof an refresh application. - Id
Property string - The unique Okta ID of the refresh token.
- client
Id String - The unique Okta ID of the application associated with this token. This is typically the
client_idof an refresh application. - id
Property String - The unique Okta ID of the refresh token.
- client
Id string - The unique Okta ID of the application associated with this token. This is typically the
client_idof an refresh application. - id
Property string - The unique Okta ID of the refresh token.
- client_
id str - The unique Okta ID of the application associated with this token. This is typically the
client_idof an refresh application. - id_
property str - The unique Okta ID of the refresh token.
- client
Id String - The unique Okta ID of the application associated with this token. This is typically the
client_idof an refresh application. - id
Property String - The unique Okta ID of the refresh token.
Outputs
All input properties are implicitly available as output properties. Additionally, the Token resource produces the following output properties:
Look up Existing Token Resource
Get an existing Token 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?: TokenState, opts?: CustomResourceOptions): Token@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
client_id: Optional[str] = None,
id_property: Optional[str] = None,
status: Optional[str] = None,
user_id: Optional[str] = None) -> Tokenfunc GetToken(ctx *Context, name string, id IDInput, state *TokenState, opts ...ResourceOption) (*Token, error)public static Token Get(string name, Input<string> id, TokenState? state, CustomResourceOptions? opts = null)public static Token get(String name, Output<String> id, TokenState state, CustomResourceOptions options)resources: _: type: okta:app:Token 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.
- Client
Id string - The unique Okta ID of the application associated with this token. This is typically the
client_idof an refresh application. - Id
Property string - The unique Okta ID of the refresh token.
- Status string
- The current status of the token (e.g.,
ACTIVE,REVOKED). - User
Id string - The unique Okta ID of the user associated with this token.
- Client
Id string - The unique Okta ID of the application associated with this token. This is typically the
client_idof an refresh application. - Id
Property string - The unique Okta ID of the refresh token.
- Status string
- The current status of the token (e.g.,
ACTIVE,REVOKED). - User
Id string - The unique Okta ID of the user associated with this token.
- client
Id String - The unique Okta ID of the application associated with this token. This is typically the
client_idof an refresh application. - id
Property String - The unique Okta ID of the refresh token.
- status String
- The current status of the token (e.g.,
ACTIVE,REVOKED). - user
Id String - The unique Okta ID of the user associated with this token.
- client
Id string - The unique Okta ID of the application associated with this token. This is typically the
client_idof an refresh application. - id
Property string - The unique Okta ID of the refresh token.
- status string
- The current status of the token (e.g.,
ACTIVE,REVOKED). - user
Id string - The unique Okta ID of the user associated with this token.
- client_
id str - The unique Okta ID of the application associated with this token. This is typically the
client_idof an refresh application. - id_
property str - The unique Okta ID of the refresh token.
- status str
- The current status of the token (e.g.,
ACTIVE,REVOKED). - user_
id str - The unique Okta ID of the user associated with this token.
- client
Id String - The unique Okta ID of the application associated with this token. This is typically the
client_idof an refresh application. - id
Property String - The unique Okta ID of the refresh token.
- status String
- The current status of the token (e.g.,
ACTIVE,REVOKED). - user
Id String - The unique Okta ID of the user associated with this token.
Import
Refresh tokens can be imported using the format {client_id}/{token_id}:
bash
$ pulumi import okta:app/token:Token example 0oardd5r32PWsF4421d7/oar1godmqw4QUiX4C1d7
Where:
0oardd5r32PWsF4421d7is the application’s client_idoar1godmqw4QUiX4C1d7is the Refresh token ID
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
oktaTerraform Provider.
