github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/apprunner/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 apprunner
     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  // Manages an App Runner Deployment Operation.
    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/apprunner"
    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 := apprunner.NewDeployment(ctx, "example", &apprunner.DeploymentArgs{
    33  //				ServiceArn: pulumi.Any(exampleAwsApprunnerService.Arn),
    34  //			})
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  type Deployment struct {
    45  	pulumi.CustomResourceState
    46  
    47  	// The unique ID of the operation associated with deployment.
    48  	OperationId pulumi.StringOutput `pulumi:"operationId"`
    49  	// The Amazon Resource Name (ARN) of the App Runner service to start the deployment for.
    50  	ServiceArn pulumi.StringOutput `pulumi:"serviceArn"`
    51  	// The current status of the App Runner service deployment.
    52  	Status   pulumi.StringOutput         `pulumi:"status"`
    53  	Timeouts DeploymentTimeoutsPtrOutput `pulumi:"timeouts"`
    54  }
    55  
    56  // NewDeployment registers a new resource with the given unique name, arguments, and options.
    57  func NewDeployment(ctx *pulumi.Context,
    58  	name string, args *DeploymentArgs, opts ...pulumi.ResourceOption) (*Deployment, error) {
    59  	if args == nil {
    60  		return nil, errors.New("missing one or more required arguments")
    61  	}
    62  
    63  	if args.ServiceArn == nil {
    64  		return nil, errors.New("invalid value for required argument 'ServiceArn'")
    65  	}
    66  	opts = internal.PkgResourceDefaultOpts(opts)
    67  	var resource Deployment
    68  	err := ctx.RegisterResource("aws:apprunner/deployment:Deployment", name, args, &resource, opts...)
    69  	if err != nil {
    70  		return nil, err
    71  	}
    72  	return &resource, nil
    73  }
    74  
    75  // GetDeployment gets an existing Deployment resource's state with the given name, ID, and optional
    76  // state properties that are used to uniquely qualify the lookup (nil if not required).
    77  func GetDeployment(ctx *pulumi.Context,
    78  	name string, id pulumi.IDInput, state *DeploymentState, opts ...pulumi.ResourceOption) (*Deployment, error) {
    79  	var resource Deployment
    80  	err := ctx.ReadResource("aws:apprunner/deployment:Deployment", name, id, state, &resource, opts...)
    81  	if err != nil {
    82  		return nil, err
    83  	}
    84  	return &resource, nil
    85  }
    86  
    87  // Input properties used for looking up and filtering Deployment resources.
    88  type deploymentState struct {
    89  	// The unique ID of the operation associated with deployment.
    90  	OperationId *string `pulumi:"operationId"`
    91  	// The Amazon Resource Name (ARN) of the App Runner service to start the deployment for.
    92  	ServiceArn *string `pulumi:"serviceArn"`
    93  	// The current status of the App Runner service deployment.
    94  	Status   *string             `pulumi:"status"`
    95  	Timeouts *DeploymentTimeouts `pulumi:"timeouts"`
    96  }
    97  
    98  type DeploymentState struct {
    99  	// The unique ID of the operation associated with deployment.
   100  	OperationId pulumi.StringPtrInput
   101  	// The Amazon Resource Name (ARN) of the App Runner service to start the deployment for.
   102  	ServiceArn pulumi.StringPtrInput
   103  	// The current status of the App Runner service deployment.
   104  	Status   pulumi.StringPtrInput
   105  	Timeouts DeploymentTimeoutsPtrInput
   106  }
   107  
   108  func (DeploymentState) ElementType() reflect.Type {
   109  	return reflect.TypeOf((*deploymentState)(nil)).Elem()
   110  }
   111  
   112  type deploymentArgs struct {
   113  	// The Amazon Resource Name (ARN) of the App Runner service to start the deployment for.
   114  	ServiceArn string              `pulumi:"serviceArn"`
   115  	Timeouts   *DeploymentTimeouts `pulumi:"timeouts"`
   116  }
   117  
   118  // The set of arguments for constructing a Deployment resource.
   119  type DeploymentArgs struct {
   120  	// The Amazon Resource Name (ARN) of the App Runner service to start the deployment for.
   121  	ServiceArn pulumi.StringInput
   122  	Timeouts   DeploymentTimeoutsPtrInput
   123  }
   124  
   125  func (DeploymentArgs) ElementType() reflect.Type {
   126  	return reflect.TypeOf((*deploymentArgs)(nil)).Elem()
   127  }
   128  
   129  type DeploymentInput interface {
   130  	pulumi.Input
   131  
   132  	ToDeploymentOutput() DeploymentOutput
   133  	ToDeploymentOutputWithContext(ctx context.Context) DeploymentOutput
   134  }
   135  
   136  func (*Deployment) ElementType() reflect.Type {
   137  	return reflect.TypeOf((**Deployment)(nil)).Elem()
   138  }
   139  
   140  func (i *Deployment) ToDeploymentOutput() DeploymentOutput {
   141  	return i.ToDeploymentOutputWithContext(context.Background())
   142  }
   143  
   144  func (i *Deployment) ToDeploymentOutputWithContext(ctx context.Context) DeploymentOutput {
   145  	return pulumi.ToOutputWithContext(ctx, i).(DeploymentOutput)
   146  }
   147  
   148  // DeploymentArrayInput is an input type that accepts DeploymentArray and DeploymentArrayOutput values.
   149  // You can construct a concrete instance of `DeploymentArrayInput` via:
   150  //
   151  //	DeploymentArray{ DeploymentArgs{...} }
   152  type DeploymentArrayInput interface {
   153  	pulumi.Input
   154  
   155  	ToDeploymentArrayOutput() DeploymentArrayOutput
   156  	ToDeploymentArrayOutputWithContext(context.Context) DeploymentArrayOutput
   157  }
   158  
   159  type DeploymentArray []DeploymentInput
   160  
   161  func (DeploymentArray) ElementType() reflect.Type {
   162  	return reflect.TypeOf((*[]*Deployment)(nil)).Elem()
   163  }
   164  
   165  func (i DeploymentArray) ToDeploymentArrayOutput() DeploymentArrayOutput {
   166  	return i.ToDeploymentArrayOutputWithContext(context.Background())
   167  }
   168  
   169  func (i DeploymentArray) ToDeploymentArrayOutputWithContext(ctx context.Context) DeploymentArrayOutput {
   170  	return pulumi.ToOutputWithContext(ctx, i).(DeploymentArrayOutput)
   171  }
   172  
   173  // DeploymentMapInput is an input type that accepts DeploymentMap and DeploymentMapOutput values.
   174  // You can construct a concrete instance of `DeploymentMapInput` via:
   175  //
   176  //	DeploymentMap{ "key": DeploymentArgs{...} }
   177  type DeploymentMapInput interface {
   178  	pulumi.Input
   179  
   180  	ToDeploymentMapOutput() DeploymentMapOutput
   181  	ToDeploymentMapOutputWithContext(context.Context) DeploymentMapOutput
   182  }
   183  
   184  type DeploymentMap map[string]DeploymentInput
   185  
   186  func (DeploymentMap) ElementType() reflect.Type {
   187  	return reflect.TypeOf((*map[string]*Deployment)(nil)).Elem()
   188  }
   189  
   190  func (i DeploymentMap) ToDeploymentMapOutput() DeploymentMapOutput {
   191  	return i.ToDeploymentMapOutputWithContext(context.Background())
   192  }
   193  
   194  func (i DeploymentMap) ToDeploymentMapOutputWithContext(ctx context.Context) DeploymentMapOutput {
   195  	return pulumi.ToOutputWithContext(ctx, i).(DeploymentMapOutput)
   196  }
   197  
   198  type DeploymentOutput struct{ *pulumi.OutputState }
   199  
   200  func (DeploymentOutput) ElementType() reflect.Type {
   201  	return reflect.TypeOf((**Deployment)(nil)).Elem()
   202  }
   203  
   204  func (o DeploymentOutput) ToDeploymentOutput() DeploymentOutput {
   205  	return o
   206  }
   207  
   208  func (o DeploymentOutput) ToDeploymentOutputWithContext(ctx context.Context) DeploymentOutput {
   209  	return o
   210  }
   211  
   212  // The unique ID of the operation associated with deployment.
   213  func (o DeploymentOutput) OperationId() pulumi.StringOutput {
   214  	return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.OperationId }).(pulumi.StringOutput)
   215  }
   216  
   217  // The Amazon Resource Name (ARN) of the App Runner service to start the deployment for.
   218  func (o DeploymentOutput) ServiceArn() pulumi.StringOutput {
   219  	return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.ServiceArn }).(pulumi.StringOutput)
   220  }
   221  
   222  // The current status of the App Runner service deployment.
   223  func (o DeploymentOutput) Status() pulumi.StringOutput {
   224  	return o.ApplyT(func(v *Deployment) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
   225  }
   226  
   227  func (o DeploymentOutput) Timeouts() DeploymentTimeoutsPtrOutput {
   228  	return o.ApplyT(func(v *Deployment) DeploymentTimeoutsPtrOutput { return v.Timeouts }).(DeploymentTimeoutsPtrOutput)
   229  }
   230  
   231  type DeploymentArrayOutput struct{ *pulumi.OutputState }
   232  
   233  func (DeploymentArrayOutput) ElementType() reflect.Type {
   234  	return reflect.TypeOf((*[]*Deployment)(nil)).Elem()
   235  }
   236  
   237  func (o DeploymentArrayOutput) ToDeploymentArrayOutput() DeploymentArrayOutput {
   238  	return o
   239  }
   240  
   241  func (o DeploymentArrayOutput) ToDeploymentArrayOutputWithContext(ctx context.Context) DeploymentArrayOutput {
   242  	return o
   243  }
   244  
   245  func (o DeploymentArrayOutput) Index(i pulumi.IntInput) DeploymentOutput {
   246  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Deployment {
   247  		return vs[0].([]*Deployment)[vs[1].(int)]
   248  	}).(DeploymentOutput)
   249  }
   250  
   251  type DeploymentMapOutput struct{ *pulumi.OutputState }
   252  
   253  func (DeploymentMapOutput) ElementType() reflect.Type {
   254  	return reflect.TypeOf((*map[string]*Deployment)(nil)).Elem()
   255  }
   256  
   257  func (o DeploymentMapOutput) ToDeploymentMapOutput() DeploymentMapOutput {
   258  	return o
   259  }
   260  
   261  func (o DeploymentMapOutput) ToDeploymentMapOutputWithContext(ctx context.Context) DeploymentMapOutput {
   262  	return o
   263  }
   264  
   265  func (o DeploymentMapOutput) MapIndex(k pulumi.StringInput) DeploymentOutput {
   266  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Deployment {
   267  		return vs[0].(map[string]*Deployment)[vs[1].(string)]
   268  	}).(DeploymentOutput)
   269  }
   270  
   271  func init() {
   272  	pulumi.RegisterInputType(reflect.TypeOf((*DeploymentInput)(nil)).Elem(), &Deployment{})
   273  	pulumi.RegisterInputType(reflect.TypeOf((*DeploymentArrayInput)(nil)).Elem(), DeploymentArray{})
   274  	pulumi.RegisterInputType(reflect.TypeOf((*DeploymentMapInput)(nil)).Elem(), DeploymentMap{})
   275  	pulumi.RegisterOutputType(DeploymentOutput{})
   276  	pulumi.RegisterOutputType(DeploymentArrayOutput{})
   277  	pulumi.RegisterOutputType(DeploymentMapOutput{})
   278  }