1. Packages
  2. Spotinst Provider
  3. API Docs
  4. organization
  5. UserGroup
Spotinst v3.116.0 published on Friday, Mar 28, 2025 by Pulumi

spotinst.organization.UserGroup

Explore with Pulumi AI

Provides a Spotinst user-group of your Spot organization.

Example Usage

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

const terraformUserGroup = new spotinst.organization.UserGroup("terraform_user_group", {
    name: "test_user_group",
    description: "user group by terraform",
    userIds: ["u-372gf6ae"],
    policies: [{
        accountIds: ["act-a1b2c3d4"],
        policyId: "pol-vv7d8c06",
    }],
});
Copy
import pulumi
import pulumi_spotinst as spotinst

terraform_user_group = spotinst.organization.UserGroup("terraform_user_group",
    name="test_user_group",
    description="user group by terraform",
    user_ids=["u-372gf6ae"],
    policies=[{
        "account_ids": ["act-a1b2c3d4"],
        "policy_id": "pol-vv7d8c06",
    }])
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.NewUserGroup(ctx, "terraform_user_group", &organization.UserGroupArgs{
			Name:        pulumi.String("test_user_group"),
			Description: pulumi.String("user group by terraform"),
			UserIds: pulumi.StringArray{
				pulumi.String("u-372gf6ae"),
			},
			Policies: organization.UserGroupPolicyArray{
				&organization.UserGroupPolicyArgs{
					AccountIds: pulumi.StringArray{
						pulumi.String("act-a1b2c3d4"),
					},
					PolicyId: pulumi.String("pol-vv7d8c06"),
				},
			},
		})
		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 terraformUserGroup = new SpotInst.Organization.UserGroup("terraform_user_group", new()
    {
        Name = "test_user_group",
        Description = "user group by terraform",
        UserIds = new[]
        {
            "u-372gf6ae",
        },
        Policies = new[]
        {
            new SpotInst.Organization.Inputs.UserGroupPolicyArgs
            {
                AccountIds = new[]
                {
                    "act-a1b2c3d4",
                },
                PolicyId = "pol-vv7d8c06",
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.spotinst.organization.UserGroup;
import com.pulumi.spotinst.organization.UserGroupArgs;
import com.pulumi.spotinst.organization.inputs.UserGroupPolicyArgs;
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 terraformUserGroup = new UserGroup("terraformUserGroup", UserGroupArgs.builder()
            .name("test_user_group")
            .description("user group by terraform")
            .userIds("u-372gf6ae")
            .policies(UserGroupPolicyArgs.builder()
                .accountIds("act-a1b2c3d4")
                .policyId("pol-vv7d8c06")
                .build())
            .build());

    }
}
Copy
resources:
  terraformUserGroup:
    type: spotinst:organization:UserGroup
    name: terraform_user_group
    properties:
      name: test_user_group
      description: user group by terraform
      userIds:
        - u-372gf6ae
      policies:
        - accountIds:
            - act-a1b2c3d4
          policyId: pol-vv7d8c06
Copy

Create UserGroup Resource

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

Constructor syntax

new UserGroup(name: string, args?: UserGroupArgs, opts?: CustomResourceOptions);
@overload
def UserGroup(resource_name: str,
              args: Optional[UserGroupArgs] = None,
              opts: Optional[ResourceOptions] = None)

@overload
def UserGroup(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              description: Optional[str] = None,
              name: Optional[str] = None,
              policies: Optional[Sequence[UserGroupPolicyArgs]] = None,
              user_ids: Optional[Sequence[str]] = None)
func NewUserGroup(ctx *Context, name string, args *UserGroupArgs, opts ...ResourceOption) (*UserGroup, error)
public UserGroup(string name, UserGroupArgs? args = null, CustomResourceOptions? opts = null)
public UserGroup(String name, UserGroupArgs args)
public UserGroup(String name, UserGroupArgs args, CustomResourceOptions options)
type: spotinst:organization:UserGroup
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 UserGroupArgs
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 UserGroupArgs
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 UserGroupArgs
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 UserGroupArgs
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. UserGroupArgs
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 userGroupResource = new SpotInst.Organization.UserGroup("userGroupResource", new()
{
    Description = "string",
    Name = "string",
    Policies = new[]
    {
        new SpotInst.Organization.Inputs.UserGroupPolicyArgs
        {
            AccountIds = new[]
            {
                "string",
            },
            PolicyId = "string",
        },
    },
    UserIds = new[]
    {
        "string",
    },
});
Copy
example, err := organization.NewUserGroup(ctx, "userGroupResource", &organization.UserGroupArgs{
	Description: pulumi.String("string"),
	Name:        pulumi.String("string"),
	Policies: organization.UserGroupPolicyArray{
		&organization.UserGroupPolicyArgs{
			AccountIds: pulumi.StringArray{
				pulumi.String("string"),
			},
			PolicyId: pulumi.String("string"),
		},
	},
	UserIds: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var userGroupResource = new UserGroup("userGroupResource", UserGroupArgs.builder()
    .description("string")
    .name("string")
    .policies(UserGroupPolicyArgs.builder()
        .accountIds("string")
        .policyId("string")
        .build())
    .userIds("string")
    .build());
Copy
user_group_resource = spotinst.organization.UserGroup("userGroupResource",
    description="string",
    name="string",
    policies=[{
        "account_ids": ["string"],
        "policy_id": "string",
    }],
    user_ids=["string"])
Copy
const userGroupResource = new spotinst.organization.UserGroup("userGroupResource", {
    description: "string",
    name: "string",
    policies: [{
        accountIds: ["string"],
        policyId: "string",
    }],
    userIds: ["string"],
});
Copy
type: spotinst:organization:UserGroup
properties:
    description: string
    name: string
    policies:
        - accountIds:
            - string
          policyId: string
    userIds:
        - string
Copy

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

Description string
User group description.
Name string
User group name.
Policies List<Pulumi.SpotInst.Organization.Inputs.UserGroupPolicy>
The policies to register under the given group (should be existing policies only).
UserIds List<string>
The users to register under the created group (should be existing users only).
Description string
User group description.
Name string
User group name.
Policies []UserGroupPolicyArgs
The policies to register under the given group (should be existing policies only).
UserIds []string
The users to register under the created group (should be existing users only).
description String
User group description.
name String
User group name.
policies List<UserGroupPolicy>
The policies to register under the given group (should be existing policies only).
userIds List<String>
The users to register under the created group (should be existing users only).
description string
User group description.
name string
User group name.
policies UserGroupPolicy[]
The policies to register under the given group (should be existing policies only).
userIds string[]
The users to register under the created group (should be existing users only).
description str
User group description.
name str
User group name.
policies Sequence[UserGroupPolicyArgs]
The policies to register under the given group (should be existing policies only).
user_ids Sequence[str]
The users to register under the created group (should be existing users only).
description String
User group description.
name String
User group name.
policies List<Property Map>
The policies to register under the given group (should be existing policies only).
userIds List<String>
The users to register under the created group (should be existing users only).

Outputs

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

Get an existing UserGroup 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?: UserGroupState, opts?: CustomResourceOptions): UserGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        name: Optional[str] = None,
        policies: Optional[Sequence[UserGroupPolicyArgs]] = None,
        user_ids: Optional[Sequence[str]] = None) -> UserGroup
func GetUserGroup(ctx *Context, name string, id IDInput, state *UserGroupState, opts ...ResourceOption) (*UserGroup, error)
public static UserGroup Get(string name, Input<string> id, UserGroupState? state, CustomResourceOptions? opts = null)
public static UserGroup get(String name, Output<String> id, UserGroupState state, CustomResourceOptions options)
resources:  _:    type: spotinst:organization:UserGroup    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:
Description string
User group description.
Name string
User group name.
Policies List<Pulumi.SpotInst.Organization.Inputs.UserGroupPolicy>
The policies to register under the given group (should be existing policies only).
UserIds List<string>
The users to register under the created group (should be existing users only).
Description string
User group description.
Name string
User group name.
Policies []UserGroupPolicyArgs
The policies to register under the given group (should be existing policies only).
UserIds []string
The users to register under the created group (should be existing users only).
description String
User group description.
name String
User group name.
policies List<UserGroupPolicy>
The policies to register under the given group (should be existing policies only).
userIds List<String>
The users to register under the created group (should be existing users only).
description string
User group description.
name string
User group name.
policies UserGroupPolicy[]
The policies to register under the given group (should be existing policies only).
userIds string[]
The users to register under the created group (should be existing users only).
description str
User group description.
name str
User group name.
policies Sequence[UserGroupPolicyArgs]
The policies to register under the given group (should be existing policies only).
user_ids Sequence[str]
The users to register under the created group (should be existing users only).
description String
User group description.
name String
User group name.
policies List<Property Map>
The policies to register under the given group (should be existing policies only).
userIds List<String>
The users to register under the created group (should be existing users only).

Supporting Types

UserGroupPolicy
, UserGroupPolicyArgs

AccountIds This property is required. List<string>
A list of accounts to register with the assigned under the given group (should be existing accounts only).
PolicyId This property is required. string
A policy to register under the given group (should be existing policy only).
AccountIds This property is required. []string
A list of accounts to register with the assigned under the given group (should be existing accounts only).
PolicyId This property is required. string
A policy to register under the given group (should be existing policy only).
accountIds This property is required. List<String>
A list of accounts to register with the assigned under the given group (should be existing accounts only).
policyId This property is required. String
A policy to register under the given group (should be existing policy only).
accountIds This property is required. string[]
A list of accounts to register with the assigned under the given group (should be existing accounts only).
policyId This property is required. string
A policy to register under the given group (should be existing policy only).
account_ids This property is required. Sequence[str]
A list of accounts to register with the assigned under the given group (should be existing accounts only).
policy_id This property is required. str
A policy to register under the given group (should be existing policy only).
accountIds This property is required. List<String>
A list of accounts to register with the assigned under the given group (should be existing accounts only).
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.