DigitalOcean v4.33.0 published on Thursday, Sep 26, 2024 by Pulumi
digitalocean.getReservedIp
Explore with Pulumi AI
Example Usage
Get the reserved IP:
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const config = new pulumi.Config();
const publicIp = config.requireObject("publicIp");
const example = digitalocean.getReservedIp({
ipAddress: publicIp,
});
export const fipOutput = example.then(example => example.dropletId);
import pulumi
import pulumi_digitalocean as digitalocean
config = pulumi.Config()
public_ip = config.require_object("publicIp")
example = digitalocean.get_reserved_ip(ip_address=public_ip)
pulumi.export("fipOutput", example.droplet_id)
package main
import (
"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
publicIp := cfg.RequireObject("publicIp")
example, err := digitalocean.LookupReservedIp(ctx, &digitalocean.LookupReservedIpArgs{
IpAddress: publicIp,
}, nil)
if err != nil {
return err
}
ctx.Export("fipOutput", example.DropletId)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var publicIp = config.RequireObject<dynamic>("publicIp");
var example = DigitalOcean.GetReservedIp.Invoke(new()
{
IpAddress = publicIp,
});
return new Dictionary<string, object?>
{
["fipOutput"] = example.Apply(getReservedIpResult => getReservedIpResult.DropletId),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DigitaloceanFunctions;
import com.pulumi.digitalocean.inputs.GetReservedIpArgs;
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) {
final var config = ctx.config();
final var publicIp = config.get("publicIp");
final var example = DigitaloceanFunctions.getReservedIp(GetReservedIpArgs.builder()
.ipAddress(publicIp)
.build());
ctx.export("fipOutput", example.applyValue(getReservedIpResult -> getReservedIpResult.dropletId()));
}
}
configuration:
publicIp:
type: dynamic
variables:
example:
fn::invoke:
Function: digitalocean:getReservedIp
Arguments:
ipAddress: ${publicIp}
outputs:
fipOutput: ${example.dropletId}
Using getReservedIp
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getReservedIp(args: GetReservedIpArgs, opts?: InvokeOptions): Promise<GetReservedIpResult>
function getReservedIpOutput(args: GetReservedIpOutputArgs, opts?: InvokeOptions): Output<GetReservedIpResult>
def get_reserved_ip(ip_address: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetReservedIpResult
def get_reserved_ip_output(ip_address: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetReservedIpResult]
func LookupReservedIp(ctx *Context, args *LookupReservedIpArgs, opts ...InvokeOption) (*LookupReservedIpResult, error)
func LookupReservedIpOutput(ctx *Context, args *LookupReservedIpOutputArgs, opts ...InvokeOption) LookupReservedIpResultOutput
> Note: This function is named LookupReservedIp
in the Go SDK.
public static class GetReservedIp
{
public static Task<GetReservedIpResult> InvokeAsync(GetReservedIpArgs args, InvokeOptions? opts = null)
public static Output<GetReservedIpResult> Invoke(GetReservedIpInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetReservedIpResult> getReservedIp(GetReservedIpArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: digitalocean:index/getReservedIp:getReservedIp
arguments:
# arguments dictionary
The following arguments are supported:
- Ip
Address string - The allocated IP address of the specific reserved IP to retrieve.
- Ip
Address string - The allocated IP address of the specific reserved IP to retrieve.
- ip
Address String - The allocated IP address of the specific reserved IP to retrieve.
- ip
Address string - The allocated IP address of the specific reserved IP to retrieve.
- ip_
address str - The allocated IP address of the specific reserved IP to retrieve.
- ip
Address String - The allocated IP address of the specific reserved IP to retrieve.
getReservedIp Result
The following output properties are available:
- droplet_
id int - The Droplet id that the reserved IP has been assigned to.
- id str
- The provider-assigned unique ID for this managed resource.
- ip_
address str - region str
- The region that the reserved IP is reserved to.
- urn str
- The uniform resource name of the reserved IP.
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitalocean
Terraform Provider.