Spotinst v3.81.0 published on Monday, Jun 24, 2024 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",
],
});
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=[spotinst.organization.UserPolicyArgs(
policy_id="pol-abcd1236",
policy_account_ids=["act-abcf4245"],
)],
user_group_ids=[
"ugr-abcd1234",
"ugr-defg8763",
])
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
})
}
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",
},
});
});
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());
}
}
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
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)
type: spotinst:organization: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 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",
},
});
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"),
},
})
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());
user_resource = spotinst.organization.User("userResource",
email="string",
first_name="string",
last_name="string",
password="string",
policies=[spotinst.organization.UserPolicyArgs(
policy_account_ids=["string"],
policy_id="string",
)],
role="string",
user_group_ids=["string"])
const userResource = new spotinst.organization.User("userResource", {
email: "string",
firstName: "string",
lastName: "string",
password: "string",
policies: [{
policyAccountIds: ["string"],
policyId: "string",
}],
role: "string",
userGroupIds: ["string"],
});
type: spotinst:organization:User
properties:
email: string
firstName: string
lastName: string
password: string
policies:
- policyAccountIds:
- string
policyId: string
role: string
userGroupIds:
- 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:
- Email string
- Email.
- First
Name string - The first name of the user.
- Last
Name string - The last name of the user.
- Password string
- Password.
- Policies
List<Pulumi.
Spot Inst. Organization. Inputs. User Policy> - The policies to register under the given group (should be existing policies only).
- Role string
- User's role.
- User
Group List<string>Ids - A list of the user groups to register the given user to (should be existing user groups only)
- Email string
- Email.
- First
Name string - The first name of the user.
- Last
Name string - The last name of the user.
- Password string
- Password.
- Policies
[]User
Policy Args - The policies to register under the given group (should be existing policies only).
- Role string
- User's role.
- User
Group []stringIds - A list of the user groups to register the given user to (should be existing user groups only)
- email String
- Email.
- first
Name String - The first name of the user.
- last
Name String - The last name of the user.
- password String
- Password.
- policies
List<User
Policy> - The policies to register under the given group (should be existing policies only).
- role String
- User's role.
- user
Group List<String>Ids - A list of the user groups to register the given user to (should be existing user groups only)
- email string
- Email.
- first
Name string - The first name of the user.
- last
Name string - The last name of the user.
- password string
- Password.
- policies
User
Policy[] - The policies to register under the given group (should be existing policies only).
- role string
- User's role.
- user
Group string[]Ids - 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[User
Policy Args] - The policies to register under the given group (should be existing policies only).
- role str
- User's role.
- user_
group_ Sequence[str]ids - A list of the user groups to register the given user to (should be existing user groups only)
- email String
- Email.
- first
Name String - The first name of the user.
- last
Name 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.
- user
Group List<String>Ids - 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)
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.
- Email string
- Email.
- First
Name string - The first name of the user.
- Last
Name string - The last name of the user.
- Password string
- Password.
- Policies
List<Pulumi.
Spot Inst. Organization. Inputs. User Policy> - The policies to register under the given group (should be existing policies only).
- Role string
- User's role.
- User
Group List<string>Ids - A list of the user groups to register the given user to (should be existing user groups only)
- Email string
- Email.
- First
Name string - The first name of the user.
- Last
Name string - The last name of the user.
- Password string
- Password.
- Policies
[]User
Policy Args - The policies to register under the given group (should be existing policies only).
- Role string
- User's role.
- User
Group []stringIds - A list of the user groups to register the given user to (should be existing user groups only)
- email String
- Email.
- first
Name String - The first name of the user.
- last
Name String - The last name of the user.
- password String
- Password.
- policies
List<User
Policy> - The policies to register under the given group (should be existing policies only).
- role String
- User's role.
- user
Group List<String>Ids - A list of the user groups to register the given user to (should be existing user groups only)
- email string
- Email.
- first
Name string - The first name of the user.
- last
Name string - The last name of the user.
- password string
- Password.
- policies
User
Policy[] - The policies to register under the given group (should be existing policies only).
- role string
- User's role.
- user
Group string[]Ids - 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[User
Policy Args] - The policies to register under the given group (should be existing policies only).
- role str
- User's role.
- user_
group_ Sequence[str]ids - A list of the user groups to register the given user to (should be existing user groups only)
- email String
- Email.
- first
Name String - The first name of the user.
- last
Name 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.
- user
Group List<String>Ids - A list of the user groups to register the given user to (should be existing user groups only)
Supporting Types
UserPolicy, UserPolicyArgs
- Policy
Account List<string>Ids - Policy
Id string - A policy to register under the given group (should be existing policy only).
- Policy
Account []stringIds - Policy
Id string - A policy to register under the given group (should be existing policy only).
- policy
Account List<String>Ids - policy
Id String - A policy to register under the given group (should be existing policy only).
- policy
Account string[]Ids - policy
Id string - A policy to register under the given group (should be existing policy only).
- policy_
account_ Sequence[str]ids - policy_
id str - A policy to register under the given group (should be existing policy only).
- policy
Account List<String>Ids - policy
Id 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.