github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/lightsail/instance.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 Lightsail Instance. Amazon Lightsail is a service to provide easy virtual private servers
    16  // with custom software already setup. See [What is Amazon Lightsail?](https://lightsail.aws.amazon.com/ls/docs/getting-started/article/what-is-amazon-lightsail)
    17  // for more information.
    18  //
    19  // > **Note:** Lightsail is currently only supported in a limited number of AWS Regions, please see ["Regions and Availability Zones in Amazon Lightsail"](https://lightsail.aws.amazon.com/ls/docs/overview/article/understanding-regions-and-availability-zones-in-amazon-lightsail) for more details
    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  //			// Create a new GitLab Lightsail Instance
    39  //			_, err := lightsail.NewInstance(ctx, "gitlab_test", &lightsail.InstanceArgs{
    40  //				Name:             pulumi.String("custom_gitlab"),
    41  //				AvailabilityZone: pulumi.String("us-east-1b"),
    42  //				BlueprintId:      pulumi.String("amazon_linux_2"),
    43  //				BundleId:         pulumi.String("nano_3_0"),
    44  //				KeyPairName:      pulumi.String("some_key_name"),
    45  //				Tags: pulumi.StringMap{
    46  //					"foo": pulumi.String("bar"),
    47  //				},
    48  //			})
    49  //			if err != nil {
    50  //				return err
    51  //			}
    52  //			return nil
    53  //		})
    54  //	}
    55  //
    56  // ```
    57  // <!--End PulumiCodeChooser -->
    58  //
    59  // ### Example With User Data
    60  //
    61  // Lightsail user data is handled differently than ec2 user data. Lightsail user data only accepts a single lined string. The below example shows installing apache and creating the index page.
    62  //
    63  // <!--Start PulumiCodeChooser -->
    64  // ```go
    65  // package main
    66  //
    67  // import (
    68  //
    69  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail"
    70  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    71  //
    72  // )
    73  //
    74  //	func main() {
    75  //		pulumi.Run(func(ctx *pulumi.Context) error {
    76  //			_, err := lightsail.NewInstance(ctx, "custom", &lightsail.InstanceArgs{
    77  //				Name:             pulumi.String("custom"),
    78  //				AvailabilityZone: pulumi.String("us-east-1b"),
    79  //				BlueprintId:      pulumi.String("amazon_linux_2"),
    80  //				BundleId:         pulumi.String("nano_3_0"),
    81  //				UserData:         pulumi.String("sudo yum install -y httpd && sudo systemctl start httpd && sudo systemctl enable httpd && echo '<h1>Deployed via Pulumi</h1>' | sudo tee /var/www/html/index.html"),
    82  //			})
    83  //			if err != nil {
    84  //				return err
    85  //			}
    86  //			return nil
    87  //		})
    88  //	}
    89  //
    90  // ```
    91  // <!--End PulumiCodeChooser -->
    92  //
    93  // ### Enable Auto Snapshots
    94  //
    95  // <!--Start PulumiCodeChooser -->
    96  // ```go
    97  // package main
    98  //
    99  // import (
   100  //
   101  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail"
   102  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
   103  //
   104  // )
   105  //
   106  //	func main() {
   107  //		pulumi.Run(func(ctx *pulumi.Context) error {
   108  //			_, err := lightsail.NewInstance(ctx, "test", &lightsail.InstanceArgs{
   109  //				Name:             pulumi.String("custom_instance"),
   110  //				AvailabilityZone: pulumi.String("us-east-1b"),
   111  //				BlueprintId:      pulumi.String("amazon_linux_2"),
   112  //				BundleId:         pulumi.String("nano_3_0"),
   113  //				AddOn: &lightsail.InstanceAddOnArgs{
   114  //					Type:         pulumi.String("AutoSnapshot"),
   115  //					SnapshotTime: pulumi.String("06:00"),
   116  //					Status:       pulumi.String("Enabled"),
   117  //				},
   118  //				Tags: pulumi.StringMap{
   119  //					"foo": pulumi.String("bar"),
   120  //				},
   121  //			})
   122  //			if err != nil {
   123  //				return err
   124  //			}
   125  //			return nil
   126  //		})
   127  //	}
   128  //
   129  // ```
   130  // <!--End PulumiCodeChooser -->
   131  //
   132  // ## Import
   133  //
   134  // Using `pulumi import`, import Lightsail Instances using their name. For example:
   135  //
   136  // ```sh
   137  // $ pulumi import aws:lightsail/instance:Instance gitlab_test 'custom_gitlab'
   138  // ```
   139  type Instance struct {
   140  	pulumi.CustomResourceState
   141  
   142  	// The add on configuration for the instance. Detailed below.
   143  	AddOn InstanceAddOnPtrOutput `pulumi:"addOn"`
   144  	// The ARN of the Lightsail instance (matches `id`).
   145  	Arn pulumi.StringOutput `pulumi:"arn"`
   146  	// The Availability Zone in which to create your instance. A
   147  	// list of available zones can be obtained using the AWS CLI command:
   148  	// [`aws lightsail get-regions --include-availability-zones`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-regions.html).
   149  	AvailabilityZone pulumi.StringOutput `pulumi:"availabilityZone"`
   150  	// The ID for a virtual private server image. A list of available
   151  	// blueprint IDs can be obtained using the AWS CLI command:
   152  	// [`aws lightsail get-blueprints`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-blueprints.html).
   153  	BlueprintId pulumi.StringOutput `pulumi:"blueprintId"`
   154  	// The bundle of specification information. A list of available
   155  	// bundle IDs can be obtained using the AWS CLI command:
   156  	// [`aws lightsail get-bundles`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-bundles.html).
   157  	BundleId pulumi.StringOutput `pulumi:"bundleId"`
   158  	// The number of vCPUs the instance has.
   159  	CpuCount pulumi.IntOutput `pulumi:"cpuCount"`
   160  	// The timestamp when the instance was created.
   161  	CreatedAt pulumi.StringOutput `pulumi:"createdAt"`
   162  	// The IP address type of the Lightsail Instance. Valid Values: `dualstack` | `ipv4`.
   163  	IpAddressType pulumi.StringPtrOutput `pulumi:"ipAddressType"`
   164  	// List of IPv6 addresses for the Lightsail instance.
   165  	Ipv6Addresses pulumi.StringArrayOutput `pulumi:"ipv6Addresses"`
   166  	// A Boolean value indicating whether this instance has a static IP assigned to it.
   167  	IsStaticIp pulumi.BoolOutput `pulumi:"isStaticIp"`
   168  	// The name of your key pair. Created in the
   169  	// Lightsail console (cannot use `ec2.KeyPair` at this time)
   170  	KeyPairName pulumi.StringPtrOutput `pulumi:"keyPairName"`
   171  	// The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
   172  	Name pulumi.StringOutput `pulumi:"name"`
   173  	// The private IP address of the instance.
   174  	PrivateIpAddress pulumi.StringOutput `pulumi:"privateIpAddress"`
   175  	// The public IP address of the instance.
   176  	PublicIpAddress pulumi.StringOutput `pulumi:"publicIpAddress"`
   177  	// The amount of RAM in GB on the instance (e.g., 1.0).
   178  	RamSize pulumi.Float64Output `pulumi:"ramSize"`
   179  	// A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   180  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   181  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   182  	//
   183  	// Deprecated: Please use `tags` instead.
   184  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   185  	// Single lined launch script as a string to configure server with additional user data
   186  	UserData pulumi.StringPtrOutput `pulumi:"userData"`
   187  	// The user name for connecting to the instance (e.g., ec2-user).
   188  	Username pulumi.StringOutput `pulumi:"username"`
   189  }
   190  
   191  // NewInstance registers a new resource with the given unique name, arguments, and options.
   192  func NewInstance(ctx *pulumi.Context,
   193  	name string, args *InstanceArgs, opts ...pulumi.ResourceOption) (*Instance, error) {
   194  	if args == nil {
   195  		return nil, errors.New("missing one or more required arguments")
   196  	}
   197  
   198  	if args.AvailabilityZone == nil {
   199  		return nil, errors.New("invalid value for required argument 'AvailabilityZone'")
   200  	}
   201  	if args.BlueprintId == nil {
   202  		return nil, errors.New("invalid value for required argument 'BlueprintId'")
   203  	}
   204  	if args.BundleId == nil {
   205  		return nil, errors.New("invalid value for required argument 'BundleId'")
   206  	}
   207  	opts = internal.PkgResourceDefaultOpts(opts)
   208  	var resource Instance
   209  	err := ctx.RegisterResource("aws:lightsail/instance:Instance", name, args, &resource, opts...)
   210  	if err != nil {
   211  		return nil, err
   212  	}
   213  	return &resource, nil
   214  }
   215  
   216  // GetInstance gets an existing Instance resource's state with the given name, ID, and optional
   217  // state properties that are used to uniquely qualify the lookup (nil if not required).
   218  func GetInstance(ctx *pulumi.Context,
   219  	name string, id pulumi.IDInput, state *InstanceState, opts ...pulumi.ResourceOption) (*Instance, error) {
   220  	var resource Instance
   221  	err := ctx.ReadResource("aws:lightsail/instance:Instance", name, id, state, &resource, opts...)
   222  	if err != nil {
   223  		return nil, err
   224  	}
   225  	return &resource, nil
   226  }
   227  
   228  // Input properties used for looking up and filtering Instance resources.
   229  type instanceState struct {
   230  	// The add on configuration for the instance. Detailed below.
   231  	AddOn *InstanceAddOn `pulumi:"addOn"`
   232  	// The ARN of the Lightsail instance (matches `id`).
   233  	Arn *string `pulumi:"arn"`
   234  	// The Availability Zone in which to create your instance. A
   235  	// list of available zones can be obtained using the AWS CLI command:
   236  	// [`aws lightsail get-regions --include-availability-zones`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-regions.html).
   237  	AvailabilityZone *string `pulumi:"availabilityZone"`
   238  	// The ID for a virtual private server image. A list of available
   239  	// blueprint IDs can be obtained using the AWS CLI command:
   240  	// [`aws lightsail get-blueprints`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-blueprints.html).
   241  	BlueprintId *string `pulumi:"blueprintId"`
   242  	// The bundle of specification information. A list of available
   243  	// bundle IDs can be obtained using the AWS CLI command:
   244  	// [`aws lightsail get-bundles`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-bundles.html).
   245  	BundleId *string `pulumi:"bundleId"`
   246  	// The number of vCPUs the instance has.
   247  	CpuCount *int `pulumi:"cpuCount"`
   248  	// The timestamp when the instance was created.
   249  	CreatedAt *string `pulumi:"createdAt"`
   250  	// The IP address type of the Lightsail Instance. Valid Values: `dualstack` | `ipv4`.
   251  	IpAddressType *string `pulumi:"ipAddressType"`
   252  	// List of IPv6 addresses for the Lightsail instance.
   253  	Ipv6Addresses []string `pulumi:"ipv6Addresses"`
   254  	// A Boolean value indicating whether this instance has a static IP assigned to it.
   255  	IsStaticIp *bool `pulumi:"isStaticIp"`
   256  	// The name of your key pair. Created in the
   257  	// Lightsail console (cannot use `ec2.KeyPair` at this time)
   258  	KeyPairName *string `pulumi:"keyPairName"`
   259  	// The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
   260  	Name *string `pulumi:"name"`
   261  	// The private IP address of the instance.
   262  	PrivateIpAddress *string `pulumi:"privateIpAddress"`
   263  	// The public IP address of the instance.
   264  	PublicIpAddress *string `pulumi:"publicIpAddress"`
   265  	// The amount of RAM in GB on the instance (e.g., 1.0).
   266  	RamSize *float64 `pulumi:"ramSize"`
   267  	// A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   268  	Tags map[string]string `pulumi:"tags"`
   269  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   270  	//
   271  	// Deprecated: Please use `tags` instead.
   272  	TagsAll map[string]string `pulumi:"tagsAll"`
   273  	// Single lined launch script as a string to configure server with additional user data
   274  	UserData *string `pulumi:"userData"`
   275  	// The user name for connecting to the instance (e.g., ec2-user).
   276  	Username *string `pulumi:"username"`
   277  }
   278  
   279  type InstanceState struct {
   280  	// The add on configuration for the instance. Detailed below.
   281  	AddOn InstanceAddOnPtrInput
   282  	// The ARN of the Lightsail instance (matches `id`).
   283  	Arn pulumi.StringPtrInput
   284  	// The Availability Zone in which to create your instance. A
   285  	// list of available zones can be obtained using the AWS CLI command:
   286  	// [`aws lightsail get-regions --include-availability-zones`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-regions.html).
   287  	AvailabilityZone pulumi.StringPtrInput
   288  	// The ID for a virtual private server image. A list of available
   289  	// blueprint IDs can be obtained using the AWS CLI command:
   290  	// [`aws lightsail get-blueprints`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-blueprints.html).
   291  	BlueprintId pulumi.StringPtrInput
   292  	// The bundle of specification information. A list of available
   293  	// bundle IDs can be obtained using the AWS CLI command:
   294  	// [`aws lightsail get-bundles`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-bundles.html).
   295  	BundleId pulumi.StringPtrInput
   296  	// The number of vCPUs the instance has.
   297  	CpuCount pulumi.IntPtrInput
   298  	// The timestamp when the instance was created.
   299  	CreatedAt pulumi.StringPtrInput
   300  	// The IP address type of the Lightsail Instance. Valid Values: `dualstack` | `ipv4`.
   301  	IpAddressType pulumi.StringPtrInput
   302  	// List of IPv6 addresses for the Lightsail instance.
   303  	Ipv6Addresses pulumi.StringArrayInput
   304  	// A Boolean value indicating whether this instance has a static IP assigned to it.
   305  	IsStaticIp pulumi.BoolPtrInput
   306  	// The name of your key pair. Created in the
   307  	// Lightsail console (cannot use `ec2.KeyPair` at this time)
   308  	KeyPairName pulumi.StringPtrInput
   309  	// The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
   310  	Name pulumi.StringPtrInput
   311  	// The private IP address of the instance.
   312  	PrivateIpAddress pulumi.StringPtrInput
   313  	// The public IP address of the instance.
   314  	PublicIpAddress pulumi.StringPtrInput
   315  	// The amount of RAM in GB on the instance (e.g., 1.0).
   316  	RamSize pulumi.Float64PtrInput
   317  	// A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   318  	Tags pulumi.StringMapInput
   319  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   320  	//
   321  	// Deprecated: Please use `tags` instead.
   322  	TagsAll pulumi.StringMapInput
   323  	// Single lined launch script as a string to configure server with additional user data
   324  	UserData pulumi.StringPtrInput
   325  	// The user name for connecting to the instance (e.g., ec2-user).
   326  	Username pulumi.StringPtrInput
   327  }
   328  
   329  func (InstanceState) ElementType() reflect.Type {
   330  	return reflect.TypeOf((*instanceState)(nil)).Elem()
   331  }
   332  
   333  type instanceArgs struct {
   334  	// The add on configuration for the instance. Detailed below.
   335  	AddOn *InstanceAddOn `pulumi:"addOn"`
   336  	// The Availability Zone in which to create your instance. A
   337  	// list of available zones can be obtained using the AWS CLI command:
   338  	// [`aws lightsail get-regions --include-availability-zones`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-regions.html).
   339  	AvailabilityZone string `pulumi:"availabilityZone"`
   340  	// The ID for a virtual private server image. A list of available
   341  	// blueprint IDs can be obtained using the AWS CLI command:
   342  	// [`aws lightsail get-blueprints`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-blueprints.html).
   343  	BlueprintId string `pulumi:"blueprintId"`
   344  	// The bundle of specification information. A list of available
   345  	// bundle IDs can be obtained using the AWS CLI command:
   346  	// [`aws lightsail get-bundles`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-bundles.html).
   347  	BundleId string `pulumi:"bundleId"`
   348  	// The IP address type of the Lightsail Instance. Valid Values: `dualstack` | `ipv4`.
   349  	IpAddressType *string `pulumi:"ipAddressType"`
   350  	// The name of your key pair. Created in the
   351  	// Lightsail console (cannot use `ec2.KeyPair` at this time)
   352  	KeyPairName *string `pulumi:"keyPairName"`
   353  	// The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
   354  	Name *string `pulumi:"name"`
   355  	// A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   356  	Tags map[string]string `pulumi:"tags"`
   357  	// Single lined launch script as a string to configure server with additional user data
   358  	UserData *string `pulumi:"userData"`
   359  }
   360  
   361  // The set of arguments for constructing a Instance resource.
   362  type InstanceArgs struct {
   363  	// The add on configuration for the instance. Detailed below.
   364  	AddOn InstanceAddOnPtrInput
   365  	// The Availability Zone in which to create your instance. A
   366  	// list of available zones can be obtained using the AWS CLI command:
   367  	// [`aws lightsail get-regions --include-availability-zones`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-regions.html).
   368  	AvailabilityZone pulumi.StringInput
   369  	// The ID for a virtual private server image. A list of available
   370  	// blueprint IDs can be obtained using the AWS CLI command:
   371  	// [`aws lightsail get-blueprints`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-blueprints.html).
   372  	BlueprintId pulumi.StringInput
   373  	// The bundle of specification information. A list of available
   374  	// bundle IDs can be obtained using the AWS CLI command:
   375  	// [`aws lightsail get-bundles`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-bundles.html).
   376  	BundleId pulumi.StringInput
   377  	// The IP address type of the Lightsail Instance. Valid Values: `dualstack` | `ipv4`.
   378  	IpAddressType pulumi.StringPtrInput
   379  	// The name of your key pair. Created in the
   380  	// Lightsail console (cannot use `ec2.KeyPair` at this time)
   381  	KeyPairName pulumi.StringPtrInput
   382  	// The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
   383  	Name pulumi.StringPtrInput
   384  	// A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   385  	Tags pulumi.StringMapInput
   386  	// Single lined launch script as a string to configure server with additional user data
   387  	UserData pulumi.StringPtrInput
   388  }
   389  
   390  func (InstanceArgs) ElementType() reflect.Type {
   391  	return reflect.TypeOf((*instanceArgs)(nil)).Elem()
   392  }
   393  
   394  type InstanceInput interface {
   395  	pulumi.Input
   396  
   397  	ToInstanceOutput() InstanceOutput
   398  	ToInstanceOutputWithContext(ctx context.Context) InstanceOutput
   399  }
   400  
   401  func (*Instance) ElementType() reflect.Type {
   402  	return reflect.TypeOf((**Instance)(nil)).Elem()
   403  }
   404  
   405  func (i *Instance) ToInstanceOutput() InstanceOutput {
   406  	return i.ToInstanceOutputWithContext(context.Background())
   407  }
   408  
   409  func (i *Instance) ToInstanceOutputWithContext(ctx context.Context) InstanceOutput {
   410  	return pulumi.ToOutputWithContext(ctx, i).(InstanceOutput)
   411  }
   412  
   413  // InstanceArrayInput is an input type that accepts InstanceArray and InstanceArrayOutput values.
   414  // You can construct a concrete instance of `InstanceArrayInput` via:
   415  //
   416  //	InstanceArray{ InstanceArgs{...} }
   417  type InstanceArrayInput interface {
   418  	pulumi.Input
   419  
   420  	ToInstanceArrayOutput() InstanceArrayOutput
   421  	ToInstanceArrayOutputWithContext(context.Context) InstanceArrayOutput
   422  }
   423  
   424  type InstanceArray []InstanceInput
   425  
   426  func (InstanceArray) ElementType() reflect.Type {
   427  	return reflect.TypeOf((*[]*Instance)(nil)).Elem()
   428  }
   429  
   430  func (i InstanceArray) ToInstanceArrayOutput() InstanceArrayOutput {
   431  	return i.ToInstanceArrayOutputWithContext(context.Background())
   432  }
   433  
   434  func (i InstanceArray) ToInstanceArrayOutputWithContext(ctx context.Context) InstanceArrayOutput {
   435  	return pulumi.ToOutputWithContext(ctx, i).(InstanceArrayOutput)
   436  }
   437  
   438  // InstanceMapInput is an input type that accepts InstanceMap and InstanceMapOutput values.
   439  // You can construct a concrete instance of `InstanceMapInput` via:
   440  //
   441  //	InstanceMap{ "key": InstanceArgs{...} }
   442  type InstanceMapInput interface {
   443  	pulumi.Input
   444  
   445  	ToInstanceMapOutput() InstanceMapOutput
   446  	ToInstanceMapOutputWithContext(context.Context) InstanceMapOutput
   447  }
   448  
   449  type InstanceMap map[string]InstanceInput
   450  
   451  func (InstanceMap) ElementType() reflect.Type {
   452  	return reflect.TypeOf((*map[string]*Instance)(nil)).Elem()
   453  }
   454  
   455  func (i InstanceMap) ToInstanceMapOutput() InstanceMapOutput {
   456  	return i.ToInstanceMapOutputWithContext(context.Background())
   457  }
   458  
   459  func (i InstanceMap) ToInstanceMapOutputWithContext(ctx context.Context) InstanceMapOutput {
   460  	return pulumi.ToOutputWithContext(ctx, i).(InstanceMapOutput)
   461  }
   462  
   463  type InstanceOutput struct{ *pulumi.OutputState }
   464  
   465  func (InstanceOutput) ElementType() reflect.Type {
   466  	return reflect.TypeOf((**Instance)(nil)).Elem()
   467  }
   468  
   469  func (o InstanceOutput) ToInstanceOutput() InstanceOutput {
   470  	return o
   471  }
   472  
   473  func (o InstanceOutput) ToInstanceOutputWithContext(ctx context.Context) InstanceOutput {
   474  	return o
   475  }
   476  
   477  // The add on configuration for the instance. Detailed below.
   478  func (o InstanceOutput) AddOn() InstanceAddOnPtrOutput {
   479  	return o.ApplyT(func(v *Instance) InstanceAddOnPtrOutput { return v.AddOn }).(InstanceAddOnPtrOutput)
   480  }
   481  
   482  // The ARN of the Lightsail instance (matches `id`).
   483  func (o InstanceOutput) Arn() pulumi.StringOutput {
   484  	return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   485  }
   486  
   487  // The Availability Zone in which to create your instance. A
   488  // list of available zones can be obtained using the AWS CLI command:
   489  // [`aws lightsail get-regions --include-availability-zones`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-regions.html).
   490  func (o InstanceOutput) AvailabilityZone() pulumi.StringOutput {
   491  	return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.AvailabilityZone }).(pulumi.StringOutput)
   492  }
   493  
   494  // The ID for a virtual private server image. A list of available
   495  // blueprint IDs can be obtained using the AWS CLI command:
   496  // [`aws lightsail get-blueprints`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-blueprints.html).
   497  func (o InstanceOutput) BlueprintId() pulumi.StringOutput {
   498  	return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.BlueprintId }).(pulumi.StringOutput)
   499  }
   500  
   501  // The bundle of specification information. A list of available
   502  // bundle IDs can be obtained using the AWS CLI command:
   503  // [`aws lightsail get-bundles`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lightsail/get-bundles.html).
   504  func (o InstanceOutput) BundleId() pulumi.StringOutput {
   505  	return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.BundleId }).(pulumi.StringOutput)
   506  }
   507  
   508  // The number of vCPUs the instance has.
   509  func (o InstanceOutput) CpuCount() pulumi.IntOutput {
   510  	return o.ApplyT(func(v *Instance) pulumi.IntOutput { return v.CpuCount }).(pulumi.IntOutput)
   511  }
   512  
   513  // The timestamp when the instance was created.
   514  func (o InstanceOutput) CreatedAt() pulumi.StringOutput {
   515  	return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.CreatedAt }).(pulumi.StringOutput)
   516  }
   517  
   518  // The IP address type of the Lightsail Instance. Valid Values: `dualstack` | `ipv4`.
   519  func (o InstanceOutput) IpAddressType() pulumi.StringPtrOutput {
   520  	return o.ApplyT(func(v *Instance) pulumi.StringPtrOutput { return v.IpAddressType }).(pulumi.StringPtrOutput)
   521  }
   522  
   523  // List of IPv6 addresses for the Lightsail instance.
   524  func (o InstanceOutput) Ipv6Addresses() pulumi.StringArrayOutput {
   525  	return o.ApplyT(func(v *Instance) pulumi.StringArrayOutput { return v.Ipv6Addresses }).(pulumi.StringArrayOutput)
   526  }
   527  
   528  // A Boolean value indicating whether this instance has a static IP assigned to it.
   529  func (o InstanceOutput) IsStaticIp() pulumi.BoolOutput {
   530  	return o.ApplyT(func(v *Instance) pulumi.BoolOutput { return v.IsStaticIp }).(pulumi.BoolOutput)
   531  }
   532  
   533  // The name of your key pair. Created in the
   534  // Lightsail console (cannot use `ec2.KeyPair` at this time)
   535  func (o InstanceOutput) KeyPairName() pulumi.StringPtrOutput {
   536  	return o.ApplyT(func(v *Instance) pulumi.StringPtrOutput { return v.KeyPairName }).(pulumi.StringPtrOutput)
   537  }
   538  
   539  // The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
   540  func (o InstanceOutput) Name() pulumi.StringOutput {
   541  	return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   542  }
   543  
   544  // The private IP address of the instance.
   545  func (o InstanceOutput) PrivateIpAddress() pulumi.StringOutput {
   546  	return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.PrivateIpAddress }).(pulumi.StringOutput)
   547  }
   548  
   549  // The public IP address of the instance.
   550  func (o InstanceOutput) PublicIpAddress() pulumi.StringOutput {
   551  	return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.PublicIpAddress }).(pulumi.StringOutput)
   552  }
   553  
   554  // The amount of RAM in GB on the instance (e.g., 1.0).
   555  func (o InstanceOutput) RamSize() pulumi.Float64Output {
   556  	return o.ApplyT(func(v *Instance) pulumi.Float64Output { return v.RamSize }).(pulumi.Float64Output)
   557  }
   558  
   559  // A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   560  func (o InstanceOutput) Tags() pulumi.StringMapOutput {
   561  	return o.ApplyT(func(v *Instance) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   562  }
   563  
   564  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   565  //
   566  // Deprecated: Please use `tags` instead.
   567  func (o InstanceOutput) TagsAll() pulumi.StringMapOutput {
   568  	return o.ApplyT(func(v *Instance) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   569  }
   570  
   571  // Single lined launch script as a string to configure server with additional user data
   572  func (o InstanceOutput) UserData() pulumi.StringPtrOutput {
   573  	return o.ApplyT(func(v *Instance) pulumi.StringPtrOutput { return v.UserData }).(pulumi.StringPtrOutput)
   574  }
   575  
   576  // The user name for connecting to the instance (e.g., ec2-user).
   577  func (o InstanceOutput) Username() pulumi.StringOutput {
   578  	return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.Username }).(pulumi.StringOutput)
   579  }
   580  
   581  type InstanceArrayOutput struct{ *pulumi.OutputState }
   582  
   583  func (InstanceArrayOutput) ElementType() reflect.Type {
   584  	return reflect.TypeOf((*[]*Instance)(nil)).Elem()
   585  }
   586  
   587  func (o InstanceArrayOutput) ToInstanceArrayOutput() InstanceArrayOutput {
   588  	return o
   589  }
   590  
   591  func (o InstanceArrayOutput) ToInstanceArrayOutputWithContext(ctx context.Context) InstanceArrayOutput {
   592  	return o
   593  }
   594  
   595  func (o InstanceArrayOutput) Index(i pulumi.IntInput) InstanceOutput {
   596  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Instance {
   597  		return vs[0].([]*Instance)[vs[1].(int)]
   598  	}).(InstanceOutput)
   599  }
   600  
   601  type InstanceMapOutput struct{ *pulumi.OutputState }
   602  
   603  func (InstanceMapOutput) ElementType() reflect.Type {
   604  	return reflect.TypeOf((*map[string]*Instance)(nil)).Elem()
   605  }
   606  
   607  func (o InstanceMapOutput) ToInstanceMapOutput() InstanceMapOutput {
   608  	return o
   609  }
   610  
   611  func (o InstanceMapOutput) ToInstanceMapOutputWithContext(ctx context.Context) InstanceMapOutput {
   612  	return o
   613  }
   614  
   615  func (o InstanceMapOutput) MapIndex(k pulumi.StringInput) InstanceOutput {
   616  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Instance {
   617  		return vs[0].(map[string]*Instance)[vs[1].(string)]
   618  	}).(InstanceOutput)
   619  }
   620  
   621  func init() {
   622  	pulumi.RegisterInputType(reflect.TypeOf((*InstanceInput)(nil)).Elem(), &Instance{})
   623  	pulumi.RegisterInputType(reflect.TypeOf((*InstanceArrayInput)(nil)).Elem(), InstanceArray{})
   624  	pulumi.RegisterInputType(reflect.TypeOf((*InstanceMapInput)(nil)).Elem(), InstanceMap{})
   625  	pulumi.RegisterOutputType(InstanceOutput{})
   626  	pulumi.RegisterOutputType(InstanceArrayOutput{})
   627  	pulumi.RegisterOutputType(InstanceMapOutput{})
   628  }