1. Packages
  2. Opsgenie
  3. API Docs
  4. User
Opsgenie v1.3.6 published on Tuesday, Feb 27, 2024 by Pulumi

opsgenie.User

Explore with Pulumi AI

opsgenie logo
Opsgenie v1.3.6 published on Tuesday, Feb 27, 2024 by Pulumi

    Manages a User within Opsgenie.

    Example Usage

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

    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.

    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.6 published on Tuesday, Feb 27, 2024 by Pulumi