Scaleway

v1.3.0 published on Thursday, Nov 3, 2022 by lbrlabs

FlexibleIp

Creates and manages Scaleway flexible IPs. For more information, see the documentation.

Examples

Basic

import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumi/scaleway";

const main = new scaleway.FlexibleIp("main", {
    reverse: "my-reverse.com",
});
import pulumi
import lbrlabs_pulumi_scaleway as scaleway

main = scaleway.FlexibleIp("main", reverse="my-reverse.com")
using System.Collections.Generic;
using Pulumi;
using Scaleway = Lbrlabs.PulumiPackage.Scaleway;

return await Deployment.RunAsync(() => 
{
    var main = new Scaleway.FlexibleIp("main", new()
    {
        Reverse = "my-reverse.com",
    });

});
package main

import (
	"github.com/lbrlabs/pulumi-scaleway/sdk/go/scaleway"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := scaleway.NewFlexibleIp(ctx, "main", &scaleway.FlexibleIpArgs{
			Reverse: pulumi.String("my-reverse.com"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
        var main = new FlexibleIp("main", FlexibleIpArgs.builder()        
            .reverse("my-reverse.com")
            .build());

    }
}
resources:
  main:
    type: scaleway:FlexibleIp
    properties:
      reverse: my-reverse.com

With zone

import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumi/scaleway";

const main = new scaleway.FlexibleIp("main", {
    zone: "fr-par-2",
});
import pulumi
import lbrlabs_pulumi_scaleway as scaleway

main = scaleway.FlexibleIp("main", zone="fr-par-2")
using System.Collections.Generic;
using Pulumi;
using Scaleway = Lbrlabs.PulumiPackage.Scaleway;

return await Deployment.RunAsync(() => 
{
    var main = new Scaleway.FlexibleIp("main", new()
    {
        Zone = "fr-par-2",
    });

});
package main

import (
	"github.com/lbrlabs/pulumi-scaleway/sdk/go/scaleway"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := scaleway.NewFlexibleIp(ctx, "main", &scaleway.FlexibleIpArgs{
			Zone: pulumi.String("fr-par-2"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
        var main = new FlexibleIp("main", FlexibleIpArgs.builder()        
            .zone("fr-par-2")
            .build());

    }
}
resources:
  main:
    type: scaleway:FlexibleIp
    properties:
      zone: fr-par-2

With baremetal server

import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@lbrlabs/pulumi-scaleway";
import * as scaleway from "@pulumi/scaleway";

const mainAccountSshKey = new scaleway.AccountSshKey("mainAccountSshKey", {publicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILHy/M5FVm5ydLGcal3e5LNcfTalbeN7QL/ZGCvDEdqJ foobar@example.com"});
const byId = scaleway.getBaremetalOs({
    zone: "fr-par-2",
    name: "Ubuntu",
    version: "20.04 LTS (Focal Fossa)",
});
const myOffer = scaleway.getBaremetalOffer({
    zone: "fr-par-2",
    name: "EM-A210R-HDD",
});
const base = new scaleway.BaremetalServer("base", {
    zone: "fr-par-2",
    offer: myOffer.then(myOffer => myOffer.offerId),
    os: byId.then(byId => byId.osId),
    sshKeyIds: mainAccountSshKey.id,
});
const mainFlexibleIp = new scaleway.FlexibleIp("mainFlexibleIp", {
    serverId: base.id,
    zone: "fr-par-2",
});
import pulumi
import lbrlabs_pulumi_scaleway as scaleway
import pulumi_scaleway as scaleway

main_account_ssh_key = scaleway.AccountSshKey("mainAccountSshKey", public_key="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILHy/M5FVm5ydLGcal3e5LNcfTalbeN7QL/ZGCvDEdqJ foobar@example.com")
by_id = scaleway.get_baremetal_os(zone="fr-par-2",
    name="Ubuntu",
    version="20.04 LTS (Focal Fossa)")
my_offer = scaleway.get_baremetal_offer(zone="fr-par-2",
    name="EM-A210R-HDD")
base = scaleway.BaremetalServer("base",
    zone="fr-par-2",
    offer=my_offer.offer_id,
    os=by_id.os_id,
    ssh_key_ids=main_account_ssh_key.id)
main_flexible_ip = scaleway.FlexibleIp("mainFlexibleIp",
    server_id=base.id,
    zone="fr-par-2")
using System.Collections.Generic;
using Pulumi;
using Scaleway = Lbrlabs.PulumiPackage.Scaleway;
using Scaleway = Pulumi.Scaleway;

return await Deployment.RunAsync(() => 
{
    var mainAccountSshKey = new Scaleway.AccountSshKey("mainAccountSshKey", new()
    {
        PublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILHy/M5FVm5ydLGcal3e5LNcfTalbeN7QL/ZGCvDEdqJ foobar@example.com",
    });

    var byId = Scaleway.GetBaremetalOs.Invoke(new()
    {
        Zone = "fr-par-2",
        Name = "Ubuntu",
        Version = "20.04 LTS (Focal Fossa)",
    });

    var myOffer = Scaleway.GetBaremetalOffer.Invoke(new()
    {
        Zone = "fr-par-2",
        Name = "EM-A210R-HDD",
    });

    var @base = new Scaleway.BaremetalServer("base", new()
    {
        Zone = "fr-par-2",
        Offer = myOffer.Apply(getBaremetalOfferResult => getBaremetalOfferResult.OfferId),
        Os = byId.Apply(getBaremetalOsResult => getBaremetalOsResult.OsId),
        SshKeyIds = mainAccountSshKey.Id,
    });

    var mainFlexibleIp = new Scaleway.FlexibleIp("mainFlexibleIp", new()
    {
        ServerId = @base.Id,
        Zone = "fr-par-2",
    });

});
package main

import (
	"github.com/lbrlabs/pulumi-scaleway/sdk/go/scaleway"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		mainAccountSshKey, err := scaleway.NewAccountSshKey(ctx, "mainAccountSshKey", &scaleway.AccountSshKeyArgs{
			PublicKey: pulumi.String("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILHy/M5FVm5ydLGcal3e5LNcfTalbeN7QL/ZGCvDEdqJ foobar@example.com"),
		})
		if err != nil {
			return err
		}
		byId, err := scaleway.GetBaremetalOs(ctx, &GetBaremetalOsArgs{
			Zone:    pulumi.StringRef("fr-par-2"),
			Name:    pulumi.StringRef("Ubuntu"),
			Version: pulumi.StringRef("20.04 LTS (Focal Fossa)"),
		}, nil)
		if err != nil {
			return err
		}
		myOffer, err := scaleway.GetBaremetalOffer(ctx, &GetBaremetalOfferArgs{
			Zone: pulumi.StringRef("fr-par-2"),
			Name: pulumi.StringRef("EM-A210R-HDD"),
		}, nil)
		if err != nil {
			return err
		}
		base, err := scaleway.NewBaremetalServer(ctx, "base", &scaleway.BaremetalServerArgs{
			Zone:      pulumi.String("fr-par-2"),
			Offer:     pulumi.String(myOffer.OfferId),
			Os:        pulumi.String(byId.OsId),
			SshKeyIds: mainAccountSshKey.ID(),
		})
		if err != nil {
			return err
		}
		_, err = scaleway.NewFlexibleIp(ctx, "mainFlexibleIp", &scaleway.FlexibleIpArgs{
			ServerId: base.ID(),
			Zone:     pulumi.String("fr-par-2"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.AccountSshKey;
import com.pulumi.scaleway.AccountSshKeyArgs;
import com.pulumi.scaleway.ScalewayFunctions;
import com.pulumi.scaleway.inputs.GetBaremetalOsArgs;
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) {
        var mainAccountSshKey = new AccountSshKey("mainAccountSshKey", AccountSshKeyArgs.builder()        
            .publicKey("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILHy/M5FVm5ydLGcal3e5LNcfTalbeN7QL/ZGCvDEdqJ foobar@example.com")
            .build());

        final var byId = ScalewayFunctions.getBaremetalOs(GetBaremetalOsArgs.builder()
            .zone("fr-par-2")
            .name("Ubuntu")
            .version("20.04 LTS (Focal Fossa)")
            .build());

        final var myOffer = ScalewayFunctions.getBaremetalOffer(GetBaremetalOfferArgs.builder()
            .zone("fr-par-2")
            .name("EM-A210R-HDD")
            .build());

        var base = new BaremetalServer("base", BaremetalServerArgs.builder()        
            .zone("fr-par-2")
            .offer(myOffer.applyValue(getBaremetalOfferResult -> getBaremetalOfferResult.offerId()))
            .os(byId.applyValue(getBaremetalOsResult -> getBaremetalOsResult.osId()))
            .sshKeyIds(mainAccountSshKey.id())
            .build());

        var mainFlexibleIp = new FlexibleIp("mainFlexibleIp", FlexibleIpArgs.builder()        
            .serverId(base.id())
            .zone("fr-par-2")
            .build());

    }
}
resources:
  mainAccountSshKey:
    type: scaleway:AccountSshKey
    properties:
      publicKey: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILHy/M5FVm5ydLGcal3e5LNcfTalbeN7QL/ZGCvDEdqJ foobar@example.com
  base:
    type: scaleway:BaremetalServer
    properties:
      zone: fr-par-2
      offer: ${myOffer.offerId}
      os: ${byId.osId}
      sshKeyIds: ${mainAccountSshKey.id}
  mainFlexibleIp:
    type: scaleway:FlexibleIp
    properties:
      serverId: ${base.id}
      zone: fr-par-2
variables:
  byId:
    fn::invoke:
      Function: scaleway:getBaremetalOs
      Arguments:
        zone: fr-par-2
        name: Ubuntu
        version: 20.04 LTS (Focal Fossa)
  myOffer:
    fn::invoke:
      Function: scaleway:getBaremetalOffer
      Arguments:
        zone: fr-par-2
        name: EM-A210R-HDD

Create FlexibleIp Resource

new FlexibleIp(name: string, args?: FlexibleIpArgs, opts?: CustomResourceOptions);
@overload
def FlexibleIp(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               description: Optional[str] = None,
               project_id: Optional[str] = None,
               reverse: Optional[str] = None,
               server_id: Optional[str] = None,
               tags: Optional[Sequence[str]] = None,
               zone: Optional[str] = None)
@overload
def FlexibleIp(resource_name: str,
               args: Optional[FlexibleIpArgs] = None,
               opts: Optional[ResourceOptions] = None)
func NewFlexibleIp(ctx *Context, name string, args *FlexibleIpArgs, opts ...ResourceOption) (*FlexibleIp, error)
public FlexibleIp(string name, FlexibleIpArgs? args = null, CustomResourceOptions? opts = null)
public FlexibleIp(String name, FlexibleIpArgs args)
public FlexibleIp(String name, FlexibleIpArgs args, CustomResourceOptions options)
type: scaleway:FlexibleIp
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args FlexibleIpArgs
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 FlexibleIpArgs
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 FlexibleIpArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args FlexibleIpArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args FlexibleIpArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

FlexibleIp Resource Properties

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

Inputs

The FlexibleIp resource accepts the following input properties:

Description string

Description of the flexible IP

ProjectId string

The project of the Flexible IP

Reverse string

The reverse domain associated with this flexible IP.

ServerId string

The ID of the associated server

Tags List<string>

The tags associated with the flexible IP

Zone string

The zone of the Flexible IP

Description string

Description of the flexible IP

ProjectId string

The project of the Flexible IP

Reverse string

The reverse domain associated with this flexible IP.

ServerId string

The ID of the associated server

Tags []string

The tags associated with the flexible IP

Zone string

The zone of the Flexible IP

description String

Description of the flexible IP

projectId String

The project of the Flexible IP

reverse String

The reverse domain associated with this flexible IP.

serverId String

The ID of the associated server

tags List<String>

The tags associated with the flexible IP

zone String

The zone of the Flexible IP

description string

Description of the flexible IP

projectId string

The project of the Flexible IP

reverse string

The reverse domain associated with this flexible IP.

serverId string

The ID of the associated server

tags string[]

The tags associated with the flexible IP

zone string

The zone of the Flexible IP

description str

Description of the flexible IP

project_id str

The project of the Flexible IP

reverse str

The reverse domain associated with this flexible IP.

server_id str

The ID of the associated server

tags Sequence[str]

The tags associated with the flexible IP

zone str

The zone of the Flexible IP

description String

Description of the flexible IP

projectId String

The project of the Flexible IP

reverse String

The reverse domain associated with this flexible IP.

serverId String

The ID of the associated server

tags List<String>

The tags associated with the flexible IP

zone String

The zone of the Flexible IP

Outputs

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

CreatedAt string

The date and time of the creation of the Flexible IP (Format ISO 8601)

Id string

The provider-assigned unique ID for this managed resource.

IpAddress string

The IPv4 address of the Flexible IP

MacAddress string

The MAC address of the server associated with this flexible IP

OrganizationId string

The organization of the Flexible IP

UpdatedAt string

The date and time of the last update of the Flexible IP (Format ISO 8601)

CreatedAt string

The date and time of the creation of the Flexible IP (Format ISO 8601)

Id string

The provider-assigned unique ID for this managed resource.

IpAddress string

The IPv4 address of the Flexible IP

MacAddress string

The MAC address of the server associated with this flexible IP

OrganizationId string

The organization of the Flexible IP

UpdatedAt string

The date and time of the last update of the Flexible IP (Format ISO 8601)

createdAt String

The date and time of the creation of the Flexible IP (Format ISO 8601)

id String

The provider-assigned unique ID for this managed resource.

ipAddress String

The IPv4 address of the Flexible IP

macAddress String

The MAC address of the server associated with this flexible IP

organizationId String

The organization of the Flexible IP

updatedAt String

The date and time of the last update of the Flexible IP (Format ISO 8601)

createdAt string

The date and time of the creation of the Flexible IP (Format ISO 8601)

id string

The provider-assigned unique ID for this managed resource.

ipAddress string

The IPv4 address of the Flexible IP

macAddress string

The MAC address of the server associated with this flexible IP

organizationId string

The organization of the Flexible IP

updatedAt string

The date and time of the last update of the Flexible IP (Format ISO 8601)

created_at str

The date and time of the creation of the Flexible IP (Format ISO 8601)

id str

The provider-assigned unique ID for this managed resource.

ip_address str

The IPv4 address of the Flexible IP

mac_address str

The MAC address of the server associated with this flexible IP

organization_id str

The organization of the Flexible IP

updated_at str

The date and time of the last update of the Flexible IP (Format ISO 8601)

createdAt String

The date and time of the creation of the Flexible IP (Format ISO 8601)

id String

The provider-assigned unique ID for this managed resource.

ipAddress String

The IPv4 address of the Flexible IP

macAddress String

The MAC address of the server associated with this flexible IP

organizationId String

The organization of the Flexible IP

updatedAt String

The date and time of the last update of the Flexible IP (Format ISO 8601)

Look up Existing FlexibleIp Resource

Get an existing FlexibleIp 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?: FlexibleIpState, opts?: CustomResourceOptions): FlexibleIp
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_at: Optional[str] = None,
        description: Optional[str] = None,
        ip_address: Optional[str] = None,
        mac_address: Optional[str] = None,
        organization_id: Optional[str] = None,
        project_id: Optional[str] = None,
        reverse: Optional[str] = None,
        server_id: Optional[str] = None,
        tags: Optional[Sequence[str]] = None,
        updated_at: Optional[str] = None,
        zone: Optional[str] = None) -> FlexibleIp
func GetFlexibleIp(ctx *Context, name string, id IDInput, state *FlexibleIpState, opts ...ResourceOption) (*FlexibleIp, error)
public static FlexibleIp Get(string name, Input<string> id, FlexibleIpState? state, CustomResourceOptions? opts = null)
public static FlexibleIp get(String name, Output<String> id, FlexibleIpState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
The following state arguments are supported:
CreatedAt string

The date and time of the creation of the Flexible IP (Format ISO 8601)

Description string

Description of the flexible IP

IpAddress string

The IPv4 address of the Flexible IP

MacAddress string

The MAC address of the server associated with this flexible IP

OrganizationId string

The organization of the Flexible IP

ProjectId string

The project of the Flexible IP

Reverse string

The reverse domain associated with this flexible IP.

ServerId string

The ID of the associated server

Tags List<string>

The tags associated with the flexible IP

UpdatedAt string

The date and time of the last update of the Flexible IP (Format ISO 8601)

Zone string

The zone of the Flexible IP

CreatedAt string

The date and time of the creation of the Flexible IP (Format ISO 8601)

Description string

Description of the flexible IP

IpAddress string

The IPv4 address of the Flexible IP

MacAddress string

The MAC address of the server associated with this flexible IP

OrganizationId string

The organization of the Flexible IP

ProjectId string

The project of the Flexible IP

Reverse string

The reverse domain associated with this flexible IP.

ServerId string

The ID of the associated server

Tags []string

The tags associated with the flexible IP

UpdatedAt string

The date and time of the last update of the Flexible IP (Format ISO 8601)

Zone string

The zone of the Flexible IP

createdAt String

The date and time of the creation of the Flexible IP (Format ISO 8601)

description String

Description of the flexible IP

ipAddress String

The IPv4 address of the Flexible IP

macAddress String

The MAC address of the server associated with this flexible IP

organizationId String

The organization of the Flexible IP

projectId String

The project of the Flexible IP

reverse String

The reverse domain associated with this flexible IP.

serverId String

The ID of the associated server

tags List<String>

The tags associated with the flexible IP

updatedAt String

The date and time of the last update of the Flexible IP (Format ISO 8601)

zone String

The zone of the Flexible IP

createdAt string

The date and time of the creation of the Flexible IP (Format ISO 8601)

description string

Description of the flexible IP

ipAddress string

The IPv4 address of the Flexible IP

macAddress string

The MAC address of the server associated with this flexible IP

organizationId string

The organization of the Flexible IP

projectId string

The project of the Flexible IP

reverse string

The reverse domain associated with this flexible IP.

serverId string

The ID of the associated server

tags string[]

The tags associated with the flexible IP

updatedAt string

The date and time of the last update of the Flexible IP (Format ISO 8601)

zone string

The zone of the Flexible IP

created_at str

The date and time of the creation of the Flexible IP (Format ISO 8601)

description str

Description of the flexible IP

ip_address str

The IPv4 address of the Flexible IP

mac_address str

The MAC address of the server associated with this flexible IP

organization_id str

The organization of the Flexible IP

project_id str

The project of the Flexible IP

reverse str

The reverse domain associated with this flexible IP.

server_id str

The ID of the associated server

tags Sequence[str]

The tags associated with the flexible IP

updated_at str

The date and time of the last update of the Flexible IP (Format ISO 8601)

zone str

The zone of the Flexible IP

createdAt String

The date and time of the creation of the Flexible IP (Format ISO 8601)

description String

Description of the flexible IP

ipAddress String

The IPv4 address of the Flexible IP

macAddress String

The MAC address of the server associated with this flexible IP

organizationId String

The organization of the Flexible IP

projectId String

The project of the Flexible IP

reverse String

The reverse domain associated with this flexible IP.

serverId String

The ID of the associated server

tags List<String>

The tags associated with the flexible IP

updatedAt String

The date and time of the last update of the Flexible IP (Format ISO 8601)

zone String

The zone of the Flexible IP

Import

Flexible IPs can be imported using the {zone}/{id}, e.g. bash

 $ pulumi import scaleway:index/flexibleIp:FlexibleIp main fr-par-1/11111111-1111-1111-1111-111111111111

Package Details

Repository
https://github.com/lbrlabs/pulumi-scaleway
License
Apache-2.0
Notes

This Pulumi package is based on the scaleway Terraform Provider.