Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse
scaleway.getFlexibleIps
Explore with Pulumi AI
Gets information about multiple Flexible IPs.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumi/scaleway";
import * as scaleway from "@pulumiverse/scaleway";
// Find ips that share the same tags
const fipsByTags = scaleway.getFlexibleIps({
tags: ["a tag"],
});
// Find ips that share the same Server ID
const myOffer = scaleway.getBaremetalOffer({
name: "EM-B112X-SSD",
});
const base = new scaleway.BaremetalServer("base", {
name: "MyServer",
offer: myOffer.then(myOffer => myOffer.offerId),
installConfigAfterward: true,
});
const first = new scaleway.FlexibleIp("first", {
serverId: base.id,
tags: [
"foo",
"first",
],
});
const second = new scaleway.FlexibleIp("second", {
serverId: base.id,
tags: [
"foo",
"second",
],
});
const fipsByServerId = scaleway.getFlexibleIpsOutput({
serverIds: [base.id],
});
import pulumi
import pulumi_scaleway as scaleway
import pulumiverse_scaleway as scaleway
# Find ips that share the same tags
fips_by_tags = scaleway.get_flexible_ips(tags=["a tag"])
# Find ips that share the same Server ID
my_offer = scaleway.get_baremetal_offer(name="EM-B112X-SSD")
base = scaleway.BaremetalServer("base",
name="MyServer",
offer=my_offer.offer_id,
install_config_afterward=True)
first = scaleway.FlexibleIp("first",
server_id=base.id,
tags=[
"foo",
"first",
])
second = scaleway.FlexibleIp("second",
server_id=base.id,
tags=[
"foo",
"second",
])
fips_by_server_id = scaleway.get_flexible_ips_output(server_ids=[base.id])
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Find ips that share the same tags
_, err := scaleway.GetFlexibleIps(ctx, &scaleway.GetFlexibleIpsArgs{
Tags: []string{
"a tag",
},
}, nil)
if err != nil {
return err
}
// Find ips that share the same Server ID
myOffer, err := scaleway.GetBaremetalOffer(ctx, &scaleway.GetBaremetalOfferArgs{
Name: pulumi.StringRef("EM-B112X-SSD"),
}, nil)
if err != nil {
return err
}
base, err := scaleway.NewBaremetalServer(ctx, "base", &scaleway.BaremetalServerArgs{
Name: pulumi.String("MyServer"),
Offer: pulumi.String(myOffer.OfferId),
InstallConfigAfterward: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = scaleway.NewFlexibleIp(ctx, "first", &scaleway.FlexibleIpArgs{
ServerId: base.ID(),
Tags: pulumi.StringArray{
pulumi.String("foo"),
pulumi.String("first"),
},
})
if err != nil {
return err
}
_, err = scaleway.NewFlexibleIp(ctx, "second", &scaleway.FlexibleIpArgs{
ServerId: base.ID(),
Tags: pulumi.StringArray{
pulumi.String("foo"),
pulumi.String("second"),
},
})
if err != nil {
return err
}
_ = scaleway.GetFlexibleIpsOutput(ctx, scaleway.GetFlexibleIpsOutputArgs{
ServerIds: pulumi.StringArray{
base.ID(),
},
}, nil)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumi.Scaleway;
using Scaleway = Pulumiverse.Scaleway;
return await Deployment.RunAsync(() =>
{
// Find ips that share the same tags
var fipsByTags = Scaleway.GetFlexibleIps.Invoke(new()
{
Tags = new[]
{
"a tag",
},
});
// Find ips that share the same Server ID
var myOffer = Scaleway.GetBaremetalOffer.Invoke(new()
{
Name = "EM-B112X-SSD",
});
var @base = new Scaleway.BaremetalServer("base", new()
{
Name = "MyServer",
Offer = myOffer.Apply(getBaremetalOfferResult => getBaremetalOfferResult.OfferId),
InstallConfigAfterward = true,
});
var first = new Scaleway.FlexibleIp("first", new()
{
ServerId = @base.Id,
Tags = new[]
{
"foo",
"first",
},
});
var second = new Scaleway.FlexibleIp("second", new()
{
ServerId = @base.Id,
Tags = new[]
{
"foo",
"second",
},
});
var fipsByServerId = Scaleway.GetFlexibleIps.Invoke(new()
{
ServerIds = new[]
{
@base.Id,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.ScalewayFunctions;
import com.pulumi.scaleway.inputs.GetFlexibleIpsArgs;
import com.pulumi.scaleway.inputs.GetBaremetalOfferArgs;
import com.pulumi.scaleway.BaremetalServer;
import com.pulumi.scaleway.BaremetalServerArgs;
import com.pulumi.scaleway.FlexibleIp;
import com.pulumi.scaleway.FlexibleIpArgs;
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) {
// Find ips that share the same tags
final var fipsByTags = ScalewayFunctions.getFlexibleIps(GetFlexibleIpsArgs.builder()
.tags("a tag")
.build());
// Find ips that share the same Server ID
final var myOffer = ScalewayFunctions.getBaremetalOffer(GetBaremetalOfferArgs.builder()
.name("EM-B112X-SSD")
.build());
var base = new BaremetalServer("base", BaremetalServerArgs.builder()
.name("MyServer")
.offer(myOffer.applyValue(getBaremetalOfferResult -> getBaremetalOfferResult.offerId()))
.installConfigAfterward(true)
.build());
var first = new FlexibleIp("first", FlexibleIpArgs.builder()
.serverId(base.id())
.tags(
"foo",
"first")
.build());
var second = new FlexibleIp("second", FlexibleIpArgs.builder()
.serverId(base.id())
.tags(
"foo",
"second")
.build());
final var fipsByServerId = ScalewayFunctions.getFlexibleIps(GetFlexibleIpsArgs.builder()
.serverIds(base.id())
.build());
}
}
resources:
base:
type: scaleway:BaremetalServer
properties:
name: MyServer
offer: ${myOffer.offerId}
installConfigAfterward: true
first:
type: scaleway:FlexibleIp
properties:
serverId: ${base.id}
tags:
- foo
- first
second:
type: scaleway:FlexibleIp
properties:
serverId: ${base.id}
tags:
- foo
- second
variables:
# Find ips that share the same tags
fipsByTags:
fn::invoke:
Function: scaleway:getFlexibleIps
Arguments:
tags:
- a tag
# Find ips that share the same Server ID
myOffer:
fn::invoke:
Function: scaleway:getBaremetalOffer
Arguments:
name: EM-B112X-SSD
fipsByServerId:
fn::invoke:
Function: scaleway:getFlexibleIps
Arguments:
serverIds:
- ${base.id}
Using getFlexibleIps
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 getFlexibleIps(args: GetFlexibleIpsArgs, opts?: InvokeOptions): Promise<GetFlexibleIpsResult>
function getFlexibleIpsOutput(args: GetFlexibleIpsOutputArgs, opts?: InvokeOptions): Output<GetFlexibleIpsResult>
def get_flexible_ips(project_id: Optional[str] = None,
server_ids: Optional[Sequence[str]] = None,
tags: Optional[Sequence[str]] = None,
zone: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetFlexibleIpsResult
def get_flexible_ips_output(project_id: Optional[pulumi.Input[str]] = None,
server_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
zone: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetFlexibleIpsResult]
func GetFlexibleIps(ctx *Context, args *GetFlexibleIpsArgs, opts ...InvokeOption) (*GetFlexibleIpsResult, error)
func GetFlexibleIpsOutput(ctx *Context, args *GetFlexibleIpsOutputArgs, opts ...InvokeOption) GetFlexibleIpsResultOutput
> Note: This function is named GetFlexibleIps
in the Go SDK.
public static class GetFlexibleIps
{
public static Task<GetFlexibleIpsResult> InvokeAsync(GetFlexibleIpsArgs args, InvokeOptions? opts = null)
public static Output<GetFlexibleIpsResult> Invoke(GetFlexibleIpsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetFlexibleIpsResult> getFlexibleIps(GetFlexibleIpsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: scaleway:index/getFlexibleIps:getFlexibleIps
arguments:
# arguments dictionary
The following arguments are supported:
- Project
Id string - (Defaults to provider
project_id
) The ID of the project the IP is in. - Server
Ids List<string> - List of server IDs used as filter. IPs with these exact server IDs are listed.
- List<string>
- List of tags used as filter. IPs with these exact tags are listed.
- Zone string
zone
) The zone in which IPs exist.
- Project
Id string - (Defaults to provider
project_id
) The ID of the project the IP is in. - Server
Ids []string - List of server IDs used as filter. IPs with these exact server IDs are listed.
- []string
- List of tags used as filter. IPs with these exact tags are listed.
- Zone string
zone
) The zone in which IPs exist.
- project
Id String - (Defaults to provider
project_id
) The ID of the project the IP is in. - server
Ids List<String> - List of server IDs used as filter. IPs with these exact server IDs are listed.
- List<String>
- List of tags used as filter. IPs with these exact tags are listed.
- zone String
zone
) The zone in which IPs exist.
- project
Id string - (Defaults to provider
project_id
) The ID of the project the IP is in. - server
Ids string[] - List of server IDs used as filter. IPs with these exact server IDs are listed.
- string[]
- List of tags used as filter. IPs with these exact tags are listed.
- zone string
zone
) The zone in which IPs exist.
- project_
id str - (Defaults to provider
project_id
) The ID of the project the IP is in. - server_
ids Sequence[str] - List of server IDs used as filter. IPs with these exact server IDs are listed.
- Sequence[str]
- List of tags used as filter. IPs with these exact tags are listed.
- zone str
zone
) The zone in which IPs exist.
- project
Id String - (Defaults to provider
project_id
) The ID of the project the IP is in. - server
Ids List<String> - List of server IDs used as filter. IPs with these exact server IDs are listed.
- List<String>
- List of tags used as filter. IPs with these exact tags are listed.
- zone String
zone
) The zone in which IPs exist.
getFlexibleIps Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ips
List<Pulumiverse.
Scaleway. Outputs. Get Flexible Ips Ip> - List of found flexible IPS
- Organization
Id string - (Defaults to provider
organization_id
) The ID of the organization the IP is in. - Project
Id string - (Defaults to provider
project_id
) The ID of the project the IP is in. - Zone string
- (Defaults to provider
zone
) The zone in which the MAC address exist. - Server
Ids List<string> - List<string>
- The list of tags which are attached to the flexible IP.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ips
[]Get
Flexible Ips Ip - List of found flexible IPS
- Organization
Id string - (Defaults to provider
organization_id
) The ID of the organization the IP is in. - Project
Id string - (Defaults to provider
project_id
) The ID of the project the IP is in. - Zone string
- (Defaults to provider
zone
) The zone in which the MAC address exist. - Server
Ids []string - []string
- The list of tags which are attached to the flexible IP.
- id String
- The provider-assigned unique ID for this managed resource.
- ips
List<Get
Flexible Ips Ip> - List of found flexible IPS
- organization
Id String - (Defaults to provider
organization_id
) The ID of the organization the IP is in. - project
Id String - (Defaults to provider
project_id
) The ID of the project the IP is in. - zone String
- (Defaults to provider
zone
) The zone in which the MAC address exist. - server
Ids List<String> - List<String>
- The list of tags which are attached to the flexible IP.
- id string
- The provider-assigned unique ID for this managed resource.
- ips
Get
Flexible Ips Ip[] - List of found flexible IPS
- organization
Id string - (Defaults to provider
organization_id
) The ID of the organization the IP is in. - project
Id string - (Defaults to provider
project_id
) The ID of the project the IP is in. - zone string
- (Defaults to provider
zone
) The zone in which the MAC address exist. - server
Ids string[] - string[]
- The list of tags which are attached to the flexible IP.
- id str
- The provider-assigned unique ID for this managed resource.
- ips
Sequence[Get
Flexible Ips Ip] - List of found flexible IPS
- organization_
id str - (Defaults to provider
organization_id
) The ID of the organization the IP is in. - project_
id str - (Defaults to provider
project_id
) The ID of the project the IP is in. - zone str
- (Defaults to provider
zone
) The zone in which the MAC address exist. - server_
ids Sequence[str] - Sequence[str]
- The list of tags which are attached to the flexible IP.
- id String
- The provider-assigned unique ID for this managed resource.
- ips List<Property Map>
- List of found flexible IPS
- organization
Id String - (Defaults to provider
organization_id
) The ID of the organization the IP is in. - project
Id String - (Defaults to provider
project_id
) The ID of the project the IP is in. - zone String
- (Defaults to provider
zone
) The zone in which the MAC address exist. - server
Ids List<String> - List<String>
- The list of tags which are attached to the flexible IP.
Supporting Types
GetFlexibleIpsIp
- Created
At string - The date on which the flexible IP was created (RFC 3339 format).
- Description string
- The description of the flexible IP.
- Id string
- The MAC address ID.
- Ip
Address string - Mac
Addresses List<Pulumiverse.Scaleway. Inputs. Get Flexible Ips Ip Mac Address> - The MAC address of the Virtual MAC.
- Organization
Id string - (Defaults to provider
organization_id
) The ID of the organization the IP is in. - Project
Id string - (Defaults to provider
project_id
) The ID of the project the IP is in. - Reverse string
- The reverse domain associated with this IP.
- Status string
- The status of virtual MAC.
- List<string>
- List of tags used as filter. IPs with these exact tags are listed.
- Updated
At string - The date on which the flexible IP was last updated (RFC 3339 format).
- Zone string
zone
) The zone in which IPs exist.
- Created
At string - The date on which the flexible IP was created (RFC 3339 format).
- Description string
- The description of the flexible IP.
- Id string
- The MAC address ID.
- Ip
Address string - Mac
Addresses []GetFlexible Ips Ip Mac Address - The MAC address of the Virtual MAC.
- Organization
Id string - (Defaults to provider
organization_id
) The ID of the organization the IP is in. - Project
Id string - (Defaults to provider
project_id
) The ID of the project the IP is in. - Reverse string
- The reverse domain associated with this IP.
- Status string
- The status of virtual MAC.
- []string
- List of tags used as filter. IPs with these exact tags are listed.
- Updated
At string - The date on which the flexible IP was last updated (RFC 3339 format).
- Zone string
zone
) The zone in which IPs exist.
- created
At String - The date on which the flexible IP was created (RFC 3339 format).
- description String
- The description of the flexible IP.
- id String
- The MAC address ID.
- ip
Address String - mac
Addresses List<GetFlexible Ips Ip Mac Address> - The MAC address of the Virtual MAC.
- organization
Id String - (Defaults to provider
organization_id
) The ID of the organization the IP is in. - project
Id String - (Defaults to provider
project_id
) The ID of the project the IP is in. - reverse String
- The reverse domain associated with this IP.
- status String
- The status of virtual MAC.
- List<String>
- List of tags used as filter. IPs with these exact tags are listed.
- updated
At String - The date on which the flexible IP was last updated (RFC 3339 format).
- zone String
zone
) The zone in which IPs exist.
- created
At string - The date on which the flexible IP was created (RFC 3339 format).
- description string
- The description of the flexible IP.
- id string
- The MAC address ID.
- ip
Address string - mac
Addresses GetFlexible Ips Ip Mac Address[] - The MAC address of the Virtual MAC.
- organization
Id string - (Defaults to provider
organization_id
) The ID of the organization the IP is in. - project
Id string - (Defaults to provider
project_id
) The ID of the project the IP is in. - reverse string
- The reverse domain associated with this IP.
- status string
- The status of virtual MAC.
- string[]
- List of tags used as filter. IPs with these exact tags are listed.
- updated
At string - The date on which the flexible IP was last updated (RFC 3339 format).
- zone string
zone
) The zone in which IPs exist.
- created_
at str - The date on which the flexible IP was created (RFC 3339 format).
- description str
- The description of the flexible IP.
- id str
- The MAC address ID.
- ip_
address str - mac_
addresses Sequence[GetFlexible Ips Ip Mac Address] - The MAC address of the Virtual MAC.
- organization_
id str - (Defaults to provider
organization_id
) The ID of the organization the IP is in. - project_
id str - (Defaults to provider
project_id
) The ID of the project the IP is in. - reverse str
- The reverse domain associated with this IP.
- status str
- The status of virtual MAC.
- Sequence[str]
- List of tags used as filter. IPs with these exact tags are listed.
- updated_
at str - The date on which the flexible IP was last updated (RFC 3339 format).
- zone str
zone
) The zone in which IPs exist.
- created
At String - The date on which the flexible IP was created (RFC 3339 format).
- description String
- The description of the flexible IP.
- id String
- The MAC address ID.
- ip
Address String - mac
Addresses List<Property Map> - The MAC address of the Virtual MAC.
- organization
Id String - (Defaults to provider
organization_id
) The ID of the organization the IP is in. - project
Id String - (Defaults to provider
project_id
) The ID of the project the IP is in. - reverse String
- The reverse domain associated with this IP.
- status String
- The status of virtual MAC.
- List<String>
- List of tags used as filter. IPs with these exact tags are listed.
- updated
At String - The date on which the flexible IP was last updated (RFC 3339 format).
- zone String
zone
) The zone in which IPs exist.
GetFlexibleIpsIpMacAddress
- Created
At string - The date on which the flexible IP was created (RFC 3339 format).
- Id string
- The MAC address ID.
- Mac
Address string - The MAC address of the Virtual MAC.
- Mac
Type string - The type of virtual MAC.
- Status string
- The status of virtual MAC.
- Updated
At string - The date on which the flexible IP was last updated (RFC 3339 format).
- Zone string
zone
) The zone in which IPs exist.
- Created
At string - The date on which the flexible IP was created (RFC 3339 format).
- Id string
- The MAC address ID.
- Mac
Address string - The MAC address of the Virtual MAC.
- Mac
Type string - The type of virtual MAC.
- Status string
- The status of virtual MAC.
- Updated
At string - The date on which the flexible IP was last updated (RFC 3339 format).
- Zone string
zone
) The zone in which IPs exist.
- created
At String - The date on which the flexible IP was created (RFC 3339 format).
- id String
- The MAC address ID.
- mac
Address String - The MAC address of the Virtual MAC.
- mac
Type String - The type of virtual MAC.
- status String
- The status of virtual MAC.
- updated
At String - The date on which the flexible IP was last updated (RFC 3339 format).
- zone String
zone
) The zone in which IPs exist.
- created
At string - The date on which the flexible IP was created (RFC 3339 format).
- id string
- The MAC address ID.
- mac
Address string - The MAC address of the Virtual MAC.
- mac
Type string - The type of virtual MAC.
- status string
- The status of virtual MAC.
- updated
At string - The date on which the flexible IP was last updated (RFC 3339 format).
- zone string
zone
) The zone in which IPs exist.
- created_
at str - The date on which the flexible IP was created (RFC 3339 format).
- id str
- The MAC address ID.
- mac_
address str - The MAC address of the Virtual MAC.
- mac_
type str - The type of virtual MAC.
- status str
- The status of virtual MAC.
- updated_
at str - The date on which the flexible IP was last updated (RFC 3339 format).
- zone str
zone
) The zone in which IPs exist.
- created
At String - The date on which the flexible IP was created (RFC 3339 format).
- id String
- The MAC address ID.
- mac
Address String - The MAC address of the Virtual MAC.
- mac
Type String - The type of virtual MAC.
- status String
- The status of virtual MAC.
- updated
At String - The date on which the flexible IP was last updated (RFC 3339 format).
- zone String
zone
) The zone in which IPs exist.
Package Details
- Repository
- scaleway pulumiverse/pulumi-scaleway
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
scaleway
Terraform Provider.