aws.lightsail.StaticIp
Explore with Pulumi AI
Manages a static IP address.
Use this resource to allocate a static IP address that can be attached to Lightsail instances to provide a consistent public IP address that persists across instance restarts.
Note: Lightsail is currently only supported in a limited number of AWS Regions, please see “Regions and Availability Zones in Amazon Lightsail” for more details.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.lightsail.StaticIp("example", {name: "example"});
import pulumi
import pulumi_aws as aws
example = aws.lightsail.StaticIp("example", name="example")
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.NewStaticIp(ctx, "example", &lightsail.StaticIpArgs{
Name: pulumi.String("example"),
})
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 example = new Aws.LightSail.StaticIp("example", new()
{
Name = "example",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lightsail.StaticIp;
import com.pulumi.aws.lightsail.StaticIpArgs;
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 example = new StaticIp("example", StaticIpArgs.builder()
.name("example")
.build());
}
}
resources:
example:
type: aws:lightsail:StaticIp
properties:
name: example
Create StaticIp Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new StaticIp(name: string, args?: StaticIpArgs, opts?: CustomResourceOptions);
@overload
def StaticIp(resource_name: str,
args: Optional[StaticIpArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def StaticIp(resource_name: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None)
func NewStaticIp(ctx *Context, name string, args *StaticIpArgs, opts ...ResourceOption) (*StaticIp, error)
public StaticIp(string name, StaticIpArgs? args = null, CustomResourceOptions? opts = null)
public StaticIp(String name, StaticIpArgs args)
public StaticIp(String name, StaticIpArgs args, CustomResourceOptions options)
type: aws:lightsail:StaticIp
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 StaticIpArgs
- 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 StaticIpArgs
- 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 StaticIpArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args StaticIpArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args StaticIpArgs
- 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 staticIpResource = new Aws.LightSail.StaticIp("staticIpResource", new()
{
Name = "string",
});
example, err := lightsail.NewStaticIp(ctx, "staticIpResource", &lightsail.StaticIpArgs{
Name: pulumi.String("string"),
})
var staticIpResource = new StaticIp("staticIpResource", StaticIpArgs.builder()
.name("string")
.build());
static_ip_resource = aws.lightsail.StaticIp("staticIpResource", name="string")
const staticIpResource = new aws.lightsail.StaticIp("staticIpResource", {name: "string"});
type: aws:lightsail:StaticIp
properties:
name: string
StaticIp Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The StaticIp resource accepts the following input properties:
- Name string
- Name for the allocated static IP.
- Name string
- Name for the allocated static IP.
- name String
- Name for the allocated static IP.
- name string
- Name for the allocated static IP.
- name str
- Name for the allocated static IP.
- name String
- Name for the allocated static IP.
Outputs
All input properties are implicitly available as output properties. Additionally, the StaticIp resource produces the following output properties:
- Arn string
- ARN of the Lightsail static IP.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ip
Address string - Allocated static IP address.
- Support
Code string - Support code for the static IP. Include this code in your email to support when you have questions about a static IP in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- Arn string
- ARN of the Lightsail static IP.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ip
Address string - Allocated static IP address.
- Support
Code string - Support code for the static IP. Include this code in your email to support when you have questions about a static IP in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- arn String
- ARN of the Lightsail static IP.
- id String
- The provider-assigned unique ID for this managed resource.
- ip
Address String - Allocated static IP address.
- support
Code String - Support code for the static IP. Include this code in your email to support when you have questions about a static IP in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- arn string
- ARN of the Lightsail static IP.
- id string
- The provider-assigned unique ID for this managed resource.
- ip
Address string - Allocated static IP address.
- support
Code string - Support code for the static IP. Include this code in your email to support when you have questions about a static IP in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- arn str
- ARN of the Lightsail static IP.
- id str
- The provider-assigned unique ID for this managed resource.
- ip_
address str - Allocated static IP address.
- support_
code str - Support code for the static IP. Include this code in your email to support when you have questions about a static IP in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- arn String
- ARN of the Lightsail static IP.
- id String
- The provider-assigned unique ID for this managed resource.
- ip
Address String - Allocated static IP address.
- support
Code String - Support code for the static IP. Include this code in your email to support when you have questions about a static IP in Lightsail. This code enables our support team to look up your Lightsail information more easily.
Look up Existing StaticIp Resource
Get an existing StaticIp 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?: StaticIpState, opts?: CustomResourceOptions): StaticIp
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
ip_address: Optional[str] = None,
name: Optional[str] = None,
support_code: Optional[str] = None) -> StaticIp
func GetStaticIp(ctx *Context, name string, id IDInput, state *StaticIpState, opts ...ResourceOption) (*StaticIp, error)
public static StaticIp Get(string name, Input<string> id, StaticIpState? state, CustomResourceOptions? opts = null)
public static StaticIp get(String name, Output<String> id, StaticIpState state, CustomResourceOptions options)
resources: _: type: aws:lightsail:StaticIp get: id: ${id}
- 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
- ARN of the Lightsail static IP.
- Ip
Address string - Allocated static IP address.
- Name string
- Name for the allocated static IP.
- Support
Code string - Support code for the static IP. Include this code in your email to support when you have questions about a static IP in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- Arn string
- ARN of the Lightsail static IP.
- Ip
Address string - Allocated static IP address.
- Name string
- Name for the allocated static IP.
- Support
Code string - Support code for the static IP. Include this code in your email to support when you have questions about a static IP in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- arn String
- ARN of the Lightsail static IP.
- ip
Address String - Allocated static IP address.
- name String
- Name for the allocated static IP.
- support
Code String - Support code for the static IP. Include this code in your email to support when you have questions about a static IP in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- arn string
- ARN of the Lightsail static IP.
- ip
Address string - Allocated static IP address.
- name string
- Name for the allocated static IP.
- support
Code string - Support code for the static IP. Include this code in your email to support when you have questions about a static IP in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- arn str
- ARN of the Lightsail static IP.
- ip_
address str - Allocated static IP address.
- name str
- Name for the allocated static IP.
- support_
code str - Support code for the static IP. Include this code in your email to support when you have questions about a static IP in Lightsail. This code enables our support team to look up your Lightsail information more easily.
- arn String
- ARN of the Lightsail static IP.
- ip
Address String - Allocated static IP address.
- name String
- Name for the allocated static IP.
- support
Code String - Support code for the static IP. Include this code in your email to support when you have questions about a static IP in Lightsail. This code enables our support team to look up your Lightsail information more easily.
Import
Using pulumi import
, import aws_lightsail_static_ip
using the name attribute. For example:
$ pulumi import aws:lightsail/staticIp:StaticIp example example
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.