1. Packages
  2. Opsgenie
  3. API Docs
  4. User
Opsgenie v1.3.8 published on Monday, Jun 24, 2024 by Pulumi

opsgenie.User

Explore with Pulumi AI

opsgenie logo
Opsgenie v1.3.8 published on Monday, Jun 24, 2024 by Pulumi

    Manages a User within Opsgenie.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as opsgenie from "@pulumi/opsgenie";
    
    const test = new opsgenie.User("test", {
        username: "user@domain.com",
        fullName: "Test User",
        role: "User",
        locale: "en_US",
        timezone: "America/New_York",
        tags: [
            "sre",
            "opsgenie",
        ],
        skypeUsername: "skypename",
        userAddresses: [{
            country: "Country",
            state: "State",
            city: "City",
            line: "Line",
            zipcode: "998877",
        }],
        userDetails: {
            key1: "val1,val2",
            key2: "val3,val4",
        },
    });
    
    import pulumi
    import pulumi_opsgenie as opsgenie
    
    test = opsgenie.User("test",
        username="user@domain.com",
        full_name="Test User",
        role="User",
        locale="en_US",
        timezone="America/New_York",
        tags=[
            "sre",
            "opsgenie",
        ],
        skype_username="skypename",
        user_addresses=[opsgenie.UserUserAddressArgs(
            country="Country",
            state="State",
            city="City",
            line="Line",
            zipcode="998877",
        )],
        user_details={
            "key1": "val1,val2",
            "key2": "val3,val4",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-opsgenie/sdk/go/opsgenie"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := opsgenie.NewUser(ctx, "test", &opsgenie.UserArgs{
    			Username: pulumi.String("user@domain.com"),
    			FullName: pulumi.String("Test User"),
    			Role:     pulumi.String("User"),
    			Locale:   pulumi.String("en_US"),
    			Timezone: pulumi.String("America/New_York"),
    			Tags: pulumi.StringArray{
    				pulumi.String("sre"),
    				pulumi.String("opsgenie"),
    			},
    			SkypeUsername: pulumi.String("skypename"),
    			UserAddresses: opsgenie.UserUserAddressArray{
    				&opsgenie.UserUserAddressArgs{
    					Country: pulumi.String("Country"),
    					State:   pulumi.String("State"),
    					City:    pulumi.String("City"),
    					Line:    pulumi.String("Line"),
    					Zipcode: pulumi.String("998877"),
    				},
    			},
    			UserDetails: pulumi.StringMap{
    				"key1": pulumi.String("val1,val2"),
    				"key2": pulumi.String("val3,val4"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Opsgenie = Pulumi.Opsgenie;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Opsgenie.User("test", new()
        {
            Username = "user@domain.com",
            FullName = "Test User",
            Role = "User",
            Locale = "en_US",
            Timezone = "America/New_York",
            Tags = new[]
            {
                "sre",
                "opsgenie",
            },
            SkypeUsername = "skypename",
            UserAddresses = new[]
            {
                new Opsgenie.Inputs.UserUserAddressArgs
                {
                    Country = "Country",
                    State = "State",
                    City = "City",
                    Line = "Line",
                    Zipcode = "998877",
                },
            },
            UserDetails = 
            {
                { "key1", "val1,val2" },
                { "key2", "val3,val4" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.opsgenie.User;
    import com.pulumi.opsgenie.UserArgs;
    import com.pulumi.opsgenie.inputs.UserUserAddressArgs;
    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 test = new User("test", UserArgs.builder()
                .username("user@domain.com")
                .fullName("Test User")
                .role("User")
                .locale("en_US")
                .timezone("America/New_York")
                .tags(            
                    "sre",
                    "opsgenie")
                .skypeUsername("skypename")
                .userAddresses(UserUserAddressArgs.builder()
                    .country("Country")
                    .state("State")
                    .city("City")
                    .line("Line")
                    .zipcode("998877")
                    .build())
                .userDetails(Map.ofEntries(
                    Map.entry("key1", "val1,val2"),
                    Map.entry("key2", "val3,val4")
                ))
                .build());
    
        }
    }
    
    resources:
      test:
        type: opsgenie:User
        properties:
          username: user@domain.com
          fullName: Test User
          role: User
          locale: en_US
          timezone: America/New_York
          tags:
            - sre
            - opsgenie
          skypeUsername: skypename
          userAddresses:
            - country: Country
              state: State
              city: City
              line: Line
              zipcode: '998877'
          userDetails:
            key1: val1,val2
            key2: val3,val4
    

    Create User Resource

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

    Constructor syntax

    new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
    @overload
    def User(resource_name: str,
             args: UserArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def User(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             full_name: Optional[str] = None,
             role: Optional[str] = None,
             username: Optional[str] = None,
             locale: Optional[str] = None,
             skype_username: Optional[str] = None,
             tags: Optional[Sequence[str]] = None,
             timezone: Optional[str] = None,
             user_addresses: Optional[Sequence[UserUserAddressArgs]] = None,
             user_details: Optional[Mapping[str, str]] = None)
    func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
    public User(string name, UserArgs args, CustomResourceOptions? opts = null)
    public User(String name, UserArgs args)
    public User(String name, UserArgs args, CustomResourceOptions options)
    
    type: opsgenie:User
    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 UserArgs
    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 UserArgs
    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 UserArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserArgs
    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 userResource = new Opsgenie.User("userResource", new()
    {
        FullName = "string",
        Role = "string",
        Username = "string",
        Locale = "string",
        SkypeUsername = "string",
        Tags = new[]
        {
            "string",
        },
        Timezone = "string",
        UserAddresses = new[]
        {
            new Opsgenie.Inputs.UserUserAddressArgs
            {
                City = "string",
                Country = "string",
                Line = "string",
                State = "string",
                Zipcode = "string",
            },
        },
        UserDetails = 
        {
            { "string", "string" },
        },
    });
    
    example, err := opsgenie.NewUser(ctx, "userResource", &opsgenie.UserArgs{
    	FullName:      pulumi.String("string"),
    	Role:          pulumi.String("string"),
    	Username:      pulumi.String("string"),
    	Locale:        pulumi.String("string"),
    	SkypeUsername: pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Timezone: pulumi.String("string"),
    	UserAddresses: opsgenie.UserUserAddressArray{
    		&opsgenie.UserUserAddressArgs{
    			City:    pulumi.String("string"),
    			Country: pulumi.String("string"),
    			Line:    pulumi.String("string"),
    			State:   pulumi.String("string"),
    			Zipcode: pulumi.String("string"),
    		},
    	},
    	UserDetails: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var userResource = new User("userResource", UserArgs.builder()
        .fullName("string")
        .role("string")
        .username("string")
        .locale("string")
        .skypeUsername("string")
        .tags("string")
        .timezone("string")
        .userAddresses(UserUserAddressArgs.builder()
            .city("string")
            .country("string")
            .line("string")
            .state("string")
            .zipcode("string")
            .build())
        .userDetails(Map.of("string", "string"))
        .build());
    
    user_resource = opsgenie.User("userResource",
        full_name="string",
        role="string",
        username="string",
        locale="string",
        skype_username="string",
        tags=["string"],
        timezone="string",
        user_addresses=[opsgenie.UserUserAddressArgs(
            city="string",
            country="string",
            line="string",
            state="string",
            zipcode="string",
        )],
        user_details={
            "string": "string",
        })
    
    const userResource = new opsgenie.User("userResource", {
        fullName: "string",
        role: "string",
        username: "string",
        locale: "string",
        skypeUsername: "string",
        tags: ["string"],
        timezone: "string",
        userAddresses: [{
            city: "string",
            country: "string",
            line: "string",
            state: "string",
            zipcode: "string",
        }],
        userDetails: {
            string: "string",
        },
    });
    
    type: opsgenie:User
    properties:
        fullName: string
        locale: string
        role: string
        skypeUsername: string
        tags:
            - string
        timezone: string
        userAddresses:
            - city: string
              country: string
              line: string
              state: string
              zipcode: string
        userDetails:
            string: string
        username: string
    

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

    FullName string
    The Full Name of the User.
    Role string
    The Role assigned to the User. Either a built-in such as 'Admin' or 'User' - or the name of a custom role.
    Username string
    The email address associated with this user. Opsgenie defines that this must not be longer than 100 characters and must contain lowercase characters only.
    Locale string
    Location information for the user. Please look at Supported Locale Ids for available locales.
    SkypeUsername string
    Skype username of the user.
    Tags List<string>
    A list of tags to be associated with the user.
    Timezone string
    Timezone information of the user. Please look at Supported Timezone Ids for available timezones.
    UserAddresses List<UserUserAddress>
    Address of the user.
    UserDetails Dictionary<string, string>
    Details about the user in form of key and list. of values.
    FullName string
    The Full Name of the User.
    Role string
    The Role assigned to the User. Either a built-in such as 'Admin' or 'User' - or the name of a custom role.
    Username string
    The email address associated with this user. Opsgenie defines that this must not be longer than 100 characters and must contain lowercase characters only.
    Locale string
    Location information for the user. Please look at Supported Locale Ids for available locales.
    SkypeUsername string
    Skype username of the user.
    Tags []string
    A list of tags to be associated with the user.
    Timezone string
    Timezone information of the user. Please look at Supported Timezone Ids for available timezones.
    UserAddresses []UserUserAddressArgs
    Address of the user.
    UserDetails map[string]string
    Details about the user in form of key and list. of values.
    fullName String
    The Full Name of the User.
    role String
    The Role assigned to the User. Either a built-in such as 'Admin' or 'User' - or the name of a custom role.
    username String
    The email address associated with this user. Opsgenie defines that this must not be longer than 100 characters and must contain lowercase characters only.
    locale String
    Location information for the user. Please look at Supported Locale Ids for available locales.
    skypeUsername String
    Skype username of the user.
    tags List<String>
    A list of tags to be associated with the user.
    timezone String
    Timezone information of the user. Please look at Supported Timezone Ids for available timezones.
    userAddresses List<UserUserAddress>
    Address of the user.
    userDetails Map<String,String>
    Details about the user in form of key and list. of values.
    fullName string
    The Full Name of the User.
    role string
    The Role assigned to the User. Either a built-in such as 'Admin' or 'User' - or the name of a custom role.
    username string
    The email address associated with this user. Opsgenie defines that this must not be longer than 100 characters and must contain lowercase characters only.
    locale string
    Location information for the user. Please look at Supported Locale Ids for available locales.
    skypeUsername string
    Skype username of the user.
    tags string[]
    A list of tags to be associated with the user.
    timezone string
    Timezone information of the user. Please look at Supported Timezone Ids for available timezones.
    userAddresses UserUserAddress[]
    Address of the user.
    userDetails {[key: string]: string}
    Details about the user in form of key and list. of values.
    full_name str
    The Full Name of the User.
    role str
    The Role assigned to the User. Either a built-in such as 'Admin' or 'User' - or the name of a custom role.
    username str
    The email address associated with this user. Opsgenie defines that this must not be longer than 100 characters and must contain lowercase characters only.
    locale str
    Location information for the user. Please look at Supported Locale Ids for available locales.
    skype_username str
    Skype username of the user.
    tags Sequence[str]
    A list of tags to be associated with the user.
    timezone str
    Timezone information of the user. Please look at Supported Timezone Ids for available timezones.
    user_addresses Sequence[UserUserAddressArgs]
    Address of the user.
    user_details Mapping[str, str]
    Details about the user in form of key and list. of values.
    fullName String
    The Full Name of the User.
    role String
    The Role assigned to the User. Either a built-in such as 'Admin' or 'User' - or the name of a custom role.
    username String
    The email address associated with this user. Opsgenie defines that this must not be longer than 100 characters and must contain lowercase characters only.
    locale String
    Location information for the user. Please look at Supported Locale Ids for available locales.
    skypeUsername String
    Skype username of the user.
    tags List<String>
    A list of tags to be associated with the user.
    timezone String
    Timezone information of the user. Please look at Supported Timezone Ids for available timezones.
    userAddresses List<Property Map>
    Address of the user.
    userDetails Map<String>
    Details about the user in form of key and list. of values.

    Outputs

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

    Get an existing User 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?: UserState, opts?: CustomResourceOptions): User
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            full_name: Optional[str] = None,
            locale: Optional[str] = None,
            role: Optional[str] = None,
            skype_username: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            timezone: Optional[str] = None,
            user_addresses: Optional[Sequence[UserUserAddressArgs]] = None,
            user_details: Optional[Mapping[str, str]] = None,
            username: Optional[str] = None) -> User
    func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
    public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
    public static User get(String name, Output<String> id, UserState 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:
    FullName string
    The Full Name of the User.
    Locale string
    Location information for the user. Please look at Supported Locale Ids for available locales.
    Role string
    The Role assigned to the User. Either a built-in such as 'Admin' or 'User' - or the name of a custom role.
    SkypeUsername string
    Skype username of the user.
    Tags List<string>
    A list of tags to be associated with the user.
    Timezone string
    Timezone information of the user. Please look at Supported Timezone Ids for available timezones.
    UserAddresses List<UserUserAddress>
    Address of the user.
    UserDetails Dictionary<string, string>
    Details about the user in form of key and list. of values.
    Username string
    The email address associated with this user. Opsgenie defines that this must not be longer than 100 characters and must contain lowercase characters only.
    FullName string
    The Full Name of the User.
    Locale string
    Location information for the user. Please look at Supported Locale Ids for available locales.
    Role string
    The Role assigned to the User. Either a built-in such as 'Admin' or 'User' - or the name of a custom role.
    SkypeUsername string
    Skype username of the user.
    Tags []string
    A list of tags to be associated with the user.
    Timezone string
    Timezone information of the user. Please look at Supported Timezone Ids for available timezones.
    UserAddresses []UserUserAddressArgs
    Address of the user.
    UserDetails map[string]string
    Details about the user in form of key and list. of values.
    Username string
    The email address associated with this user. Opsgenie defines that this must not be longer than 100 characters and must contain lowercase characters only.
    fullName String
    The Full Name of the User.
    locale String
    Location information for the user. Please look at Supported Locale Ids for available locales.
    role String
    The Role assigned to the User. Either a built-in such as 'Admin' or 'User' - or the name of a custom role.
    skypeUsername String
    Skype username of the user.
    tags List<String>
    A list of tags to be associated with the user.
    timezone String
    Timezone information of the user. Please look at Supported Timezone Ids for available timezones.
    userAddresses List<UserUserAddress>
    Address of the user.
    userDetails Map<String,String>
    Details about the user in form of key and list. of values.
    username String
    The email address associated with this user. Opsgenie defines that this must not be longer than 100 characters and must contain lowercase characters only.
    fullName string
    The Full Name of the User.
    locale string
    Location information for the user. Please look at Supported Locale Ids for available locales.
    role string
    The Role assigned to the User. Either a built-in such as 'Admin' or 'User' - or the name of a custom role.
    skypeUsername string
    Skype username of the user.
    tags string[]
    A list of tags to be associated with the user.
    timezone string
    Timezone information of the user. Please look at Supported Timezone Ids for available timezones.
    userAddresses UserUserAddress[]
    Address of the user.
    userDetails {[key: string]: string}
    Details about the user in form of key and list. of values.
    username string
    The email address associated with this user. Opsgenie defines that this must not be longer than 100 characters and must contain lowercase characters only.
    full_name str
    The Full Name of the User.
    locale str
    Location information for the user. Please look at Supported Locale Ids for available locales.
    role str
    The Role assigned to the User. Either a built-in such as 'Admin' or 'User' - or the name of a custom role.
    skype_username str
    Skype username of the user.
    tags Sequence[str]
    A list of tags to be associated with the user.
    timezone str
    Timezone information of the user. Please look at Supported Timezone Ids for available timezones.
    user_addresses Sequence[UserUserAddressArgs]
    Address of the user.
    user_details Mapping[str, str]
    Details about the user in form of key and list. of values.
    username str
    The email address associated with this user. Opsgenie defines that this must not be longer than 100 characters and must contain lowercase characters only.
    fullName String
    The Full Name of the User.
    locale String
    Location information for the user. Please look at Supported Locale Ids for available locales.
    role String
    The Role assigned to the User. Either a built-in such as 'Admin' or 'User' - or the name of a custom role.
    skypeUsername String
    Skype username of the user.
    tags List<String>
    A list of tags to be associated with the user.
    timezone String
    Timezone information of the user. Please look at Supported Timezone Ids for available timezones.
    userAddresses List<Property Map>
    Address of the user.
    userDetails Map<String>
    Details about the user in form of key and list. of values.
    username String
    The email address associated with this user. Opsgenie defines that this must not be longer than 100 characters and must contain lowercase characters only.

    Supporting Types

    UserUserAddress, UserUserAddressArgs

    City string
    Country string
    Line string
    State string
    Zipcode string
    City string
    Country string
    Line string
    State string
    Zipcode string
    city String
    country String
    line String
    state String
    zipcode String
    city string
    country string
    line string
    state string
    zipcode string
    city str
    country str
    line str
    state str
    zipcode str
    city String
    country String
    line String
    state String
    zipcode String

    Import

    Users can be imported using the user_id, e.g.

    $ pulumi import opsgenie:index/user:User user user_id`
    

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

    Package Details

    Repository
    Opsgenie pulumi/pulumi-opsgenie
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the opsgenie Terraform Provider.
    opsgenie logo
    Opsgenie v1.3.8 published on Monday, Jun 24, 2024 by Pulumi