github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/codecatalyst/devEnvironment.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package codecatalyst
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Resource for managing an AWS CodeCatalyst Dev Environment.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/codecatalyst"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := codecatalyst.NewDevEnvironment(ctx, "test", &codecatalyst.DevEnvironmentArgs{
    33  //				Alias:        pulumi.String("devenv"),
    34  //				SpaceName:    pulumi.String("myspace"),
    35  //				ProjectName:  pulumi.String("myproject"),
    36  //				InstanceType: pulumi.String("dev.standard1.small"),
    37  //				PersistentStorage: &codecatalyst.DevEnvironmentPersistentStorageArgs{
    38  //					Size: pulumi.Int(16),
    39  //				},
    40  //				Ides: &codecatalyst.DevEnvironmentIdesArgs{
    41  //					Name:    pulumi.String("PyCharm"),
    42  //					Runtime: pulumi.String("public.ecr.aws/jetbrains/py"),
    43  //				},
    44  //				InactivityTimeoutMinutes: pulumi.Int(40),
    45  //				Repositories: codecatalyst.DevEnvironmentRepositoryArray{
    46  //					&codecatalyst.DevEnvironmentRepositoryArgs{
    47  //						RepositoryName: pulumi.String("pulumi-provider-aws"),
    48  //						BranchName:     pulumi.String("main"),
    49  //					},
    50  //				},
    51  //			})
    52  //			if err != nil {
    53  //				return err
    54  //			}
    55  //			return nil
    56  //		})
    57  //	}
    58  //
    59  // ```
    60  // <!--End PulumiCodeChooser -->
    61  type DevEnvironment struct {
    62  	pulumi.CustomResourceState
    63  
    64  	Alias pulumi.StringPtrOutput `pulumi:"alias"`
    65  	// Information about the integrated development environment (IDE) configured for a Dev Environment.
    66  	Ides DevEnvironmentIdesOutput `pulumi:"ides"`
    67  	// The amount of time the Dev Environment will run without any activity detected before stopping, in minutes. Only whole integers are allowed. Dev Environments consume compute minutes when running.
    68  	InactivityTimeoutMinutes pulumi.IntPtrOutput `pulumi:"inactivityTimeoutMinutes"`
    69  	// The Amazon EC2 instace type to use for the Dev Environment. Valid values include dev.standard1.small,dev.standard1.medium,dev.standard1.large,dev.standard1.xlarge
    70  	//
    71  	// The following arguments are optional:
    72  	InstanceType pulumi.StringOutput `pulumi:"instanceType"`
    73  	// Information about the amount of storage allocated to the Dev Environment.
    74  	PersistentStorage DevEnvironmentPersistentStorageOutput `pulumi:"persistentStorage"`
    75  	// The name of the project in the space.
    76  	ProjectName pulumi.StringOutput `pulumi:"projectName"`
    77  	// The source repository that contains the branch to clone into the Dev Environment.
    78  	Repositories DevEnvironmentRepositoryArrayOutput `pulumi:"repositories"`
    79  	// The name of the space.
    80  	SpaceName pulumi.StringOutput `pulumi:"spaceName"`
    81  }
    82  
    83  // NewDevEnvironment registers a new resource with the given unique name, arguments, and options.
    84  func NewDevEnvironment(ctx *pulumi.Context,
    85  	name string, args *DevEnvironmentArgs, opts ...pulumi.ResourceOption) (*DevEnvironment, error) {
    86  	if args == nil {
    87  		return nil, errors.New("missing one or more required arguments")
    88  	}
    89  
    90  	if args.Ides == nil {
    91  		return nil, errors.New("invalid value for required argument 'Ides'")
    92  	}
    93  	if args.InstanceType == nil {
    94  		return nil, errors.New("invalid value for required argument 'InstanceType'")
    95  	}
    96  	if args.PersistentStorage == nil {
    97  		return nil, errors.New("invalid value for required argument 'PersistentStorage'")
    98  	}
    99  	if args.ProjectName == nil {
   100  		return nil, errors.New("invalid value for required argument 'ProjectName'")
   101  	}
   102  	if args.SpaceName == nil {
   103  		return nil, errors.New("invalid value for required argument 'SpaceName'")
   104  	}
   105  	opts = internal.PkgResourceDefaultOpts(opts)
   106  	var resource DevEnvironment
   107  	err := ctx.RegisterResource("aws:codecatalyst/devEnvironment:DevEnvironment", name, args, &resource, opts...)
   108  	if err != nil {
   109  		return nil, err
   110  	}
   111  	return &resource, nil
   112  }
   113  
   114  // GetDevEnvironment gets an existing DevEnvironment resource's state with the given name, ID, and optional
   115  // state properties that are used to uniquely qualify the lookup (nil if not required).
   116  func GetDevEnvironment(ctx *pulumi.Context,
   117  	name string, id pulumi.IDInput, state *DevEnvironmentState, opts ...pulumi.ResourceOption) (*DevEnvironment, error) {
   118  	var resource DevEnvironment
   119  	err := ctx.ReadResource("aws:codecatalyst/devEnvironment:DevEnvironment", name, id, state, &resource, opts...)
   120  	if err != nil {
   121  		return nil, err
   122  	}
   123  	return &resource, nil
   124  }
   125  
   126  // Input properties used for looking up and filtering DevEnvironment resources.
   127  type devEnvironmentState struct {
   128  	Alias *string `pulumi:"alias"`
   129  	// Information about the integrated development environment (IDE) configured for a Dev Environment.
   130  	Ides *DevEnvironmentIdes `pulumi:"ides"`
   131  	// The amount of time the Dev Environment will run without any activity detected before stopping, in minutes. Only whole integers are allowed. Dev Environments consume compute minutes when running.
   132  	InactivityTimeoutMinutes *int `pulumi:"inactivityTimeoutMinutes"`
   133  	// The Amazon EC2 instace type to use for the Dev Environment. Valid values include dev.standard1.small,dev.standard1.medium,dev.standard1.large,dev.standard1.xlarge
   134  	//
   135  	// The following arguments are optional:
   136  	InstanceType *string `pulumi:"instanceType"`
   137  	// Information about the amount of storage allocated to the Dev Environment.
   138  	PersistentStorage *DevEnvironmentPersistentStorage `pulumi:"persistentStorage"`
   139  	// The name of the project in the space.
   140  	ProjectName *string `pulumi:"projectName"`
   141  	// The source repository that contains the branch to clone into the Dev Environment.
   142  	Repositories []DevEnvironmentRepository `pulumi:"repositories"`
   143  	// The name of the space.
   144  	SpaceName *string `pulumi:"spaceName"`
   145  }
   146  
   147  type DevEnvironmentState struct {
   148  	Alias pulumi.StringPtrInput
   149  	// Information about the integrated development environment (IDE) configured for a Dev Environment.
   150  	Ides DevEnvironmentIdesPtrInput
   151  	// The amount of time the Dev Environment will run without any activity detected before stopping, in minutes. Only whole integers are allowed. Dev Environments consume compute minutes when running.
   152  	InactivityTimeoutMinutes pulumi.IntPtrInput
   153  	// The Amazon EC2 instace type to use for the Dev Environment. Valid values include dev.standard1.small,dev.standard1.medium,dev.standard1.large,dev.standard1.xlarge
   154  	//
   155  	// The following arguments are optional:
   156  	InstanceType pulumi.StringPtrInput
   157  	// Information about the amount of storage allocated to the Dev Environment.
   158  	PersistentStorage DevEnvironmentPersistentStoragePtrInput
   159  	// The name of the project in the space.
   160  	ProjectName pulumi.StringPtrInput
   161  	// The source repository that contains the branch to clone into the Dev Environment.
   162  	Repositories DevEnvironmentRepositoryArrayInput
   163  	// The name of the space.
   164  	SpaceName pulumi.StringPtrInput
   165  }
   166  
   167  func (DevEnvironmentState) ElementType() reflect.Type {
   168  	return reflect.TypeOf((*devEnvironmentState)(nil)).Elem()
   169  }
   170  
   171  type devEnvironmentArgs struct {
   172  	Alias *string `pulumi:"alias"`
   173  	// Information about the integrated development environment (IDE) configured for a Dev Environment.
   174  	Ides DevEnvironmentIdes `pulumi:"ides"`
   175  	// The amount of time the Dev Environment will run without any activity detected before stopping, in minutes. Only whole integers are allowed. Dev Environments consume compute minutes when running.
   176  	InactivityTimeoutMinutes *int `pulumi:"inactivityTimeoutMinutes"`
   177  	// The Amazon EC2 instace type to use for the Dev Environment. Valid values include dev.standard1.small,dev.standard1.medium,dev.standard1.large,dev.standard1.xlarge
   178  	//
   179  	// The following arguments are optional:
   180  	InstanceType string `pulumi:"instanceType"`
   181  	// Information about the amount of storage allocated to the Dev Environment.
   182  	PersistentStorage DevEnvironmentPersistentStorage `pulumi:"persistentStorage"`
   183  	// The name of the project in the space.
   184  	ProjectName string `pulumi:"projectName"`
   185  	// The source repository that contains the branch to clone into the Dev Environment.
   186  	Repositories []DevEnvironmentRepository `pulumi:"repositories"`
   187  	// The name of the space.
   188  	SpaceName string `pulumi:"spaceName"`
   189  }
   190  
   191  // The set of arguments for constructing a DevEnvironment resource.
   192  type DevEnvironmentArgs struct {
   193  	Alias pulumi.StringPtrInput
   194  	// Information about the integrated development environment (IDE) configured for a Dev Environment.
   195  	Ides DevEnvironmentIdesInput
   196  	// The amount of time the Dev Environment will run without any activity detected before stopping, in minutes. Only whole integers are allowed. Dev Environments consume compute minutes when running.
   197  	InactivityTimeoutMinutes pulumi.IntPtrInput
   198  	// The Amazon EC2 instace type to use for the Dev Environment. Valid values include dev.standard1.small,dev.standard1.medium,dev.standard1.large,dev.standard1.xlarge
   199  	//
   200  	// The following arguments are optional:
   201  	InstanceType pulumi.StringInput
   202  	// Information about the amount of storage allocated to the Dev Environment.
   203  	PersistentStorage DevEnvironmentPersistentStorageInput
   204  	// The name of the project in the space.
   205  	ProjectName pulumi.StringInput
   206  	// The source repository that contains the branch to clone into the Dev Environment.
   207  	Repositories DevEnvironmentRepositoryArrayInput
   208  	// The name of the space.
   209  	SpaceName pulumi.StringInput
   210  }
   211  
   212  func (DevEnvironmentArgs) ElementType() reflect.Type {
   213  	return reflect.TypeOf((*devEnvironmentArgs)(nil)).Elem()
   214  }
   215  
   216  type DevEnvironmentInput interface {
   217  	pulumi.Input
   218  
   219  	ToDevEnvironmentOutput() DevEnvironmentOutput
   220  	ToDevEnvironmentOutputWithContext(ctx context.Context) DevEnvironmentOutput
   221  }
   222  
   223  func (*DevEnvironment) ElementType() reflect.Type {
   224  	return reflect.TypeOf((**DevEnvironment)(nil)).Elem()
   225  }
   226  
   227  func (i *DevEnvironment) ToDevEnvironmentOutput() DevEnvironmentOutput {
   228  	return i.ToDevEnvironmentOutputWithContext(context.Background())
   229  }
   230  
   231  func (i *DevEnvironment) ToDevEnvironmentOutputWithContext(ctx context.Context) DevEnvironmentOutput {
   232  	return pulumi.ToOutputWithContext(ctx, i).(DevEnvironmentOutput)
   233  }
   234  
   235  // DevEnvironmentArrayInput is an input type that accepts DevEnvironmentArray and DevEnvironmentArrayOutput values.
   236  // You can construct a concrete instance of `DevEnvironmentArrayInput` via:
   237  //
   238  //	DevEnvironmentArray{ DevEnvironmentArgs{...} }
   239  type DevEnvironmentArrayInput interface {
   240  	pulumi.Input
   241  
   242  	ToDevEnvironmentArrayOutput() DevEnvironmentArrayOutput
   243  	ToDevEnvironmentArrayOutputWithContext(context.Context) DevEnvironmentArrayOutput
   244  }
   245  
   246  type DevEnvironmentArray []DevEnvironmentInput
   247  
   248  func (DevEnvironmentArray) ElementType() reflect.Type {
   249  	return reflect.TypeOf((*[]*DevEnvironment)(nil)).Elem()
   250  }
   251  
   252  func (i DevEnvironmentArray) ToDevEnvironmentArrayOutput() DevEnvironmentArrayOutput {
   253  	return i.ToDevEnvironmentArrayOutputWithContext(context.Background())
   254  }
   255  
   256  func (i DevEnvironmentArray) ToDevEnvironmentArrayOutputWithContext(ctx context.Context) DevEnvironmentArrayOutput {
   257  	return pulumi.ToOutputWithContext(ctx, i).(DevEnvironmentArrayOutput)
   258  }
   259  
   260  // DevEnvironmentMapInput is an input type that accepts DevEnvironmentMap and DevEnvironmentMapOutput values.
   261  // You can construct a concrete instance of `DevEnvironmentMapInput` via:
   262  //
   263  //	DevEnvironmentMap{ "key": DevEnvironmentArgs{...} }
   264  type DevEnvironmentMapInput interface {
   265  	pulumi.Input
   266  
   267  	ToDevEnvironmentMapOutput() DevEnvironmentMapOutput
   268  	ToDevEnvironmentMapOutputWithContext(context.Context) DevEnvironmentMapOutput
   269  }
   270  
   271  type DevEnvironmentMap map[string]DevEnvironmentInput
   272  
   273  func (DevEnvironmentMap) ElementType() reflect.Type {
   274  	return reflect.TypeOf((*map[string]*DevEnvironment)(nil)).Elem()
   275  }
   276  
   277  func (i DevEnvironmentMap) ToDevEnvironmentMapOutput() DevEnvironmentMapOutput {
   278  	return i.ToDevEnvironmentMapOutputWithContext(context.Background())
   279  }
   280  
   281  func (i DevEnvironmentMap) ToDevEnvironmentMapOutputWithContext(ctx context.Context) DevEnvironmentMapOutput {
   282  	return pulumi.ToOutputWithContext(ctx, i).(DevEnvironmentMapOutput)
   283  }
   284  
   285  type DevEnvironmentOutput struct{ *pulumi.OutputState }
   286  
   287  func (DevEnvironmentOutput) ElementType() reflect.Type {
   288  	return reflect.TypeOf((**DevEnvironment)(nil)).Elem()
   289  }
   290  
   291  func (o DevEnvironmentOutput) ToDevEnvironmentOutput() DevEnvironmentOutput {
   292  	return o
   293  }
   294  
   295  func (o DevEnvironmentOutput) ToDevEnvironmentOutputWithContext(ctx context.Context) DevEnvironmentOutput {
   296  	return o
   297  }
   298  
   299  func (o DevEnvironmentOutput) Alias() pulumi.StringPtrOutput {
   300  	return o.ApplyT(func(v *DevEnvironment) pulumi.StringPtrOutput { return v.Alias }).(pulumi.StringPtrOutput)
   301  }
   302  
   303  // Information about the integrated development environment (IDE) configured for a Dev Environment.
   304  func (o DevEnvironmentOutput) Ides() DevEnvironmentIdesOutput {
   305  	return o.ApplyT(func(v *DevEnvironment) DevEnvironmentIdesOutput { return v.Ides }).(DevEnvironmentIdesOutput)
   306  }
   307  
   308  // The amount of time the Dev Environment will run without any activity detected before stopping, in minutes. Only whole integers are allowed. Dev Environments consume compute minutes when running.
   309  func (o DevEnvironmentOutput) InactivityTimeoutMinutes() pulumi.IntPtrOutput {
   310  	return o.ApplyT(func(v *DevEnvironment) pulumi.IntPtrOutput { return v.InactivityTimeoutMinutes }).(pulumi.IntPtrOutput)
   311  }
   312  
   313  // The Amazon EC2 instace type to use for the Dev Environment. Valid values include dev.standard1.small,dev.standard1.medium,dev.standard1.large,dev.standard1.xlarge
   314  //
   315  // The following arguments are optional:
   316  func (o DevEnvironmentOutput) InstanceType() pulumi.StringOutput {
   317  	return o.ApplyT(func(v *DevEnvironment) pulumi.StringOutput { return v.InstanceType }).(pulumi.StringOutput)
   318  }
   319  
   320  // Information about the amount of storage allocated to the Dev Environment.
   321  func (o DevEnvironmentOutput) PersistentStorage() DevEnvironmentPersistentStorageOutput {
   322  	return o.ApplyT(func(v *DevEnvironment) DevEnvironmentPersistentStorageOutput { return v.PersistentStorage }).(DevEnvironmentPersistentStorageOutput)
   323  }
   324  
   325  // The name of the project in the space.
   326  func (o DevEnvironmentOutput) ProjectName() pulumi.StringOutput {
   327  	return o.ApplyT(func(v *DevEnvironment) pulumi.StringOutput { return v.ProjectName }).(pulumi.StringOutput)
   328  }
   329  
   330  // The source repository that contains the branch to clone into the Dev Environment.
   331  func (o DevEnvironmentOutput) Repositories() DevEnvironmentRepositoryArrayOutput {
   332  	return o.ApplyT(func(v *DevEnvironment) DevEnvironmentRepositoryArrayOutput { return v.Repositories }).(DevEnvironmentRepositoryArrayOutput)
   333  }
   334  
   335  // The name of the space.
   336  func (o DevEnvironmentOutput) SpaceName() pulumi.StringOutput {
   337  	return o.ApplyT(func(v *DevEnvironment) pulumi.StringOutput { return v.SpaceName }).(pulumi.StringOutput)
   338  }
   339  
   340  type DevEnvironmentArrayOutput struct{ *pulumi.OutputState }
   341  
   342  func (DevEnvironmentArrayOutput) ElementType() reflect.Type {
   343  	return reflect.TypeOf((*[]*DevEnvironment)(nil)).Elem()
   344  }
   345  
   346  func (o DevEnvironmentArrayOutput) ToDevEnvironmentArrayOutput() DevEnvironmentArrayOutput {
   347  	return o
   348  }
   349  
   350  func (o DevEnvironmentArrayOutput) ToDevEnvironmentArrayOutputWithContext(ctx context.Context) DevEnvironmentArrayOutput {
   351  	return o
   352  }
   353  
   354  func (o DevEnvironmentArrayOutput) Index(i pulumi.IntInput) DevEnvironmentOutput {
   355  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DevEnvironment {
   356  		return vs[0].([]*DevEnvironment)[vs[1].(int)]
   357  	}).(DevEnvironmentOutput)
   358  }
   359  
   360  type DevEnvironmentMapOutput struct{ *pulumi.OutputState }
   361  
   362  func (DevEnvironmentMapOutput) ElementType() reflect.Type {
   363  	return reflect.TypeOf((*map[string]*DevEnvironment)(nil)).Elem()
   364  }
   365  
   366  func (o DevEnvironmentMapOutput) ToDevEnvironmentMapOutput() DevEnvironmentMapOutput {
   367  	return o
   368  }
   369  
   370  func (o DevEnvironmentMapOutput) ToDevEnvironmentMapOutputWithContext(ctx context.Context) DevEnvironmentMapOutput {
   371  	return o
   372  }
   373  
   374  func (o DevEnvironmentMapOutput) MapIndex(k pulumi.StringInput) DevEnvironmentOutput {
   375  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DevEnvironment {
   376  		return vs[0].(map[string]*DevEnvironment)[vs[1].(string)]
   377  	}).(DevEnvironmentOutput)
   378  }
   379  
   380  func init() {
   381  	pulumi.RegisterInputType(reflect.TypeOf((*DevEnvironmentInput)(nil)).Elem(), &DevEnvironment{})
   382  	pulumi.RegisterInputType(reflect.TypeOf((*DevEnvironmentArrayInput)(nil)).Elem(), DevEnvironmentArray{})
   383  	pulumi.RegisterInputType(reflect.TypeOf((*DevEnvironmentMapInput)(nil)).Elem(), DevEnvironmentMap{})
   384  	pulumi.RegisterOutputType(DevEnvironmentOutput{})
   385  	pulumi.RegisterOutputType(DevEnvironmentArrayOutput{})
   386  	pulumi.RegisterOutputType(DevEnvironmentMapOutput{})
   387  }