1. Packages
  2. Scaleway
  3. API Docs
  4. getFlexibleIps
Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse

scaleway.getFlexibleIps

Explore with Pulumi AI

scaleway logo
Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse

    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:

    ProjectId string
    (Defaults to provider project_id) The ID of the project the IP is in.
    ServerIds List<string>
    List of server IDs used as filter. IPs with these exact server IDs are listed.
    Tags List<string>
    List of tags used as filter. IPs with these exact tags are listed.
    Zone string
    zone) The zone in which IPs exist.
    ProjectId string
    (Defaults to provider project_id) The ID of the project the IP is in.
    ServerIds []string
    List of server IDs used as filter. IPs with these exact server IDs are listed.
    Tags []string
    List of tags used as filter. IPs with these exact tags are listed.
    Zone string
    zone) The zone in which IPs exist.
    projectId String
    (Defaults to provider project_id) The ID of the project the IP is in.
    serverIds List<String>
    List of server IDs used as filter. IPs with these exact server IDs are listed.
    tags List<String>
    List of tags used as filter. IPs with these exact tags are listed.
    zone String
    zone) The zone in which IPs exist.
    projectId string
    (Defaults to provider project_id) The ID of the project the IP is in.
    serverIds string[]
    List of server IDs used as filter. IPs with these exact server IDs are listed.
    tags 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.
    tags Sequence[str]
    List of tags used as filter. IPs with these exact tags are listed.
    zone str
    zone) The zone in which IPs exist.
    projectId String
    (Defaults to provider project_id) The ID of the project the IP is in.
    serverIds List<String>
    List of server IDs used as filter. IPs with these exact server IDs are listed.
    tags 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.GetFlexibleIpsIp>
    List of found flexible IPS
    OrganizationId string
    (Defaults to provider organization_id) The ID of the organization the IP is in.
    ProjectId 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.
    ServerIds List<string>
    Tags 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 []GetFlexibleIpsIp
    List of found flexible IPS
    OrganizationId string
    (Defaults to provider organization_id) The ID of the organization the IP is in.
    ProjectId 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.
    ServerIds []string
    Tags []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<GetFlexibleIpsIp>
    List of found flexible IPS
    organizationId String
    (Defaults to provider organization_id) The ID of the organization the IP is in.
    projectId 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.
    serverIds List<String>
    tags 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 GetFlexibleIpsIp[]
    List of found flexible IPS
    organizationId string
    (Defaults to provider organization_id) The ID of the organization the IP is in.
    projectId 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.
    serverIds string[]
    tags 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[GetFlexibleIpsIp]
    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]
    tags 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
    organizationId String
    (Defaults to provider organization_id) The ID of the organization the IP is in.
    projectId 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.
    serverIds List<String>
    tags List<String>
    The list of tags which are attached to the flexible IP.

    Supporting Types

    GetFlexibleIpsIp

    CreatedAt 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.
    IpAddress string
    MacAddresses List<Pulumiverse.Scaleway.Inputs.GetFlexibleIpsIpMacAddress>
    The MAC address of the Virtual MAC.
    OrganizationId string
    (Defaults to provider organization_id) The ID of the organization the IP is in.
    ProjectId 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.
    Tags List<string>
    List of tags used as filter. IPs with these exact tags are listed.
    UpdatedAt string
    The date on which the flexible IP was last updated (RFC 3339 format).
    Zone string
    zone) The zone in which IPs exist.
    CreatedAt 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.
    IpAddress string
    MacAddresses []GetFlexibleIpsIpMacAddress
    The MAC address of the Virtual MAC.
    OrganizationId string
    (Defaults to provider organization_id) The ID of the organization the IP is in.
    ProjectId 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.
    Tags []string
    List of tags used as filter. IPs with these exact tags are listed.
    UpdatedAt string
    The date on which the flexible IP was last updated (RFC 3339 format).
    Zone string
    zone) The zone in which IPs exist.
    createdAt 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.
    ipAddress String
    macAddresses List<GetFlexibleIpsIpMacAddress>
    The MAC address of the Virtual MAC.
    organizationId String
    (Defaults to provider organization_id) The ID of the organization the IP is in.
    projectId 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.
    tags List<String>
    List of tags used as filter. IPs with these exact tags are listed.
    updatedAt String
    The date on which the flexible IP was last updated (RFC 3339 format).
    zone String
    zone) The zone in which IPs exist.
    createdAt 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.
    ipAddress string
    macAddresses GetFlexibleIpsIpMacAddress[]
    The MAC address of the Virtual MAC.
    organizationId string
    (Defaults to provider organization_id) The ID of the organization the IP is in.
    projectId 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.
    tags string[]
    List of tags used as filter. IPs with these exact tags are listed.
    updatedAt 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[GetFlexibleIpsIpMacAddress]
    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.
    tags 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.
    createdAt 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.
    ipAddress String
    macAddresses List<Property Map>
    The MAC address of the Virtual MAC.
    organizationId String
    (Defaults to provider organization_id) The ID of the organization the IP is in.
    projectId 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.
    tags List<String>
    List of tags used as filter. IPs with these exact tags are listed.
    updatedAt String
    The date on which the flexible IP was last updated (RFC 3339 format).
    zone String
    zone) The zone in which IPs exist.

    GetFlexibleIpsIpMacAddress

    CreatedAt string
    The date on which the flexible IP was created (RFC 3339 format).
    Id string
    The MAC address ID.
    MacAddress string
    The MAC address of the Virtual MAC.
    MacType string
    The type of virtual MAC.
    Status string
    The status of virtual MAC.
    UpdatedAt string
    The date on which the flexible IP was last updated (RFC 3339 format).
    Zone string
    zone) The zone in which IPs exist.
    CreatedAt string
    The date on which the flexible IP was created (RFC 3339 format).
    Id string
    The MAC address ID.
    MacAddress string
    The MAC address of the Virtual MAC.
    MacType string
    The type of virtual MAC.
    Status string
    The status of virtual MAC.
    UpdatedAt string
    The date on which the flexible IP was last updated (RFC 3339 format).
    Zone string
    zone) The zone in which IPs exist.
    createdAt String
    The date on which the flexible IP was created (RFC 3339 format).
    id String
    The MAC address ID.
    macAddress String
    The MAC address of the Virtual MAC.
    macType String
    The type of virtual MAC.
    status String
    The status of virtual MAC.
    updatedAt String
    The date on which the flexible IP was last updated (RFC 3339 format).
    zone String
    zone) The zone in which IPs exist.
    createdAt string
    The date on which the flexible IP was created (RFC 3339 format).
    id string
    The MAC address ID.
    macAddress string
    The MAC address of the Virtual MAC.
    macType string
    The type of virtual MAC.
    status string
    The status of virtual MAC.
    updatedAt 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.
    createdAt String
    The date on which the flexible IP was created (RFC 3339 format).
    id String
    The MAC address ID.
    macAddress String
    The MAC address of the Virtual MAC.
    macType String
    The type of virtual MAC.
    status String
    The status of virtual MAC.
    updatedAt 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.
    scaleway logo
    Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse