github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/m2/deployment.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 m2
     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 Mainframe Modernization Deployment.](https://docs.aws.amazon.com/m2/latest/userguide/applications-m2-deploy.html)
    16  //
    17  // ## Example Usage
    18  //
    19  // ### Basic Usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/m2"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  //
    32  //	func main() {
    33  //		pulumi.Run(func(ctx *pulumi.Context) error {
    34  //			_, err := m2.NewDeployment(ctx, "test", &m2.DeploymentArgs{
    35  //				EnvironmentId:      pulumi.String("01234567890abcdef012345678"),
    36  //				ApplicationId:      pulumi.String("34567890abcdef012345678012"),
    37  //				ApplicationVersion: pulumi.Int(1),
    38  //				Start:              pulumi.Bool(true),
    39  //			})
    40  //			if err != nil {
    41  //				return err
    42  //			}
    43  //			return nil
    44  //		})
    45  //	}
    46  //
    47  // ```
    48  // <!--End PulumiCodeChooser -->
    49  //
    50  // ## Import
    51  //
    52  // Using `pulumi import`, import Mainframe Modernization Deployment using the `APPLICATION-ID,DEPLOYMENT-ID`. For example:
    53  //
    54  // ```sh
    55  // $ pulumi import aws:m2/deployment:Deployment example APPLICATION-ID,DEPLOYMENT-ID
    56  // ```
    57  type Deployment struct {
    58  	pulumi.CustomResourceState
    59  
    60  	// Application to deploy.
    61  	ApplicationId pulumi.StringOutput `pulumi:"applicationId"`
    62  	// Version to application to deploy
    63  	ApplicationVersion pulumi.IntOutput    `pulumi:"applicationVersion"`
    64  	DeploymentId       pulumi.StringOutput `pulumi:"deploymentId"`
    65  	// Environment to deploy application to.
    66  	EnvironmentId pulumi.StringOutput  `pulumi:"environmentId"`
    67  	ForceStop     pulumi.BoolPtrOutput `pulumi:"forceStop"`
    68  	// Start the application once deployed.
    69  	Start    pulumi.BoolOutput           `pulumi:"start"`
    70  	Timeouts DeploymentTimeoutsPtrOutput `pulumi:"timeouts"`
    71  }
    72  
    73  // NewDeployment registers a new resource with the given unique name, arguments, and options.
    74  func NewDeployment(ctx *pulumi.Context,
    75  	name string, args *DeploymentArgs, opts ...pulumi.ResourceOption) (*Deployment, error) {
    76  	if args == nil {
    77  		return nil, errors.New("missing one or more required arguments")
    78  	}
    79  
    80  	if args.ApplicationId == nil {
    81  		return nil, errors.New("invalid value for required argument 'ApplicationId'")
    82  	}
    83  	if args.ApplicationVersion == nil {
    84  		return nil, errors.New("invalid value for required argument 'ApplicationVersion'")
    85  	}
    86  	if args.EnvironmentId == nil {
    87  		return nil, errors.New("invalid value for required argument 'EnvironmentId'")
    88  	}
    89  	if args.Start == nil {
    90  		return nil, errors.New("invalid value for required argument 'Start'")
    91  	}
    92  	opts = internal.PkgResourceDefaultOpts(opts)
    93  	var resource Deployment
    94  	err := ctx.RegisterResource("aws:m2/deployment:Deployment", name, args, &resource, opts...)
    95  	if err != nil {
    96  		return nil, err
    97  	}
    98  	return &resource, nil
    99  }
   100  
   101  // GetDeployment gets an existing Deployment resource's state with the given name, ID, and optional
   102  // state properties that are used to uniquely qualify the lookup (nil if not required).
   103  func GetDeployment(ctx *pulumi.Context,
   104  	name string, id pulumi.IDInput, state *DeploymentState, opts ...pulumi.ResourceOption) (*Deployment, error) {
   105  	var resource Deployment
   106  	err := ctx.ReadResource("aws:m2/deployment:Deployment", name, id, state, &resource, opts...)
   107  	if err != nil {
   108  		return nil, err
   109  	}
   110  	return &resource, nil
   111  }
   112  
   113  // Input properties used for looking up and filtering Deployment resources.
   114  type deploymentState struct {
   115  	// Application to deploy.
   116  	ApplicationId *string `pulumi:"applicationId"`
   117  	// Version to application to deploy
   118  	ApplicationVersion *int    `pulumi:"applicationVersion"`
   119  	DeploymentId       *string `pulumi:"deploymentId"`
   120  	// Environment to deploy application to.
   121  	EnvironmentId *string `pulumi:"environmentId"`
   122  	ForceStop     *bool   `pulumi:"forceStop"`
   123  	// Start the application once deployed.
   124  	Start    *bool               `pulumi:"start"`
   125  	Timeouts *DeploymentTimeouts `pulumi:"timeouts"`
   126  }
   127  
   128  type DeploymentState struct {
   129  	// Application to deploy.
   130  	ApplicationId pulumi.StringPtrInput
   131  	// Version to application to deploy
   132  	ApplicationVersion pulumi.IntPtrInput
   133  	DeploymentId       pulumi.StringPtrInput
   134  	// Environment to deploy application to.
   135  	EnvironmentId pulumi.StringPtrInput
   136  	ForceStop     pulumi.BoolPtrInput
   137  	// Start the application once deployed.
   138  	Start    pulumi.BoolPtrInput
   139  	Timeouts DeploymentTimeoutsPtrInput
   140  }
   141  
   142  func (DeploymentState) ElementType() reflect.Type {
   143  	return reflect.TypeOf((*deploymentState)(nil)).Elem()
   144  }
   145  
   146  type deploymentArgs struct {
   147  	// Application to deploy.
   148  	ApplicationId string `pulumi:"applicationId"`
   149  	// Version to application to deploy
   150  	ApplicationVersion int `pulumi:"applicationVersion"`
   151  	// Environment to deploy application to.
   152  	EnvironmentId string `pulumi:"environmentId"`
   153  	ForceStop     *bool  `pulumi:"forceStop"`
   154  	// Start the application once deployed.
   155  	Start    bool                `pulumi:"start"`
   156  	Timeouts *DeploymentTimeouts `pulumi:"timeouts"`
   157  }
   158  
   159  // The set of arguments for constructing a Deployment resource.
   160  type DeploymentArgs struct {
   161  	// Application to deploy.
   162  	ApplicationId pulumi.StringInput
   163  	// Version to application to deploy
   164  	ApplicationVersion pulumi.IntInput
   165  	// Environment to deploy application to.
   166  	EnvironmentId pulumi.StringInput
   167  	ForceStop     pulumi.BoolPtrInput
   168  	// Start the application once deployed.
   169  	Start    pulumi.BoolInput
   170  	Timeouts DeploymentTimeoutsPtrInput
   171  }
   172  
   173  func (DeploymentArgs) ElementType() reflect.Type {
   174  	return reflect.TypeOf((*deploymentArgs)(nil)).Elem()
   175  }
   176  
   177  type DeploymentInput interface {
   178  	pulumi.Input
   179  
   180  	ToDeploymentOutput() DeploymentOutput
   181  	ToDeploymentOutputWithContext(ctx context.Context) DeploymentOutput
   182  }
   183  
   184  func (*Deployment) ElementType() reflect.Type {
   185  	return reflect.TypeOf((**Deployment)(nil)).Elem()
   186  }
   187  
   188  func (i *Deployment) ToDeploymentOutput() DeploymentOutput {
   189  	return i.ToDeploymentOutputWithContext(context.Background())
   190  }
   191  
   192  func (i *Deployment) ToDeploymentOutputWithContext(ctx context.Context) DeploymentOutput {
   193  	return pulumi.ToOutputWithContext(ctx, i).(DeploymentOutput)
   194  }
   195  
   196  // DeploymentArrayInput is an input type that accepts DeploymentArray and DeploymentArrayOutput values.
   197  // You can construct a concrete instance of `DeploymentArrayInput` via:
   198  //
   199  //	DeploymentArray{ DeploymentArgs{...} }
   200  type DeploymentArrayInput interface {
   201  	pulumi.Input
   202  
   203  	ToDeploymentArrayOutput() DeploymentArrayOutput
   204  	ToDeploymentArrayOutputWithContext(context.Context) DeploymentArrayOutput
   205  }
   206  
   207  type DeploymentArray []DeploymentInput
   208  
   209  func (DeploymentArray) ElementType() reflect.Type {
   210  	return reflect.TypeOf((*[]*Deployment)(nil)).Elem()
   211  }
   212  
   213  func (i DeploymentArray) ToDeploymentArrayOutput() DeploymentArrayOutput {
   214  	return i.ToDeploymentArrayOutputWithContext(context.Background())
   215  }
   216  
   217  func (i DeploymentArray) ToDeploymentArrayOutputWithContext(ctx context.Context) DeploymentArrayOutput {
   218  	return pulumi.ToOutputWithContext(ctx, i).(DeploymentArrayOutput)
   219  }
   220  
   221  // DeploymentMapInput is an input type that accepts DeploymentMap and DeploymentMapOutput values.
   222  // You can construct a concrete instance of `DeploymentMapInput` via:
   223  //
   224  //	DeploymentMap{ "key": DeploymentArgs{...} }
   225  type DeploymentMapInput interface {
   226  	pulumi.Input
   227  
   228  	ToDeploymentMapOutput() DeploymentMapOutput
   229  	ToDeploymentMapOutputWithContext(context.Context) DeploymentMapOutput
   230  }
   231  
   232  type DeploymentMap map[string]DeploymentInput
   233  
   234  func (DeploymentMap) ElementType() reflect.Type {
   235  	return reflect.TypeOf((*map[string]*Deployment)(nil)).Elem()
   236  }
   237  
   238  func (i DeploymentMap) ToDeploymentMapOutput() DeploymentMapOutput {
   239  	return i.ToDeploymentMapOutputWithContext(context.Background())
   240  }
   241  
   242  func (i DeploymentMap) ToDeploymentMapOutputWithContext(ctx context.Context) DeploymentMapOutput {
   243  	return pulumi.ToOutputWithContext(ctx, i).(DeploymentMapOutput)
   244  }
   245  
   246  type DeploymentOutput struct{ *pulumi.OutputState }
   247  
   248  func (DeploymentOutput) ElementType() reflect.Type {
   249  	return reflect.TypeOf((**Deployment)(nil)).Elem()
   250  }
   251  
   252  func (o DeploymentOutput) ToDeploymentOutput() DeploymentOutput {
   253  	return o
   254  }
   255  
   256  func (o DeploymentOutput) ToDeploymentOutputWithContext(ctx context.Context) DeploymentOutput {
   257  	return o
   258  }
   259  
   260  // Application to deploy.
   261  func (o DeploymentOutput) ApplicationId() pulumi.StringOutput {
   262  	return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.ApplicationId }).(pulumi.StringOutput)
   263  }
   264  
   265  // Version to application to deploy
   266  func (o DeploymentOutput) ApplicationVersion() pulumi.IntOutput {
   267  	return o.ApplyT(func(v *Deployment) pulumi.IntOutput { return v.ApplicationVersion }).(pulumi.IntOutput)
   268  }
   269  
   270  func (o DeploymentOutput) DeploymentId() pulumi.StringOutput {
   271  	return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.DeploymentId }).(pulumi.StringOutput)
   272  }
   273  
   274  // Environment to deploy application to.
   275  func (o DeploymentOutput) EnvironmentId() pulumi.StringOutput {
   276  	return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.EnvironmentId }).(pulumi.StringOutput)
   277  }
   278  
   279  func (o DeploymentOutput) ForceStop() pulumi.BoolPtrOutput {
   280  	return o.ApplyT(func(v *Deployment) pulumi.BoolPtrOutput { return v.ForceStop }).(pulumi.BoolPtrOutput)
   281  }
   282  
   283  // Start the application once deployed.
   284  func (o DeploymentOutput) Start() pulumi.BoolOutput {
   285  	return o.ApplyT(func(v *Deployment) pulumi.BoolOutput { return v.Start }).(pulumi.BoolOutput)
   286  }
   287  
   288  func (o DeploymentOutput) Timeouts() DeploymentTimeoutsPtrOutput {
   289  	return o.ApplyT(func(v *Deployment) DeploymentTimeoutsPtrOutput { return v.Timeouts }).(DeploymentTimeoutsPtrOutput)
   290  }
   291  
   292  type DeploymentArrayOutput struct{ *pulumi.OutputState }
   293  
   294  func (DeploymentArrayOutput) ElementType() reflect.Type {
   295  	return reflect.TypeOf((*[]*Deployment)(nil)).Elem()
   296  }
   297  
   298  func (o DeploymentArrayOutput) ToDeploymentArrayOutput() DeploymentArrayOutput {
   299  	return o
   300  }
   301  
   302  func (o DeploymentArrayOutput) ToDeploymentArrayOutputWithContext(ctx context.Context) DeploymentArrayOutput {
   303  	return o
   304  }
   305  
   306  func (o DeploymentArrayOutput) Index(i pulumi.IntInput) DeploymentOutput {
   307  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Deployment {
   308  		return vs[0].([]*Deployment)[vs[1].(int)]
   309  	}).(DeploymentOutput)
   310  }
   311  
   312  type DeploymentMapOutput struct{ *pulumi.OutputState }
   313  
   314  func (DeploymentMapOutput) ElementType() reflect.Type {
   315  	return reflect.TypeOf((*map[string]*Deployment)(nil)).Elem()
   316  }
   317  
   318  func (o DeploymentMapOutput) ToDeploymentMapOutput() DeploymentMapOutput {
   319  	return o
   320  }
   321  
   322  func (o DeploymentMapOutput) ToDeploymentMapOutputWithContext(ctx context.Context) DeploymentMapOutput {
   323  	return o
   324  }
   325  
   326  func (o DeploymentMapOutput) MapIndex(k pulumi.StringInput) DeploymentOutput {
   327  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Deployment {
   328  		return vs[0].(map[string]*Deployment)[vs[1].(string)]
   329  	}).(DeploymentOutput)
   330  }
   331  
   332  func init() {
   333  	pulumi.RegisterInputType(reflect.TypeOf((*DeploymentInput)(nil)).Elem(), &Deployment{})
   334  	pulumi.RegisterInputType(reflect.TypeOf((*DeploymentArrayInput)(nil)).Elem(), DeploymentArray{})
   335  	pulumi.RegisterInputType(reflect.TypeOf((*DeploymentMapInput)(nil)).Elem(), DeploymentMap{})
   336  	pulumi.RegisterOutputType(DeploymentOutput{})
   337  	pulumi.RegisterOutputType(DeploymentArrayOutput{})
   338  	pulumi.RegisterOutputType(DeploymentMapOutput{})
   339  }