1. Packages
  2. Okta Provider
  3. API Docs
  4. LinkValue
Okta v4.11.3 published on Monday, Oct 21, 2024 by Pulumi

okta.LinkValue

Explore with Pulumi AI

okta logo
Okta v4.11.3 published on Monday, Oct 21, 2024 by Pulumi

    Manages users relationships. Link value operations allow you to create relationships between primary and associated users.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as okta from "@pulumi/okta";
    
    const padishah = new okta.LinkDefinition("padishah", {
        primaryName: "emperor",
        primaryTitle: "Emperor",
        primaryDescription: "Hereditary ruler of the Imperium and the Known Universe",
        associatedName: "sardaukar",
        associatedTitle: "Sardaukar",
        associatedDescription: "Elite military force member",
    });
    const emperor = new okta.user.User("emperor", {
        firstName: "Shaddam",
        lastName: "Corrino IV",
        login: "shaddam.corrino.iv@salusa-secundus.planet",
        email: "shaddam.corrino.iv@salusa-secundus.planet",
    });
    const sardaukars: okta.user.User[] = [];
    for (const range = {value: 0}; range.value < 5; range.value++) {
        sardaukars.push(new okta.user.User(`sardaukars-${range.value}`, {
            firstName: "Amrit",
            lastName: `Sardaukar_${range.value}`,
            login: `amritsardaukar_${range.value}@salusa-secundus.planet`,
            email: `amritsardaukar_${range.value}@salusa-secundus.planet`,
        }));
    }
    const example = new okta.LinkValue("example", {
        primaryName: padishah.primaryName,
        primaryUserId: emperor.id,
        associatedUserIds: [
            sardaukars[0].id,
            sardaukars[1].id,
            sardaukars[2].id,
            sardaukars[3].id,
            sardaukars[4].id,
        ],
    });
    
    import pulumi
    import pulumi_okta as okta
    
    padishah = okta.LinkDefinition("padishah",
        primary_name="emperor",
        primary_title="Emperor",
        primary_description="Hereditary ruler of the Imperium and the Known Universe",
        associated_name="sardaukar",
        associated_title="Sardaukar",
        associated_description="Elite military force member")
    emperor = okta.user.User("emperor",
        first_name="Shaddam",
        last_name="Corrino IV",
        login="shaddam.corrino.iv@salusa-secundus.planet",
        email="shaddam.corrino.iv@salusa-secundus.planet")
    sardaukars = []
    for range in [{"value": i} for i in range(0, 5)]:
        sardaukars.append(okta.user.User(f"sardaukars-{range['value']}",
            first_name="Amrit",
            last_name=f"Sardaukar_{range['value']}",
            login=f"amritsardaukar_{range['value']}@salusa-secundus.planet",
            email=f"amritsardaukar_{range['value']}@salusa-secundus.planet"))
    example = okta.LinkValue("example",
        primary_name=padishah.primary_name,
        primary_user_id=emperor.id,
        associated_user_ids=[
            sardaukars[0].id,
            sardaukars[1].id,
            sardaukars[2].id,
            sardaukars[3].id,
            sardaukars[4].id,
        ])
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-okta/sdk/v4/go/okta"
    	"github.com/pulumi/pulumi-okta/sdk/v4/go/okta/user"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		padishah, err := okta.NewLinkDefinition(ctx, "padishah", &okta.LinkDefinitionArgs{
    			PrimaryName:           pulumi.String("emperor"),
    			PrimaryTitle:          pulumi.String("Emperor"),
    			PrimaryDescription:    pulumi.String("Hereditary ruler of the Imperium and the Known Universe"),
    			AssociatedName:        pulumi.String("sardaukar"),
    			AssociatedTitle:       pulumi.String("Sardaukar"),
    			AssociatedDescription: pulumi.String("Elite military force member"),
    		})
    		if err != nil {
    			return err
    		}
    		emperor, err := user.NewUser(ctx, "emperor", &user.UserArgs{
    			FirstName: pulumi.String("Shaddam"),
    			LastName:  pulumi.String("Corrino IV"),
    			Login:     pulumi.String("shaddam.corrino.iv@salusa-secundus.planet"),
    			Email:     pulumi.String("shaddam.corrino.iv@salusa-secundus.planet"),
    		})
    		if err != nil {
    			return err
    		}
    		var sardaukars []*user.User
    		for index := 0; index < 5; index++ {
    			key0 := index
    			val0 := index
    			__res, err := user.NewUser(ctx, fmt.Sprintf("sardaukars-%v", key0), &user.UserArgs{
    				FirstName: pulumi.String("Amrit"),
    				LastName:  pulumi.Sprintf("Sardaukar_%v", val0),
    				Login:     pulumi.Sprintf("amritsardaukar_%v@salusa-secundus.planet", val0),
    				Email:     pulumi.Sprintf("amritsardaukar_%v@salusa-secundus.planet", val0),
    			})
    			if err != nil {
    				return err
    			}
    			sardaukars = append(sardaukars, __res)
    		}
    		_, err = okta.NewLinkValue(ctx, "example", &okta.LinkValueArgs{
    			PrimaryName:   padishah.PrimaryName,
    			PrimaryUserId: emperor.ID(),
    			AssociatedUserIds: pulumi.StringArray{
    				sardaukars[0].ID(),
    				sardaukars[1].ID(),
    				sardaukars[2].ID(),
    				sardaukars[3].ID(),
    				sardaukars[4].ID(),
    			},
    		})
    		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 padishah = new Okta.LinkDefinition("padishah", new()
        {
            PrimaryName = "emperor",
            PrimaryTitle = "Emperor",
            PrimaryDescription = "Hereditary ruler of the Imperium and the Known Universe",
            AssociatedName = "sardaukar",
            AssociatedTitle = "Sardaukar",
            AssociatedDescription = "Elite military force member",
        });
    
        var emperor = new Okta.User.User("emperor", new()
        {
            FirstName = "Shaddam",
            LastName = "Corrino IV",
            Login = "shaddam.corrino.iv@salusa-secundus.planet",
            Email = "shaddam.corrino.iv@salusa-secundus.planet",
        });
    
        var sardaukars = new List<Okta.User.User>();
        for (var rangeIndex = 0; rangeIndex < 5; rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            sardaukars.Add(new Okta.User.User($"sardaukars-{range.Value}", new()
            {
                FirstName = "Amrit",
                LastName = $"Sardaukar_{range.Value}",
                Login = $"amritsardaukar_{range.Value}@salusa-secundus.planet",
                Email = $"amritsardaukar_{range.Value}@salusa-secundus.planet",
            }));
        }
        var example = new Okta.LinkValue("example", new()
        {
            PrimaryName = padishah.PrimaryName,
            PrimaryUserId = emperor.Id,
            AssociatedUserIds = new[]
            {
                sardaukars[0].Id,
                sardaukars[1].Id,
                sardaukars[2].Id,
                sardaukars[3].Id,
                sardaukars[4].Id,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.okta.LinkDefinition;
    import com.pulumi.okta.LinkDefinitionArgs;
    import com.pulumi.okta.user.User;
    import com.pulumi.okta.user.UserArgs;
    import com.pulumi.okta.LinkValue;
    import com.pulumi.okta.LinkValueArgs;
    import com.pulumi.codegen.internal.KeyedValue;
    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 padishah = new LinkDefinition("padishah", LinkDefinitionArgs.builder()
                .primaryName("emperor")
                .primaryTitle("Emperor")
                .primaryDescription("Hereditary ruler of the Imperium and the Known Universe")
                .associatedName("sardaukar")
                .associatedTitle("Sardaukar")
                .associatedDescription("Elite military force member")
                .build());
    
            var emperor = new User("emperor", UserArgs.builder()
                .firstName("Shaddam")
                .lastName("Corrino IV")
                .login("shaddam.corrino.iv@salusa-secundus.planet")
                .email("shaddam.corrino.iv@salusa-secundus.planet")
                .build());
    
            for (var i = 0; i < 5; i++) {
                new User("sardaukars-" + i, UserArgs.builder()
                    .firstName("Amrit")
                    .lastName(String.format("Sardaukar_%s", range.value()))
                    .login(String.format("amritsardaukar_%s@salusa-secundus.planet", range.value()))
                    .email(String.format("amritsardaukar_%s@salusa-secundus.planet", range.value()))
                    .build());
    
            
    }
            var example = new LinkValue("example", LinkValueArgs.builder()
                .primaryName(padishah.primaryName())
                .primaryUserId(emperor.id())
                .associatedUserIds(            
                    sardaukars[0].id(),
                    sardaukars[1].id(),
                    sardaukars[2].id(),
                    sardaukars[3].id(),
                    sardaukars[4].id())
                .build());
    
        }
    }
    
    resources:
      padishah:
        type: okta:LinkDefinition
        properties:
          primaryName: emperor
          primaryTitle: Emperor
          primaryDescription: Hereditary ruler of the Imperium and the Known Universe
          associatedName: sardaukar
          associatedTitle: Sardaukar
          associatedDescription: Elite military force member
      emperor:
        type: okta:user:User
        properties:
          firstName: Shaddam
          lastName: Corrino IV
          login: shaddam.corrino.iv@salusa-secundus.planet
          email: shaddam.corrino.iv@salusa-secundus.planet
      sardaukars:
        type: okta:user:User
        properties:
          firstName: Amrit
          lastName: Sardaukar_${range.value}
          login: amritsardaukar_${range.value}@salusa-secundus.planet
          email: amritsardaukar_${range.value}@salusa-secundus.planet
        options: {}
      example:
        type: okta:LinkValue
        properties:
          primaryName: ${padishah.primaryName}
          primaryUserId: ${emperor.id}
          associatedUserIds:
            - ${sardaukars[0].id}
            - ${sardaukars[1].id}
            - ${sardaukars[2].id}
            - ${sardaukars[3].id}
            - ${sardaukars[4].id}
    

    Create LinkValue Resource

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

    Constructor syntax

    new LinkValue(name: string, args: LinkValueArgs, opts?: CustomResourceOptions);
    @overload
    def LinkValue(resource_name: str,
                  args: LinkValueArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def LinkValue(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  primary_name: Optional[str] = None,
                  primary_user_id: Optional[str] = None,
                  associated_user_ids: Optional[Sequence[str]] = None)
    func NewLinkValue(ctx *Context, name string, args LinkValueArgs, opts ...ResourceOption) (*LinkValue, error)
    public LinkValue(string name, LinkValueArgs args, CustomResourceOptions? opts = null)
    public LinkValue(String name, LinkValueArgs args)
    public LinkValue(String name, LinkValueArgs args, CustomResourceOptions options)
    
    type: okta:LinkValue
    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 LinkValueArgs
    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 LinkValueArgs
    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 LinkValueArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LinkValueArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LinkValueArgs
    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 linkValueResource = new Okta.LinkValue("linkValueResource", new()
    {
        PrimaryName = "string",
        PrimaryUserId = "string",
        AssociatedUserIds = new[]
        {
            "string",
        },
    });
    
    example, err := okta.NewLinkValue(ctx, "linkValueResource", &okta.LinkValueArgs{
    	PrimaryName:   pulumi.String("string"),
    	PrimaryUserId: pulumi.String("string"),
    	AssociatedUserIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var linkValueResource = new LinkValue("linkValueResource", LinkValueArgs.builder()
        .primaryName("string")
        .primaryUserId("string")
        .associatedUserIds("string")
        .build());
    
    link_value_resource = okta.LinkValue("linkValueResource",
        primary_name="string",
        primary_user_id="string",
        associated_user_ids=["string"])
    
    const linkValueResource = new okta.LinkValue("linkValueResource", {
        primaryName: "string",
        primaryUserId: "string",
        associatedUserIds: ["string"],
    });
    
    type: okta:LinkValue
    properties:
        associatedUserIds:
            - string
        primaryName: string
        primaryUserId: string
    

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

    PrimaryName string
    Name of the primary relationship being assigned.
    PrimaryUserId string
    User ID to be assigned to primary for the 'associated' user in the specified relationship.
    AssociatedUserIds List<string>
    Set of User IDs or login values of the users to be assigned the associated relationship.
    PrimaryName string
    Name of the primary relationship being assigned.
    PrimaryUserId string
    User ID to be assigned to primary for the 'associated' user in the specified relationship.
    AssociatedUserIds []string
    Set of User IDs or login values of the users to be assigned the associated relationship.
    primaryName String
    Name of the primary relationship being assigned.
    primaryUserId String
    User ID to be assigned to primary for the 'associated' user in the specified relationship.
    associatedUserIds List<String>
    Set of User IDs or login values of the users to be assigned the associated relationship.
    primaryName string
    Name of the primary relationship being assigned.
    primaryUserId string
    User ID to be assigned to primary for the 'associated' user in the specified relationship.
    associatedUserIds string[]
    Set of User IDs or login values of the users to be assigned the associated relationship.
    primary_name str
    Name of the primary relationship being assigned.
    primary_user_id str
    User ID to be assigned to primary for the 'associated' user in the specified relationship.
    associated_user_ids Sequence[str]
    Set of User IDs or login values of the users to be assigned the associated relationship.
    primaryName String
    Name of the primary relationship being assigned.
    primaryUserId String
    User ID to be assigned to primary for the 'associated' user in the specified relationship.
    associatedUserIds List<String>
    Set of User IDs or login values of the users to be assigned the associated relationship.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the LinkValue 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 LinkValue Resource

    Get an existing LinkValue 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?: LinkValueState, opts?: CustomResourceOptions): LinkValue
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            associated_user_ids: Optional[Sequence[str]] = None,
            primary_name: Optional[str] = None,
            primary_user_id: Optional[str] = None) -> LinkValue
    func GetLinkValue(ctx *Context, name string, id IDInput, state *LinkValueState, opts ...ResourceOption) (*LinkValue, error)
    public static LinkValue Get(string name, Input<string> id, LinkValueState? state, CustomResourceOptions? opts = null)
    public static LinkValue get(String name, Output<String> id, LinkValueState 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:
    AssociatedUserIds List<string>
    Set of User IDs or login values of the users to be assigned the associated relationship.
    PrimaryName string
    Name of the primary relationship being assigned.
    PrimaryUserId string
    User ID to be assigned to primary for the 'associated' user in the specified relationship.
    AssociatedUserIds []string
    Set of User IDs or login values of the users to be assigned the associated relationship.
    PrimaryName string
    Name of the primary relationship being assigned.
    PrimaryUserId string
    User ID to be assigned to primary for the 'associated' user in the specified relationship.
    associatedUserIds List<String>
    Set of User IDs or login values of the users to be assigned the associated relationship.
    primaryName String
    Name of the primary relationship being assigned.
    primaryUserId String
    User ID to be assigned to primary for the 'associated' user in the specified relationship.
    associatedUserIds string[]
    Set of User IDs or login values of the users to be assigned the associated relationship.
    primaryName string
    Name of the primary relationship being assigned.
    primaryUserId string
    User ID to be assigned to primary for the 'associated' user in the specified relationship.
    associated_user_ids Sequence[str]
    Set of User IDs or login values of the users to be assigned the associated relationship.
    primary_name str
    Name of the primary relationship being assigned.
    primary_user_id str
    User ID to be assigned to primary for the 'associated' user in the specified relationship.
    associatedUserIds List<String>
    Set of User IDs or login values of the users to be assigned the associated relationship.
    primaryName String
    Name of the primary relationship being assigned.
    primaryUserId String
    User ID to be assigned to primary for the 'associated' user in the specified relationship.

    Import

    $ pulumi import okta:index/linkValue:LinkValue example <primary_name>/<primary_user_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 okta Terraform Provider.
    okta logo
    Okta v4.11.3 published on Monday, Oct 21, 2024 by Pulumi