github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/lightsail/containerServiceDeploymentVersion.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 lightsail
     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  // Provides a resource to manage a deployment version for your Amazon Lightsail container service.
    16  //
    17  // > **NOTE:** The Amazon Lightsail container service must be enabled to create a deployment.
    18  //
    19  // > **NOTE:** This resource allows you to manage an Amazon Lightsail container service deployment version but the provider cannot destroy it. Removing this resource from your configuration will remove it from your statefile.
    20  //
    21  // ## Example Usage
    22  //
    23  // ### Basic Usage
    24  //
    25  // <!--Start PulumiCodeChooser -->
    26  // ```go
    27  // package main
    28  //
    29  // import (
    30  //
    31  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail"
    32  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    33  //
    34  // )
    35  //
    36  //	func main() {
    37  //		pulumi.Run(func(ctx *pulumi.Context) error {
    38  //			_, err := lightsail.NewContainerServiceDeploymentVersion(ctx, "example", &lightsail.ContainerServiceDeploymentVersionArgs{
    39  //				Containers: lightsail.ContainerServiceDeploymentVersionContainerArray{
    40  //					&lightsail.ContainerServiceDeploymentVersionContainerArgs{
    41  //						ContainerName: pulumi.String("hello-world"),
    42  //						Image:         pulumi.String("amazon/amazon-lightsail:hello-world"),
    43  //						Commands:      pulumi.StringArray{},
    44  //						Environment: pulumi.StringMap{
    45  //							"MY_ENVIRONMENT_VARIABLE": pulumi.String("my_value"),
    46  //						},
    47  //						Ports: pulumi.StringMap{
    48  //							"80": pulumi.String("HTTP"),
    49  //						},
    50  //					},
    51  //				},
    52  //				PublicEndpoint: &lightsail.ContainerServiceDeploymentVersionPublicEndpointArgs{
    53  //					ContainerName: pulumi.String("hello-world"),
    54  //					ContainerPort: pulumi.Int(80),
    55  //					HealthCheck: &lightsail.ContainerServiceDeploymentVersionPublicEndpointHealthCheckArgs{
    56  //						HealthyThreshold:   pulumi.Int(2),
    57  //						UnhealthyThreshold: pulumi.Int(2),
    58  //						TimeoutSeconds:     pulumi.Int(2),
    59  //						IntervalSeconds:    pulumi.Int(5),
    60  //						Path:               pulumi.String("/"),
    61  //						SuccessCodes:       pulumi.String("200-499"),
    62  //					},
    63  //				},
    64  //				ServiceName: pulumi.Any(exampleAwsLightsailContainerService.Name),
    65  //			})
    66  //			if err != nil {
    67  //				return err
    68  //			}
    69  //			return nil
    70  //		})
    71  //	}
    72  //
    73  // ```
    74  // <!--End PulumiCodeChooser -->
    75  //
    76  // ## Import
    77  //
    78  // Using `pulumi import`, import Lightsail Container Service Deployment Version using the `service_name` and `version` separated by a slash (`/`). For example:
    79  //
    80  // ```sh
    81  // $ pulumi import aws:lightsail/containerServiceDeploymentVersion:ContainerServiceDeploymentVersion example container-service-1/1
    82  // ```
    83  type ContainerServiceDeploymentVersion struct {
    84  	pulumi.CustomResourceState
    85  
    86  	// A set of configuration blocks that describe the settings of the containers that will be launched on the container service. Maximum of 53. Detailed below.
    87  	Containers ContainerServiceDeploymentVersionContainerArrayOutput `pulumi:"containers"`
    88  	// The timestamp when the deployment was created.
    89  	CreatedAt pulumi.StringOutput `pulumi:"createdAt"`
    90  	// A configuration block that describes the settings of the public endpoint for the container service. Detailed below.
    91  	PublicEndpoint ContainerServiceDeploymentVersionPublicEndpointPtrOutput `pulumi:"publicEndpoint"`
    92  	// The name for the container service.
    93  	ServiceName pulumi.StringOutput `pulumi:"serviceName"`
    94  	// The current state of the container service.
    95  	State pulumi.StringOutput `pulumi:"state"`
    96  	// The version number of the deployment.
    97  	Version pulumi.IntOutput `pulumi:"version"`
    98  }
    99  
   100  // NewContainerServiceDeploymentVersion registers a new resource with the given unique name, arguments, and options.
   101  func NewContainerServiceDeploymentVersion(ctx *pulumi.Context,
   102  	name string, args *ContainerServiceDeploymentVersionArgs, opts ...pulumi.ResourceOption) (*ContainerServiceDeploymentVersion, error) {
   103  	if args == nil {
   104  		return nil, errors.New("missing one or more required arguments")
   105  	}
   106  
   107  	if args.Containers == nil {
   108  		return nil, errors.New("invalid value for required argument 'Containers'")
   109  	}
   110  	if args.ServiceName == nil {
   111  		return nil, errors.New("invalid value for required argument 'ServiceName'")
   112  	}
   113  	opts = internal.PkgResourceDefaultOpts(opts)
   114  	var resource ContainerServiceDeploymentVersion
   115  	err := ctx.RegisterResource("aws:lightsail/containerServiceDeploymentVersion:ContainerServiceDeploymentVersion", name, args, &resource, opts...)
   116  	if err != nil {
   117  		return nil, err
   118  	}
   119  	return &resource, nil
   120  }
   121  
   122  // GetContainerServiceDeploymentVersion gets an existing ContainerServiceDeploymentVersion resource's state with the given name, ID, and optional
   123  // state properties that are used to uniquely qualify the lookup (nil if not required).
   124  func GetContainerServiceDeploymentVersion(ctx *pulumi.Context,
   125  	name string, id pulumi.IDInput, state *ContainerServiceDeploymentVersionState, opts ...pulumi.ResourceOption) (*ContainerServiceDeploymentVersion, error) {
   126  	var resource ContainerServiceDeploymentVersion
   127  	err := ctx.ReadResource("aws:lightsail/containerServiceDeploymentVersion:ContainerServiceDeploymentVersion", name, id, state, &resource, opts...)
   128  	if err != nil {
   129  		return nil, err
   130  	}
   131  	return &resource, nil
   132  }
   133  
   134  // Input properties used for looking up and filtering ContainerServiceDeploymentVersion resources.
   135  type containerServiceDeploymentVersionState struct {
   136  	// A set of configuration blocks that describe the settings of the containers that will be launched on the container service. Maximum of 53. Detailed below.
   137  	Containers []ContainerServiceDeploymentVersionContainer `pulumi:"containers"`
   138  	// The timestamp when the deployment was created.
   139  	CreatedAt *string `pulumi:"createdAt"`
   140  	// A configuration block that describes the settings of the public endpoint for the container service. Detailed below.
   141  	PublicEndpoint *ContainerServiceDeploymentVersionPublicEndpoint `pulumi:"publicEndpoint"`
   142  	// The name for the container service.
   143  	ServiceName *string `pulumi:"serviceName"`
   144  	// The current state of the container service.
   145  	State *string `pulumi:"state"`
   146  	// The version number of the deployment.
   147  	Version *int `pulumi:"version"`
   148  }
   149  
   150  type ContainerServiceDeploymentVersionState struct {
   151  	// A set of configuration blocks that describe the settings of the containers that will be launched on the container service. Maximum of 53. Detailed below.
   152  	Containers ContainerServiceDeploymentVersionContainerArrayInput
   153  	// The timestamp when the deployment was created.
   154  	CreatedAt pulumi.StringPtrInput
   155  	// A configuration block that describes the settings of the public endpoint for the container service. Detailed below.
   156  	PublicEndpoint ContainerServiceDeploymentVersionPublicEndpointPtrInput
   157  	// The name for the container service.
   158  	ServiceName pulumi.StringPtrInput
   159  	// The current state of the container service.
   160  	State pulumi.StringPtrInput
   161  	// The version number of the deployment.
   162  	Version pulumi.IntPtrInput
   163  }
   164  
   165  func (ContainerServiceDeploymentVersionState) ElementType() reflect.Type {
   166  	return reflect.TypeOf((*containerServiceDeploymentVersionState)(nil)).Elem()
   167  }
   168  
   169  type containerServiceDeploymentVersionArgs struct {
   170  	// A set of configuration blocks that describe the settings of the containers that will be launched on the container service. Maximum of 53. Detailed below.
   171  	Containers []ContainerServiceDeploymentVersionContainer `pulumi:"containers"`
   172  	// A configuration block that describes the settings of the public endpoint for the container service. Detailed below.
   173  	PublicEndpoint *ContainerServiceDeploymentVersionPublicEndpoint `pulumi:"publicEndpoint"`
   174  	// The name for the container service.
   175  	ServiceName string `pulumi:"serviceName"`
   176  }
   177  
   178  // The set of arguments for constructing a ContainerServiceDeploymentVersion resource.
   179  type ContainerServiceDeploymentVersionArgs struct {
   180  	// A set of configuration blocks that describe the settings of the containers that will be launched on the container service. Maximum of 53. Detailed below.
   181  	Containers ContainerServiceDeploymentVersionContainerArrayInput
   182  	// A configuration block that describes the settings of the public endpoint for the container service. Detailed below.
   183  	PublicEndpoint ContainerServiceDeploymentVersionPublicEndpointPtrInput
   184  	// The name for the container service.
   185  	ServiceName pulumi.StringInput
   186  }
   187  
   188  func (ContainerServiceDeploymentVersionArgs) ElementType() reflect.Type {
   189  	return reflect.TypeOf((*containerServiceDeploymentVersionArgs)(nil)).Elem()
   190  }
   191  
   192  type ContainerServiceDeploymentVersionInput interface {
   193  	pulumi.Input
   194  
   195  	ToContainerServiceDeploymentVersionOutput() ContainerServiceDeploymentVersionOutput
   196  	ToContainerServiceDeploymentVersionOutputWithContext(ctx context.Context) ContainerServiceDeploymentVersionOutput
   197  }
   198  
   199  func (*ContainerServiceDeploymentVersion) ElementType() reflect.Type {
   200  	return reflect.TypeOf((**ContainerServiceDeploymentVersion)(nil)).Elem()
   201  }
   202  
   203  func (i *ContainerServiceDeploymentVersion) ToContainerServiceDeploymentVersionOutput() ContainerServiceDeploymentVersionOutput {
   204  	return i.ToContainerServiceDeploymentVersionOutputWithContext(context.Background())
   205  }
   206  
   207  func (i *ContainerServiceDeploymentVersion) ToContainerServiceDeploymentVersionOutputWithContext(ctx context.Context) ContainerServiceDeploymentVersionOutput {
   208  	return pulumi.ToOutputWithContext(ctx, i).(ContainerServiceDeploymentVersionOutput)
   209  }
   210  
   211  // ContainerServiceDeploymentVersionArrayInput is an input type that accepts ContainerServiceDeploymentVersionArray and ContainerServiceDeploymentVersionArrayOutput values.
   212  // You can construct a concrete instance of `ContainerServiceDeploymentVersionArrayInput` via:
   213  //
   214  //	ContainerServiceDeploymentVersionArray{ ContainerServiceDeploymentVersionArgs{...} }
   215  type ContainerServiceDeploymentVersionArrayInput interface {
   216  	pulumi.Input
   217  
   218  	ToContainerServiceDeploymentVersionArrayOutput() ContainerServiceDeploymentVersionArrayOutput
   219  	ToContainerServiceDeploymentVersionArrayOutputWithContext(context.Context) ContainerServiceDeploymentVersionArrayOutput
   220  }
   221  
   222  type ContainerServiceDeploymentVersionArray []ContainerServiceDeploymentVersionInput
   223  
   224  func (ContainerServiceDeploymentVersionArray) ElementType() reflect.Type {
   225  	return reflect.TypeOf((*[]*ContainerServiceDeploymentVersion)(nil)).Elem()
   226  }
   227  
   228  func (i ContainerServiceDeploymentVersionArray) ToContainerServiceDeploymentVersionArrayOutput() ContainerServiceDeploymentVersionArrayOutput {
   229  	return i.ToContainerServiceDeploymentVersionArrayOutputWithContext(context.Background())
   230  }
   231  
   232  func (i ContainerServiceDeploymentVersionArray) ToContainerServiceDeploymentVersionArrayOutputWithContext(ctx context.Context) ContainerServiceDeploymentVersionArrayOutput {
   233  	return pulumi.ToOutputWithContext(ctx, i).(ContainerServiceDeploymentVersionArrayOutput)
   234  }
   235  
   236  // ContainerServiceDeploymentVersionMapInput is an input type that accepts ContainerServiceDeploymentVersionMap and ContainerServiceDeploymentVersionMapOutput values.
   237  // You can construct a concrete instance of `ContainerServiceDeploymentVersionMapInput` via:
   238  //
   239  //	ContainerServiceDeploymentVersionMap{ "key": ContainerServiceDeploymentVersionArgs{...} }
   240  type ContainerServiceDeploymentVersionMapInput interface {
   241  	pulumi.Input
   242  
   243  	ToContainerServiceDeploymentVersionMapOutput() ContainerServiceDeploymentVersionMapOutput
   244  	ToContainerServiceDeploymentVersionMapOutputWithContext(context.Context) ContainerServiceDeploymentVersionMapOutput
   245  }
   246  
   247  type ContainerServiceDeploymentVersionMap map[string]ContainerServiceDeploymentVersionInput
   248  
   249  func (ContainerServiceDeploymentVersionMap) ElementType() reflect.Type {
   250  	return reflect.TypeOf((*map[string]*ContainerServiceDeploymentVersion)(nil)).Elem()
   251  }
   252  
   253  func (i ContainerServiceDeploymentVersionMap) ToContainerServiceDeploymentVersionMapOutput() ContainerServiceDeploymentVersionMapOutput {
   254  	return i.ToContainerServiceDeploymentVersionMapOutputWithContext(context.Background())
   255  }
   256  
   257  func (i ContainerServiceDeploymentVersionMap) ToContainerServiceDeploymentVersionMapOutputWithContext(ctx context.Context) ContainerServiceDeploymentVersionMapOutput {
   258  	return pulumi.ToOutputWithContext(ctx, i).(ContainerServiceDeploymentVersionMapOutput)
   259  }
   260  
   261  type ContainerServiceDeploymentVersionOutput struct{ *pulumi.OutputState }
   262  
   263  func (ContainerServiceDeploymentVersionOutput) ElementType() reflect.Type {
   264  	return reflect.TypeOf((**ContainerServiceDeploymentVersion)(nil)).Elem()
   265  }
   266  
   267  func (o ContainerServiceDeploymentVersionOutput) ToContainerServiceDeploymentVersionOutput() ContainerServiceDeploymentVersionOutput {
   268  	return o
   269  }
   270  
   271  func (o ContainerServiceDeploymentVersionOutput) ToContainerServiceDeploymentVersionOutputWithContext(ctx context.Context) ContainerServiceDeploymentVersionOutput {
   272  	return o
   273  }
   274  
   275  // A set of configuration blocks that describe the settings of the containers that will be launched on the container service. Maximum of 53. Detailed below.
   276  func (o ContainerServiceDeploymentVersionOutput) Containers() ContainerServiceDeploymentVersionContainerArrayOutput {
   277  	return o.ApplyT(func(v *ContainerServiceDeploymentVersion) ContainerServiceDeploymentVersionContainerArrayOutput {
   278  		return v.Containers
   279  	}).(ContainerServiceDeploymentVersionContainerArrayOutput)
   280  }
   281  
   282  // The timestamp when the deployment was created.
   283  func (o ContainerServiceDeploymentVersionOutput) CreatedAt() pulumi.StringOutput {
   284  	return o.ApplyT(func(v *ContainerServiceDeploymentVersion) pulumi.StringOutput { return v.CreatedAt }).(pulumi.StringOutput)
   285  }
   286  
   287  // A configuration block that describes the settings of the public endpoint for the container service. Detailed below.
   288  func (o ContainerServiceDeploymentVersionOutput) PublicEndpoint() ContainerServiceDeploymentVersionPublicEndpointPtrOutput {
   289  	return o.ApplyT(func(v *ContainerServiceDeploymentVersion) ContainerServiceDeploymentVersionPublicEndpointPtrOutput {
   290  		return v.PublicEndpoint
   291  	}).(ContainerServiceDeploymentVersionPublicEndpointPtrOutput)
   292  }
   293  
   294  // The name for the container service.
   295  func (o ContainerServiceDeploymentVersionOutput) ServiceName() pulumi.StringOutput {
   296  	return o.ApplyT(func(v *ContainerServiceDeploymentVersion) pulumi.StringOutput { return v.ServiceName }).(pulumi.StringOutput)
   297  }
   298  
   299  // The current state of the container service.
   300  func (o ContainerServiceDeploymentVersionOutput) State() pulumi.StringOutput {
   301  	return o.ApplyT(func(v *ContainerServiceDeploymentVersion) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
   302  }
   303  
   304  // The version number of the deployment.
   305  func (o ContainerServiceDeploymentVersionOutput) Version() pulumi.IntOutput {
   306  	return o.ApplyT(func(v *ContainerServiceDeploymentVersion) pulumi.IntOutput { return v.Version }).(pulumi.IntOutput)
   307  }
   308  
   309  type ContainerServiceDeploymentVersionArrayOutput struct{ *pulumi.OutputState }
   310  
   311  func (ContainerServiceDeploymentVersionArrayOutput) ElementType() reflect.Type {
   312  	return reflect.TypeOf((*[]*ContainerServiceDeploymentVersion)(nil)).Elem()
   313  }
   314  
   315  func (o ContainerServiceDeploymentVersionArrayOutput) ToContainerServiceDeploymentVersionArrayOutput() ContainerServiceDeploymentVersionArrayOutput {
   316  	return o
   317  }
   318  
   319  func (o ContainerServiceDeploymentVersionArrayOutput) ToContainerServiceDeploymentVersionArrayOutputWithContext(ctx context.Context) ContainerServiceDeploymentVersionArrayOutput {
   320  	return o
   321  }
   322  
   323  func (o ContainerServiceDeploymentVersionArrayOutput) Index(i pulumi.IntInput) ContainerServiceDeploymentVersionOutput {
   324  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ContainerServiceDeploymentVersion {
   325  		return vs[0].([]*ContainerServiceDeploymentVersion)[vs[1].(int)]
   326  	}).(ContainerServiceDeploymentVersionOutput)
   327  }
   328  
   329  type ContainerServiceDeploymentVersionMapOutput struct{ *pulumi.OutputState }
   330  
   331  func (ContainerServiceDeploymentVersionMapOutput) ElementType() reflect.Type {
   332  	return reflect.TypeOf((*map[string]*ContainerServiceDeploymentVersion)(nil)).Elem()
   333  }
   334  
   335  func (o ContainerServiceDeploymentVersionMapOutput) ToContainerServiceDeploymentVersionMapOutput() ContainerServiceDeploymentVersionMapOutput {
   336  	return o
   337  }
   338  
   339  func (o ContainerServiceDeploymentVersionMapOutput) ToContainerServiceDeploymentVersionMapOutputWithContext(ctx context.Context) ContainerServiceDeploymentVersionMapOutput {
   340  	return o
   341  }
   342  
   343  func (o ContainerServiceDeploymentVersionMapOutput) MapIndex(k pulumi.StringInput) ContainerServiceDeploymentVersionOutput {
   344  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ContainerServiceDeploymentVersion {
   345  		return vs[0].(map[string]*ContainerServiceDeploymentVersion)[vs[1].(string)]
   346  	}).(ContainerServiceDeploymentVersionOutput)
   347  }
   348  
   349  func init() {
   350  	pulumi.RegisterInputType(reflect.TypeOf((*ContainerServiceDeploymentVersionInput)(nil)).Elem(), &ContainerServiceDeploymentVersion{})
   351  	pulumi.RegisterInputType(reflect.TypeOf((*ContainerServiceDeploymentVersionArrayInput)(nil)).Elem(), ContainerServiceDeploymentVersionArray{})
   352  	pulumi.RegisterInputType(reflect.TypeOf((*ContainerServiceDeploymentVersionMapInput)(nil)).Elem(), ContainerServiceDeploymentVersionMap{})
   353  	pulumi.RegisterOutputType(ContainerServiceDeploymentVersionOutput{})
   354  	pulumi.RegisterOutputType(ContainerServiceDeploymentVersionArrayOutput{})
   355  	pulumi.RegisterOutputType(ContainerServiceDeploymentVersionMapOutput{})
   356  }