Try AWS Native preview for resources not in the classic version.
aws.lightsail.Lb
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Creates a Lightsail load balancer resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.lightsail.Lb("test", {
name: "test-load-balancer",
healthCheckPath: "/",
instancePort: 80,
tags: {
foo: "bar",
},
});
import pulumi
import pulumi_aws as aws
test = aws.lightsail.Lb("test",
name="test-load-balancer",
health_check_path="/",
instance_port=80,
tags={
"foo": "bar",
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := lightsail.NewLb(ctx, "test", &lightsail.LbArgs{
Name: pulumi.String("test-load-balancer"),
HealthCheckPath: pulumi.String("/"),
InstancePort: pulumi.Int(80),
Tags: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = new Aws.LightSail.Lb("test", new()
{
Name = "test-load-balancer",
HealthCheckPath = "/",
InstancePort = 80,
Tags =
{
{ "foo", "bar" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lightsail.Lb;
import com.pulumi.aws.lightsail.LbArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var test = new Lb("test", LbArgs.builder()
.name("test-load-balancer")
.healthCheckPath("/")
.instancePort("80")
.tags(Map.of("foo", "bar"))
.build());
}
}
resources:
test:
type: aws:lightsail:Lb
properties:
name: test-load-balancer
healthCheckPath: /
instancePort: '80'
tags:
foo: bar
Create Lb Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Lb(name: string, args: LbArgs, opts?: CustomResourceOptions);
@overload
def Lb(resource_name: str,
args: LbArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Lb(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_port: Optional[int] = None,
health_check_path: Optional[str] = None,
ip_address_type: Optional[str] = None,
name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewLb(ctx *Context, name string, args LbArgs, opts ...ResourceOption) (*Lb, error)
public Lb(string name, LbArgs args, CustomResourceOptions? opts = null)
type: aws:lightsail:Lb
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args LbArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args LbArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args LbArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LbArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LbArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var lbResource = new Aws.LightSail.Lb("lbResource", new()
{
InstancePort = 0,
HealthCheckPath = "string",
IpAddressType = "string",
Name = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := lightsail.NewLb(ctx, "lbResource", &lightsail.LbArgs{
InstancePort: pulumi.Int(0),
HealthCheckPath: pulumi.String("string"),
IpAddressType: pulumi.String("string"),
Name: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var lbResource = new Lb("lbResource", LbArgs.builder()
.instancePort(0)
.healthCheckPath("string")
.ipAddressType("string")
.name("string")
.tags(Map.of("string", "string"))
.build());
lb_resource = aws.lightsail.Lb("lbResource",
instance_port=0,
health_check_path="string",
ip_address_type="string",
name="string",
tags={
"string": "string",
})
const lbResource = new aws.lightsail.Lb("lbResource", {
instancePort: 0,
healthCheckPath: "string",
ipAddressType: "string",
name: "string",
tags: {
string: "string",
},
});
type: aws:lightsail:Lb
properties:
healthCheckPath: string
instancePort: 0
ipAddressType: string
name: string
tags:
string: string
Lb Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Lb resource accepts the following input properties:
- Instance
Port int - The instance port the load balancer will connect.
- Health
Check stringPath - The health check path of the load balancer. Default value "/".
- Ip
Address stringType - Name string
- The name of the Lightsail load balancer.
- Dictionary<string, string>
- 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
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Instance
Port int - The instance port the load balancer will connect.
- Health
Check stringPath - The health check path of the load balancer. Default value "/".
- Ip
Address stringType - Name string
- The name of the Lightsail load balancer.
- map[string]string
- 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
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- instance
Port Integer - The instance port the load balancer will connect.
- health
Check StringPath - The health check path of the load balancer. Default value "/".
- ip
Address StringType - name String
- The name of the Lightsail load balancer.
- Map<String,String>
- 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
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- instance
Port number - The instance port the load balancer will connect.
- health
Check stringPath - The health check path of the load balancer. Default value "/".
- ip
Address stringType - name string
- The name of the Lightsail load balancer.
- {[key: string]: string}
- 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
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- instance_
port int - The instance port the load balancer will connect.
- health_
check_ strpath - The health check path of the load balancer. Default value "/".
- ip_
address_ strtype - name str
- The name of the Lightsail load balancer.
- Mapping[str, str]
- 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
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- instance
Port Number - The instance port the load balancer will connect.
- health
Check StringPath - The health check path of the load balancer. Default value "/".
- ip
Address StringType - name String
- The name of the Lightsail load balancer.
- Map<String>
- 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
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the Lb resource produces the following output properties:
- Arn string
- The ARN of the Lightsail load balancer.
- Created
At string - The timestamp when the load balancer was created.
- Dns
Name string - The DNS name of the load balancer.
- Id string
- The provider-assigned unique ID for this managed resource.
- Protocol string
- The protocol of the load balancer.
- Public
Ports List<int> - The public ports of the load balancer.
- Support
Code string - The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
- The ARN of the Lightsail load balancer.
- Created
At string - The timestamp when the load balancer was created.
- Dns
Name string - The DNS name of the load balancer.
- Id string
- The provider-assigned unique ID for this managed resource.
- Protocol string
- The protocol of the load balancer.
- Public
Ports []int - The public ports of the load balancer.
- Support
Code string - The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- The ARN of the Lightsail load balancer.
- created
At String - The timestamp when the load balancer was created.
- dns
Name String - The DNS name of the load balancer.
- id String
- The provider-assigned unique ID for this managed resource.
- protocol String
- The protocol of the load balancer.
- public
Ports List<Integer> - The public ports of the load balancer.
- support
Code String - The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
- The ARN of the Lightsail load balancer.
- created
At string - The timestamp when the load balancer was created.
- dns
Name string - The DNS name of the load balancer.
- id string
- The provider-assigned unique ID for this managed resource.
- protocol string
- The protocol of the load balancer.
- public
Ports number[] - The public ports of the load balancer.
- support
Code string - The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn str
- The ARN of the Lightsail load balancer.
- created_
at str - The timestamp when the load balancer was created.
- dns_
name str - The DNS name of the load balancer.
- id str
- The provider-assigned unique ID for this managed resource.
- protocol str
- The protocol of the load balancer.
- public_
ports Sequence[int] - The public ports of the load balancer.
- support_
code str - The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- The ARN of the Lightsail load balancer.
- created
At String - The timestamp when the load balancer was created.
- dns
Name String - The DNS name of the load balancer.
- id String
- The provider-assigned unique ID for this managed resource.
- protocol String
- The protocol of the load balancer.
- public
Ports List<Number> - The public ports of the load balancer.
- support
Code String - The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Look up Existing Lb Resource
Get an existing Lb resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: LbState, opts?: CustomResourceOptions): Lb
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
created_at: Optional[str] = None,
dns_name: Optional[str] = None,
health_check_path: Optional[str] = None,
instance_port: Optional[int] = None,
ip_address_type: Optional[str] = None,
name: Optional[str] = None,
protocol: Optional[str] = None,
public_ports: Optional[Sequence[int]] = None,
support_code: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> Lb
func GetLb(ctx *Context, name string, id IDInput, state *LbState, opts ...ResourceOption) (*Lb, error)
public static Lb Get(string name, Input<string> id, LbState? state, CustomResourceOptions? opts = null)
public static Lb get(String name, Output<String> id, LbState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Arn string
- The ARN of the Lightsail load balancer.
- Created
At string - The timestamp when the load balancer was created.
- Dns
Name string - The DNS name of the load balancer.
- Health
Check stringPath - The health check path of the load balancer. Default value "/".
- Instance
Port int - The instance port the load balancer will connect.
- Ip
Address stringType - Name string
- The name of the Lightsail load balancer.
- Protocol string
- The protocol of the load balancer.
- Public
Ports List<int> - The public ports of the load balancer.
- Support
Code string - The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- Dictionary<string, string>
- 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
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
- The ARN of the Lightsail load balancer.
- Created
At string - The timestamp when the load balancer was created.
- Dns
Name string - The DNS name of the load balancer.
- Health
Check stringPath - The health check path of the load balancer. Default value "/".
- Instance
Port int - The instance port the load balancer will connect.
- Ip
Address stringType - Name string
- The name of the Lightsail load balancer.
- Protocol string
- The protocol of the load balancer.
- Public
Ports []int - The public ports of the load balancer.
- Support
Code string - The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- map[string]string
- 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
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- The ARN of the Lightsail load balancer.
- created
At String - The timestamp when the load balancer was created.
- dns
Name String - The DNS name of the load balancer.
- health
Check StringPath - The health check path of the load balancer. Default value "/".
- instance
Port Integer - The instance port the load balancer will connect.
- ip
Address StringType - name String
- The name of the Lightsail load balancer.
- protocol String
- The protocol of the load balancer.
- public
Ports List<Integer> - The public ports of the load balancer.
- support
Code String - The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- Map<String,String>
- 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
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
- The ARN of the Lightsail load balancer.
- created
At string - The timestamp when the load balancer was created.
- dns
Name string - The DNS name of the load balancer.
- health
Check stringPath - The health check path of the load balancer. Default value "/".
- instance
Port number - The instance port the load balancer will connect.
- ip
Address stringType - name string
- The name of the Lightsail load balancer.
- protocol string
- The protocol of the load balancer.
- public
Ports number[] - The public ports of the load balancer.
- support
Code string - The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- {[key: string]: string}
- 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
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn str
- The ARN of the Lightsail load balancer.
- created_
at str - The timestamp when the load balancer was created.
- dns_
name str - The DNS name of the load balancer.
- health_
check_ strpath - The health check path of the load balancer. Default value "/".
- instance_
port int - The instance port the load balancer will connect.
- ip_
address_ strtype - name str
- The name of the Lightsail load balancer.
- protocol str
- The protocol of the load balancer.
- public_
ports Sequence[int] - The public ports of the load balancer.
- support_
code str - The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- Mapping[str, str]
- 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
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- The ARN of the Lightsail load balancer.
- created
At String - The timestamp when the load balancer was created.
- dns
Name String - The DNS name of the load balancer.
- health
Check StringPath - The health check path of the load balancer. Default value "/".
- instance
Port Number - The instance port the load balancer will connect.
- ip
Address StringType - name String
- The name of the Lightsail load balancer.
- protocol String
- The protocol of the load balancer.
- public
Ports List<Number> - The public ports of the load balancer.
- support
Code String - The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- Map<String>
- 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
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Import
Using pulumi import
, import aws_lightsail_lb
using the name attribute. For example:
$ pulumi import aws:lightsail/lb:Lb test example-load-balancer
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.