1. Packages
  2. Spotinst Provider
  3. API Docs
  4. organization
  5. ProgrammaticUser
Spotinst v3.100.0 published on Wednesday, Nov 20, 2024 by Pulumi

spotinst.organization.ProgrammaticUser

Explore with Pulumi AI

spotinst logo
Spotinst v3.100.0 published on Wednesday, Nov 20, 2024 by Pulumi

    Provides a Spotinst programmatic user in the creator’s organization.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as spotinst from "@pulumi/spotinst";
    
    const terraformProgUser = new spotinst.organization.ProgrammaticUser("terraform_prog_user", {
        name: "test-prog-user",
        description: "creating programmatic user",
        policies: [{
            policyId: "pol-g75d8c06",
            policyAccountIds: ["act-a1b2c3d4"],
        }],
        userGroupIds: [
            "ugr-abcd1234",
            "ugr-defg8763",
        ],
    });
    
    import pulumi
    import pulumi_spotinst as spotinst
    
    terraform_prog_user = spotinst.organization.ProgrammaticUser("terraform_prog_user",
        name="test-prog-user",
        description="creating programmatic user",
        policies=[{
            "policy_id": "pol-g75d8c06",
            "policy_account_ids": ["act-a1b2c3d4"],
        }],
        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.NewProgrammaticUser(ctx, "terraform_prog_user", &organization.ProgrammaticUserArgs{
    			Name:        pulumi.String("test-prog-user"),
    			Description: pulumi.String("creating programmatic user"),
    			Policies: organization.ProgrammaticUserPolicyArray{
    				&organization.ProgrammaticUserPolicyArgs{
    					PolicyId: pulumi.String("pol-g75d8c06"),
    					PolicyAccountIds: pulumi.StringArray{
    						pulumi.String("act-a1b2c3d4"),
    					},
    				},
    			},
    			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 terraformProgUser = new SpotInst.Organization.ProgrammaticUser("terraform_prog_user", new()
        {
            Name = "test-prog-user",
            Description = "creating programmatic user",
            Policies = new[]
            {
                new SpotInst.Organization.Inputs.ProgrammaticUserPolicyArgs
                {
                    PolicyId = "pol-g75d8c06",
                    PolicyAccountIds = new[]
                    {
                        "act-a1b2c3d4",
                    },
                },
            },
            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.ProgrammaticUser;
    import com.pulumi.spotinst.organization.ProgrammaticUserArgs;
    import com.pulumi.spotinst.organization.inputs.ProgrammaticUserPolicyArgs;
    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 terraformProgUser = new ProgrammaticUser("terraformProgUser", ProgrammaticUserArgs.builder()
                .name("test-prog-user")
                .description("creating programmatic user")
                .policies(ProgrammaticUserPolicyArgs.builder()
                    .policyId("pol-g75d8c06")
                    .policyAccountIds("act-a1b2c3d4")
                    .build())
                .userGroupIds(            
                    "ugr-abcd1234",
                    "ugr-defg8763")
                .build());
    
        }
    }
    
    resources:
      terraformProgUser:
        type: spotinst:organization:ProgrammaticUser
        name: terraform_prog_user
        properties:
          name: test-prog-user
          description: creating programmatic user
          policies:
            - policyId: pol-g75d8c06
              policyAccountIds:
                - act-a1b2c3d4
          userGroupIds: # account and policies are exclusive
            - ugr-abcd1234
            - ugr-defg8763
    

    Create ProgrammaticUser Resource

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

    Constructor syntax

    new ProgrammaticUser(name: string, args?: ProgrammaticUserArgs, opts?: CustomResourceOptions);
    @overload
    def ProgrammaticUser(resource_name: str,
                         args: Optional[ProgrammaticUserArgs] = None,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def ProgrammaticUser(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         accounts: Optional[Sequence[ProgrammaticUserAccountArgs]] = None,
                         description: Optional[str] = None,
                         name: Optional[str] = None,
                         policies: Optional[Sequence[ProgrammaticUserPolicyArgs]] = None,
                         user_group_ids: Optional[Sequence[str]] = None)
    func NewProgrammaticUser(ctx *Context, name string, args *ProgrammaticUserArgs, opts ...ResourceOption) (*ProgrammaticUser, error)
    public ProgrammaticUser(string name, ProgrammaticUserArgs? args = null, CustomResourceOptions? opts = null)
    public ProgrammaticUser(String name, ProgrammaticUserArgs args)
    public ProgrammaticUser(String name, ProgrammaticUserArgs args, CustomResourceOptions options)
    
    type: spotinst:organization:ProgrammaticUser
    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 ProgrammaticUserArgs
    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 ProgrammaticUserArgs
    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 ProgrammaticUserArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProgrammaticUserArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProgrammaticUserArgs
    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 programmaticUserResource = new SpotInst.Organization.ProgrammaticUser("programmaticUserResource", new()
    {
        Accounts = new[]
        {
            new SpotInst.Organization.Inputs.ProgrammaticUserAccountArgs
            {
                AccountId = "string",
                AccountRole = "string",
            },
        },
        Description = "string",
        Name = "string",
        Policies = new[]
        {
            new SpotInst.Organization.Inputs.ProgrammaticUserPolicyArgs
            {
                PolicyId = "string",
                PolicyAccountIds = new[]
                {
                    "string",
                },
            },
        },
        UserGroupIds = new[]
        {
            "string",
        },
    });
    
    example, err := organization.NewProgrammaticUser(ctx, "programmaticUserResource", &organization.ProgrammaticUserArgs{
    	Accounts: organization.ProgrammaticUserAccountArray{
    		&organization.ProgrammaticUserAccountArgs{
    			AccountId:   pulumi.String("string"),
    			AccountRole: pulumi.String("string"),
    		},
    	},
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	Policies: organization.ProgrammaticUserPolicyArray{
    		&organization.ProgrammaticUserPolicyArgs{
    			PolicyId: pulumi.String("string"),
    			PolicyAccountIds: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    		},
    	},
    	UserGroupIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var programmaticUserResource = new ProgrammaticUser("programmaticUserResource", ProgrammaticUserArgs.builder()
        .accounts(ProgrammaticUserAccountArgs.builder()
            .accountId("string")
            .accountRole("string")
            .build())
        .description("string")
        .name("string")
        .policies(ProgrammaticUserPolicyArgs.builder()
            .policyId("string")
            .policyAccountIds("string")
            .build())
        .userGroupIds("string")
        .build());
    
    programmatic_user_resource = spotinst.organization.ProgrammaticUser("programmaticUserResource",
        accounts=[{
            "account_id": "string",
            "account_role": "string",
        }],
        description="string",
        name="string",
        policies=[{
            "policy_id": "string",
            "policy_account_ids": ["string"],
        }],
        user_group_ids=["string"])
    
    const programmaticUserResource = new spotinst.organization.ProgrammaticUser("programmaticUserResource", {
        accounts: [{
            accountId: "string",
            accountRole: "string",
        }],
        description: "string",
        name: "string",
        policies: [{
            policyId: "string",
            policyAccountIds: ["string"],
        }],
        userGroupIds: ["string"],
    });
    
    type: spotinst:organization:ProgrammaticUser
    properties:
        accounts:
            - accountId: string
              accountRole: string
        description: string
        name: string
        policies:
            - policyAccountIds:
                - string
              policyId: string
        userGroupIds:
            - string
    

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

    Accounts List<Pulumi.SpotInst.Organization.Inputs.ProgrammaticUserAccount>
    All the accounts the programmatic user will have access to. If used - Cannot be empty.
    Description string
    Brief description of the user.
    Name string
    Name of the programmatic user.
    Policies List<Pulumi.SpotInst.Organization.Inputs.ProgrammaticUserPolicy>
    All the policies the programmatic user will have access to. If used - Cannot be empty.
    UserGroupIds List<string>
    A list of the user groups to register the given user to (should be existing user groups only)
    Accounts []ProgrammaticUserAccountArgs
    All the accounts the programmatic user will have access to. If used - Cannot be empty.
    Description string
    Brief description of the user.
    Name string
    Name of the programmatic user.
    Policies []ProgrammaticUserPolicyArgs
    All the policies the programmatic user will have access to. If used - Cannot be empty.
    UserGroupIds []string
    A list of the user groups to register the given user to (should be existing user groups only)
    accounts List<ProgrammaticUserAccount>
    All the accounts the programmatic user will have access to. If used - Cannot be empty.
    description String
    Brief description of the user.
    name String
    Name of the programmatic user.
    policies List<ProgrammaticUserPolicy>
    All the policies the programmatic user will have access to. If used - Cannot be empty.
    userGroupIds List<String>
    A list of the user groups to register the given user to (should be existing user groups only)
    accounts ProgrammaticUserAccount[]
    All the accounts the programmatic user will have access to. If used - Cannot be empty.
    description string
    Brief description of the user.
    name string
    Name of the programmatic user.
    policies ProgrammaticUserPolicy[]
    All the policies the programmatic user will have access to. If used - Cannot be empty.
    userGroupIds string[]
    A list of the user groups to register the given user to (should be existing user groups only)
    accounts Sequence[ProgrammaticUserAccountArgs]
    All the accounts the programmatic user will have access to. If used - Cannot be empty.
    description str
    Brief description of the user.
    name str
    Name of the programmatic user.
    policies Sequence[ProgrammaticUserPolicyArgs]
    All the policies the programmatic user will have access to. If used - Cannot be empty.
    user_group_ids Sequence[str]
    A list of the user groups to register the given user to (should be existing user groups only)
    accounts List<Property Map>
    All the accounts the programmatic user will have access to. If used - Cannot be empty.
    description String
    Brief description of the user.
    name String
    Name of the programmatic user.
    policies List<Property Map>
    All the policies the programmatic user will have access to. If used - Cannot be empty.
    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 ProgrammaticUser 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 ProgrammaticUser Resource

    Get an existing ProgrammaticUser 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?: ProgrammaticUserState, opts?: CustomResourceOptions): ProgrammaticUser
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            accounts: Optional[Sequence[ProgrammaticUserAccountArgs]] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            policies: Optional[Sequence[ProgrammaticUserPolicyArgs]] = None,
            user_group_ids: Optional[Sequence[str]] = None) -> ProgrammaticUser
    func GetProgrammaticUser(ctx *Context, name string, id IDInput, state *ProgrammaticUserState, opts ...ResourceOption) (*ProgrammaticUser, error)
    public static ProgrammaticUser Get(string name, Input<string> id, ProgrammaticUserState? state, CustomResourceOptions? opts = null)
    public static ProgrammaticUser get(String name, Output<String> id, ProgrammaticUserState 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:
    Accounts List<Pulumi.SpotInst.Organization.Inputs.ProgrammaticUserAccount>
    All the accounts the programmatic user will have access to. If used - Cannot be empty.
    Description string
    Brief description of the user.
    Name string
    Name of the programmatic user.
    Policies List<Pulumi.SpotInst.Organization.Inputs.ProgrammaticUserPolicy>
    All the policies the programmatic user will have access to. If used - Cannot be empty.
    UserGroupIds List<string>
    A list of the user groups to register the given user to (should be existing user groups only)
    Accounts []ProgrammaticUserAccountArgs
    All the accounts the programmatic user will have access to. If used - Cannot be empty.
    Description string
    Brief description of the user.
    Name string
    Name of the programmatic user.
    Policies []ProgrammaticUserPolicyArgs
    All the policies the programmatic user will have access to. If used - Cannot be empty.
    UserGroupIds []string
    A list of the user groups to register the given user to (should be existing user groups only)
    accounts List<ProgrammaticUserAccount>
    All the accounts the programmatic user will have access to. If used - Cannot be empty.
    description String
    Brief description of the user.
    name String
    Name of the programmatic user.
    policies List<ProgrammaticUserPolicy>
    All the policies the programmatic user will have access to. If used - Cannot be empty.
    userGroupIds List<String>
    A list of the user groups to register the given user to (should be existing user groups only)
    accounts ProgrammaticUserAccount[]
    All the accounts the programmatic user will have access to. If used - Cannot be empty.
    description string
    Brief description of the user.
    name string
    Name of the programmatic user.
    policies ProgrammaticUserPolicy[]
    All the policies the programmatic user will have access to. If used - Cannot be empty.
    userGroupIds string[]
    A list of the user groups to register the given user to (should be existing user groups only)
    accounts Sequence[ProgrammaticUserAccountArgs]
    All the accounts the programmatic user will have access to. If used - Cannot be empty.
    description str
    Brief description of the user.
    name str
    Name of the programmatic user.
    policies Sequence[ProgrammaticUserPolicyArgs]
    All the policies the programmatic user will have access to. If used - Cannot be empty.
    user_group_ids Sequence[str]
    A list of the user groups to register the given user to (should be existing user groups only)
    accounts List<Property Map>
    All the accounts the programmatic user will have access to. If used - Cannot be empty.
    description String
    Brief description of the user.
    name String
    Name of the programmatic user.
    policies List<Property Map>
    All the policies the programmatic user will have access to. If used - Cannot be empty.
    userGroupIds List<String>
    A list of the user groups to register the given user to (should be existing user groups only)

    Supporting Types

    ProgrammaticUserAccount, ProgrammaticUserAccountArgs

    AccountId string
    Account ID the programmatic user will have access to.
    AccountRole string
    (Enum: `"viewer", "editor") Role to be associated with the programmatic user for this account.
    AccountId string
    Account ID the programmatic user will have access to.
    AccountRole string
    (Enum: `"viewer", "editor") Role to be associated with the programmatic user for this account.
    accountId String
    Account ID the programmatic user will have access to.
    accountRole String
    (Enum: `"viewer", "editor") Role to be associated with the programmatic user for this account.
    accountId string
    Account ID the programmatic user will have access to.
    accountRole string
    (Enum: `"viewer", "editor") Role to be associated with the programmatic user for this account.
    account_id str
    Account ID the programmatic user will have access to.
    account_role str
    (Enum: `"viewer", "editor") Role to be associated with the programmatic user for this account.
    accountId String
    Account ID the programmatic user will have access to.
    accountRole String
    (Enum: `"viewer", "editor") Role to be associated with the programmatic user for this account.

    ProgrammaticUserPolicy, ProgrammaticUserPolicyArgs

    PolicyId string
    Policy ID the programmatic user will have access to.
    PolicyAccountIds List<string>
    A list of the accounts that the policy should be enforced for the user.
    PolicyId string
    Policy ID the programmatic user will have access to.
    PolicyAccountIds []string
    A list of the accounts that the policy should be enforced for the user.
    policyId String
    Policy ID the programmatic user will have access to.
    policyAccountIds List<String>
    A list of the accounts that the policy should be enforced for the user.
    policyId string
    Policy ID the programmatic user will have access to.
    policyAccountIds string[]
    A list of the accounts that the policy should be enforced for the user.
    policy_id str
    Policy ID the programmatic user will have access to.
    policy_account_ids Sequence[str]
    A list of the accounts that the policy should be enforced for the user.
    policyId String
    Policy ID the programmatic user will have access to.
    policyAccountIds List<String>
    A list of the accounts that the policy should be enforced for the user.

    Package Details

    Repository
    Spotinst pulumi/pulumi-spotinst
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the spotinst Terraform Provider.
    spotinst logo
    Spotinst v3.100.0 published on Wednesday, Nov 20, 2024 by Pulumi