1. Packages
  2. Spotinst Provider
  3. API Docs
  4. organization
  5. User
Spotinst v3.116.2 published on Monday, Jan 1, 0001 by Pulumi

spotinst.organization.User

Explore with Pulumi AI

Provides a Spotinst User in the creator’s organization.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as spotinst from "@pulumi/spotinst";

const terraformUser = new spotinst.organization.User("terraform_user", {
    email: "abc@xyz.com",
    firstName: "test",
    lastName: "user",
    password: "testUser@123",
    role: "viewer",
    policies: [{
        policyId: "pol-abcd1236",
        policyAccountIds: ["act-abcf4245"],
    }],
    userGroupIds: [
        "ugr-abcd1234",
        "ugr-defg8763",
    ],
});
Copy
import pulumi
import pulumi_spotinst as spotinst

terraform_user = spotinst.organization.User("terraform_user",
    email="abc@xyz.com",
    first_name="test",
    last_name="user",
    password="testUser@123",
    role="viewer",
    policies=[{
        "policy_id": "pol-abcd1236",
        "policy_account_ids": ["act-abcf4245"],
    }],
    user_group_ids=[
        "ugr-abcd1234",
        "ugr-defg8763",
    ])
Copy
package main

import (
	"github.com/pulumi/pulumi-spotinst/sdk/v3/go/spotinst/organization"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := organization.NewUser(ctx, "terraform_user", &organization.UserArgs{
			Email:     pulumi.String("abc@xyz.com"),
			FirstName: pulumi.String("test"),
			LastName:  pulumi.String("user"),
			Password:  pulumi.String("testUser@123"),
			Role:      pulumi.String("viewer"),
			Policies: organization.UserPolicyArray{
				&organization.UserPolicyArgs{
					PolicyId: pulumi.String("pol-abcd1236"),
					PolicyAccountIds: pulumi.StringArray{
						pulumi.String("act-abcf4245"),
					},
				},
			},
			UserGroupIds: pulumi.StringArray{
				pulumi.String("ugr-abcd1234"),
				pulumi.String("ugr-defg8763"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using SpotInst = Pulumi.SpotInst;

return await Deployment.RunAsync(() => 
{
    var terraformUser = new SpotInst.Organization.User("terraform_user", new()
    {
        Email = "abc@xyz.com",
        FirstName = "test",
        LastName = "user",
        Password = "testUser@123",
        Role = "viewer",
        Policies = new[]
        {
            new SpotInst.Organization.Inputs.UserPolicyArgs
            {
                PolicyId = "pol-abcd1236",
                PolicyAccountIds = new[]
                {
                    "act-abcf4245",
                },
            },
        },
        UserGroupIds = new[]
        {
            "ugr-abcd1234",
            "ugr-defg8763",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.spotinst.organization.User;
import com.pulumi.spotinst.organization.UserArgs;
import com.pulumi.spotinst.organization.inputs.UserPolicyArgs;
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 terraformUser = new User("terraformUser", UserArgs.builder()
            .email("abc@xyz.com")
            .firstName("test")
            .lastName("user")
            .password("testUser@123")
            .role("viewer")
            .policies(UserPolicyArgs.builder()
                .policyId("pol-abcd1236")
                .policyAccountIds("act-abcf4245")
                .build())
            .userGroupIds(            
                "ugr-abcd1234",
                "ugr-defg8763")
            .build());

    }
}
Copy
resources:
  terraformUser:
    type: spotinst:organization:User
    name: terraform_user
    properties:
      email: abc@xyz.com
      firstName: test
      lastName: user
      password: testUser@123
      role: viewer
      policies:
        - policyId: pol-abcd1236
          policyAccountIds:
            - act-abcf4245
      userGroupIds:
        - ugr-abcd1234
        - ugr-defg8763
Copy

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,
         email: Optional[str] = None,
         first_name: Optional[str] = None,
         last_name: Optional[str] = None,
         password: Optional[str] = None,
         policies: Optional[Sequence[UserPolicyArgs]] = None,
         role: Optional[str] = None,
         user_group_ids: Optional[Sequence[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: spotinst:organization:User
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. UserArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. UserArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. UserArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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 SpotInst.Organization.User("userResource", new()
{
    Email = "string",
    FirstName = "string",
    LastName = "string",
    Password = "string",
    Policies = new[]
    {
        new SpotInst.Organization.Inputs.UserPolicyArgs
        {
            PolicyAccountIds = new[]
            {
                "string",
            },
            PolicyId = "string",
        },
    },
    Role = "string",
    UserGroupIds = new[]
    {
        "string",
    },
});
Copy
example, err := organization.NewUser(ctx, "userResource", &organization.UserArgs{
	Email:     pulumi.String("string"),
	FirstName: pulumi.String("string"),
	LastName:  pulumi.String("string"),
	Password:  pulumi.String("string"),
	Policies: organization.UserPolicyArray{
		&organization.UserPolicyArgs{
			PolicyAccountIds: pulumi.StringArray{
				pulumi.String("string"),
			},
			PolicyId: pulumi.String("string"),
		},
	},
	Role: pulumi.String("string"),
	UserGroupIds: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var userResource = new User("userResource", UserArgs.builder()
    .email("string")
    .firstName("string")
    .lastName("string")
    .password("string")
    .policies(UserPolicyArgs.builder()
        .policyAccountIds("string")
        .policyId("string")
        .build())
    .role("string")
    .userGroupIds("string")
    .build());
Copy
user_resource = spotinst.organization.User("userResource",
    email="string",
    first_name="string",
    last_name="string",
    password="string",
    policies=[{
        "policy_account_ids": ["string"],
        "policy_id": "string",
    }],
    role="string",
    user_group_ids=["string"])
Copy
const userResource = new spotinst.organization.User("userResource", {
    email: "string",
    firstName: "string",
    lastName: "string",
    password: "string",
    policies: [{
        policyAccountIds: ["string"],
        policyId: "string",
    }],
    role: "string",
    userGroupIds: ["string"],
});
Copy
type: spotinst:organization:User
properties:
    email: string
    firstName: string
    lastName: string
    password: string
    policies:
        - policyAccountIds:
            - string
          policyId: string
    role: string
    userGroupIds:
        - string
Copy

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

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The User resource accepts the following input properties:

Email This property is required. string
Email.
FirstName This property is required. string
The first name of the user.
LastName This property is required. string
The last name of the user.
Password string
Password.
Policies List<Pulumi.SpotInst.Organization.Inputs.UserPolicy>
The policies to register under the given group (should be existing policies only).
Role string
User's role.
UserGroupIds List<string>
A list of the user groups to register the given user to (should be existing user groups only)
Email This property is required. string
Email.
FirstName This property is required. string
The first name of the user.
LastName This property is required. string
The last name of the user.
Password string
Password.
Policies []UserPolicyArgs
The policies to register under the given group (should be existing policies only).
Role string
User's role.
UserGroupIds []string
A list of the user groups to register the given user to (should be existing user groups only)
email This property is required. String
Email.
firstName This property is required. String
The first name of the user.
lastName This property is required. String
The last name of the user.
password String
Password.
policies List<UserPolicy>
The policies to register under the given group (should be existing policies only).
role String
User's role.
userGroupIds List<String>
A list of the user groups to register the given user to (should be existing user groups only)
email This property is required. string
Email.
firstName This property is required. string
The first name of the user.
lastName This property is required. string
The last name of the user.
password string
Password.
policies UserPolicy[]
The policies to register under the given group (should be existing policies only).
role string
User's role.
userGroupIds string[]
A list of the user groups to register the given user to (should be existing user groups only)
email This property is required. str
Email.
first_name This property is required. str
The first name of the user.
last_name This property is required. str
The last name of the user.
password str
Password.
policies Sequence[UserPolicyArgs]
The policies to register under the given group (should be existing policies only).
role str
User's role.
user_group_ids Sequence[str]
A list of the user groups to register the given user to (should be existing user groups only)
email This property is required. String
Email.
firstName This property is required. String
The first name of the user.
lastName This property is required. String
The last name of the user.
password String
Password.
policies List<Property Map>
The policies to register under the given group (should be existing policies only).
role String
User's role.
userGroupIds List<String>
A list of the user groups to register the given user to (should be existing user groups only)

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,
        email: Optional[str] = None,
        first_name: Optional[str] = None,
        last_name: Optional[str] = None,
        password: Optional[str] = None,
        policies: Optional[Sequence[UserPolicyArgs]] = None,
        role: Optional[str] = None,
        user_group_ids: Optional[Sequence[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)
resources:  _:    type: spotinst:organization:User    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Email string
Email.
FirstName string
The first name of the user.
LastName string
The last name of the user.
Password string
Password.
Policies List<Pulumi.SpotInst.Organization.Inputs.UserPolicy>
The policies to register under the given group (should be existing policies only).
Role string
User's role.
UserGroupIds List<string>
A list of the user groups to register the given user to (should be existing user groups only)
Email string
Email.
FirstName string
The first name of the user.
LastName string
The last name of the user.
Password string
Password.
Policies []UserPolicyArgs
The policies to register under the given group (should be existing policies only).
Role string
User's role.
UserGroupIds []string
A list of the user groups to register the given user to (should be existing user groups only)
email String
Email.
firstName String
The first name of the user.
lastName String
The last name of the user.
password String
Password.
policies List<UserPolicy>
The policies to register under the given group (should be existing policies only).
role String
User's role.
userGroupIds List<String>
A list of the user groups to register the given user to (should be existing user groups only)
email string
Email.
firstName string
The first name of the user.
lastName string
The last name of the user.
password string
Password.
policies UserPolicy[]
The policies to register under the given group (should be existing policies only).
role string
User's role.
userGroupIds string[]
A list of the user groups to register the given user to (should be existing user groups only)
email str
Email.
first_name str
The first name of the user.
last_name str
The last name of the user.
password str
Password.
policies Sequence[UserPolicyArgs]
The policies to register under the given group (should be existing policies only).
role str
User's role.
user_group_ids Sequence[str]
A list of the user groups to register the given user to (should be existing user groups only)
email String
Email.
firstName String
The first name of the user.
lastName String
The last name of the user.
password String
Password.
policies List<Property Map>
The policies to register under the given group (should be existing policies only).
role String
User's role.
userGroupIds List<String>
A list of the user groups to register the given user to (should be existing user groups only)

Supporting Types

UserPolicy
, UserPolicyArgs

PolicyAccountIds This property is required. List<string>
PolicyId This property is required. string
A policy to register under the given group (should be existing policy only).
PolicyAccountIds This property is required. []string
PolicyId This property is required. string
A policy to register under the given group (should be existing policy only).
policyAccountIds This property is required. List<String>
policyId This property is required. String
A policy to register under the given group (should be existing policy only).
policyAccountIds This property is required. string[]
policyId This property is required. string
A policy to register under the given group (should be existing policy only).
policy_account_ids This property is required. Sequence[str]
policy_id This property is required. str
A policy to register under the given group (should be existing policy only).
policyAccountIds This property is required. List<String>
policyId This property is required. String
A policy to register under the given group (should be existing policy only).

Package Details

Repository
Spotinst pulumi/pulumi-spotinst
License
Apache-2.0
Notes
This Pulumi package is based on the spotinst Terraform Provider.