StaticIpAttachment

Provides a static IP address attachment - relationship between a Lightsail static IP & Lightsail instance.

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

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var testStaticIp = new Aws.LightSail.StaticIp("testStaticIp", new Aws.LightSail.StaticIpArgs
        {
        });
        var testInstance = new Aws.LightSail.Instance("testInstance", new Aws.LightSail.InstanceArgs
        {
            AvailabilityZone = "us-east-1b",
            BlueprintId = "string",
            BundleId = "string",
            KeyPairName = "some_key_name",
        });
        var testStaticIpAttachment = new Aws.LightSail.StaticIpAttachment("testStaticIpAttachment", new Aws.LightSail.StaticIpAttachmentArgs
        {
            InstanceName = testInstance.Id,
            StaticIpName = testStaticIp.Id,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/lightsail"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        testStaticIp, err := lightsail.NewStaticIp(ctx, "testStaticIp", nil)
        if err != nil {
            return err
        }
        testInstance, err := lightsail.NewInstance(ctx, "testInstance", &lightsail.InstanceArgs{
            AvailabilityZone: pulumi.String("us-east-1b"),
            BlueprintId:      pulumi.String("string"),
            BundleId:         pulumi.String("string"),
            KeyPairName:      pulumi.String("some_key_name"),
        })
        if err != nil {
            return err
        }
        _, err = lightsail.NewStaticIpAttachment(ctx, "testStaticIpAttachment", &lightsail.StaticIpAttachmentArgs{
            InstanceName: testInstance.ID(),
            StaticIpName: testStaticIp.ID(),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

test_static_ip = aws.lightsail.StaticIp("testStaticIp")
test_instance = aws.lightsail.Instance("testInstance",
    availability_zone="us-east-1b",
    blueprint_id="string",
    bundle_id="string",
    key_pair_name="some_key_name")
test_static_ip_attachment = aws.lightsail.StaticIpAttachment("testStaticIpAttachment",
    instance_name=test_instance.id,
    static_ip_name=test_static_ip.id)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const testStaticIp = new aws.lightsail.StaticIp("test", {});
const testInstance = new aws.lightsail.Instance("test", {
    availabilityZone: "us-east-1b",
    blueprintId: "string",
    bundleId: "string",
    keyPairName: "some_key_name",
});
const testStaticIpAttachment = new aws.lightsail.StaticIpAttachment("test", {
    instanceName: testInstance.id,
    staticIpName: testStaticIp.id,
});

Create a StaticIpAttachment Resource

def StaticIpAttachment(resource_name, opts=None, instance_name=None, static_ip_name=None, __props__=None);
name string
The unique name of the resource.
args StaticIpAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args StaticIpAttachmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args StaticIpAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

StaticIpAttachment Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The StaticIpAttachment resource accepts the following input properties:

InstanceName string

The name of the Lightsail instance to attach the IP to

StaticIpName string

The name of the allocated static IP

InstanceName string

The name of the Lightsail instance to attach the IP to

StaticIpName string

The name of the allocated static IP

instanceName string

The name of the Lightsail instance to attach the IP to

staticIpName string

The name of the allocated static IP

instance_name str

The name of the Lightsail instance to attach the IP to

static_ip_name str

The name of the allocated static IP

Outputs

All input properties are implicitly available as output properties. Additionally, the StaticIpAttachment resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
IpAddress string

The allocated static IP address

Id string
The provider-assigned unique ID for this managed resource.
IpAddress string

The allocated static IP address

id string
The provider-assigned unique ID for this managed resource.
ipAddress string

The allocated static IP address

id str
The provider-assigned unique ID for this managed resource.
ip_address str

The allocated static IP address

Look up an Existing StaticIpAttachment Resource

Get an existing StaticIpAttachment 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?: StaticIpAttachmentState, opts?: CustomResourceOptions): StaticIpAttachment
static get(resource_name, id, opts=None, instance_name=None, ip_address=None, static_ip_name=None, __props__=None);
func GetStaticIpAttachment(ctx *Context, name string, id IDInput, state *StaticIpAttachmentState, opts ...ResourceOption) (*StaticIpAttachment, error)
public static StaticIpAttachment Get(string name, Input<string> id, StaticIpAttachmentState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

InstanceName string

The name of the Lightsail instance to attach the IP to

IpAddress string

The allocated static IP address

StaticIpName string

The name of the allocated static IP

InstanceName string

The name of the Lightsail instance to attach the IP to

IpAddress string

The allocated static IP address

StaticIpName string

The name of the allocated static IP

instanceName string

The name of the Lightsail instance to attach the IP to

ipAddress string

The allocated static IP address

staticIpName string

The name of the allocated static IP

instance_name str

The name of the Lightsail instance to attach the IP to

ip_address str

The allocated static IP address

static_ip_name str

The name of the allocated static IP

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.