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",
}],
});
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",
}])
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
})
}
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",
},
},
});
});
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());
}
}
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
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 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 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 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 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 String
- The unique name of the resource.
- args 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",
},
});
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"),
},
})
var userGroupResource = new UserGroup("userGroupResource", UserGroupArgs.builder()
.description("string")
.name("string")
.policies(UserGroupPolicyArgs.builder()
.accountIds("string")
.policyId("string")
.build())
.userIds("string")
.build());
user_group_resource = spotinst.organization.UserGroup("userGroupResource",
description="string",
name="string",
policies=[{
"account_ids": ["string"],
"policy_id": "string",
}],
user_ids=["string"])
const userGroupResource = new spotinst.organization.UserGroup("userGroupResource", {
description: "string",
name: "string",
policies: [{
accountIds: ["string"],
policyId: "string",
}],
userIds: ["string"],
});
type: spotinst:organization:UserGroup
properties:
description: string
name: string
policies:
- accountIds:
- string
policyId: string
userIds:
- string
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.
Spot Inst. Organization. Inputs. User Group Policy> - The policies to register under the given group (should be existing policies only).
- User
Ids 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
[]User
Group Policy Args - The policies to register under the given group (should be existing policies only).
- User
Ids []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<User
Group Policy> - The policies to register under the given group (should be existing policies only).
- user
Ids 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
User
Group Policy[] - The policies to register under the given group (should be existing policies only).
- user
Ids 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[User
Group Policy Args] - 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).
- user
Ids 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)
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.
- Description string
- User group description.
- Name string
- User group name.
- Policies
List<Pulumi.
Spot Inst. Organization. Inputs. User Group Policy> - The policies to register under the given group (should be existing policies only).
- User
Ids 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
[]User
Group Policy Args - The policies to register under the given group (should be existing policies only).
- User
Ids []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<User
Group Policy> - The policies to register under the given group (should be existing policies only).
- user
Ids 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
User
Group Policy[] - The policies to register under the given group (should be existing policies only).
- user
Ids 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[User
Group Policy Args] - 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).
- user
Ids List<String> - The users to register under the created group (should be existing users only).
Supporting Types
UserGroupPolicy, UserGroupPolicyArgs
- Account
Ids List<string> - A list of accounts to register with the assigned under the given group (should be existing accounts only).
- Policy
Id string - A policy to register under the given group (should be existing policy only).
- Account
Ids []string - A list of accounts to register with the assigned under the given group (should be existing accounts only).
- Policy
Id string - A policy to register under the given group (should be existing policy only).
- account
Ids List<String> - A list of accounts to register with the assigned under the given group (should be existing accounts only).
- policy
Id String - A policy to register under the given group (should be existing policy only).
- account
Ids string[] - A list of accounts to register with the assigned under the given group (should be existing accounts only).
- policy
Id string - A policy to register under the given group (should be existing policy only).
- account_
ids Sequence[str] - A list of accounts to register with the assigned under the given group (should be existing accounts only).
- policy_
id str - A policy to register under the given group (should be existing policy only).
- account
Ids List<String> - A list of accounts to register with the assigned under the given group (should be existing accounts only).
- 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.