Manage the reverse DNS of IP addresses managed by Scaleway’s IP Address Management (IPAM) service.
For more information about IPAM, see the main documentation.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumiverse/scaleway";
import * as std from "@pulumi/std";
const ip01 = new scaleway.instance.Ip("ip01", {type: "routed_ipv6"});
const srv01 = new scaleway.instance.Server("srv01", {
name: "tf-tests-instance-server-ips",
ipIds: [ip01.id],
image: "ubuntu_jammy",
type: "PRO2-XXS",
state: "stopped",
});
const ipam01 = scaleway.ipam.getIpOutput({
resource: {
id: srv01.id,
type: "instance_server",
},
type: "ipv6",
});
const tfAAAA = new scaleway.domain.Record("tf_AAAA", {
dnsZone: "example.com",
name: "",
type: "AAAA",
data: std.index.cidrhost({
input: ipam01.apply(ipam01 => ipam01.addressCidr),
host: 42,
}).result,
ttl: 3600,
priority: 1,
});
const base = new scaleway.ipam.IpReverseDns("base", {
ipamIpId: ipam01.apply(ipam01 => ipam01.id),
hostname: "example.com",
address: std.index.cidrhost({
input: ipam01.apply(ipam01 => ipam01.addressCidr),
host: 42,
}).result,
});
import pulumi
import pulumi_scaleway as scaleway
import pulumi_std as std
import pulumiverse_scaleway as scaleway
ip01 = scaleway.instance.Ip("ip01", type="routed_ipv6")
srv01 = scaleway.instance.Server("srv01",
name="tf-tests-instance-server-ips",
ip_ids=[ip01.id],
image="ubuntu_jammy",
type="PRO2-XXS",
state="stopped")
ipam01 = scaleway.ipam.get_ip_output(resource={
"id": srv01.id,
"type": "instance_server",
},
type="ipv6")
tf_aaaa = scaleway.domain.Record("tf_AAAA",
dns_zone="example.com",
name="",
type="AAAA",
data=std.index.cidrhost(input=ipam01.address_cidr,
host=42)["result"],
ttl=3600,
priority=1)
base = scaleway.ipam.IpReverseDns("base",
ipam_ip_id=ipam01.id,
hostname="example.com",
address=std.index.cidrhost(input=ipam01.address_cidr,
host=42)["result"])
package main
import (
"github.com/pulumi/pulumi-std/sdk/go/std"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/domain"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/instance"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/ipam"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ip01, err := instance.NewIp(ctx, "ip01", &instance.IpArgs{
Type: pulumi.String("routed_ipv6"),
})
if err != nil {
return err
}
srv01, err := instance.NewServer(ctx, "srv01", &instance.ServerArgs{
Name: pulumi.String("tf-tests-instance-server-ips"),
IpIds: pulumi.StringArray{
ip01.ID(),
},
Image: pulumi.String("ubuntu_jammy"),
Type: pulumi.String("PRO2-XXS"),
State: pulumi.String("stopped"),
})
if err != nil {
return err
}
ipam01 := ipam.LookupIpOutput(ctx, ipam.GetIpOutputArgs{
Resource: &ipam.GetIpResourceArgs{
Id: srv01.ID(),
Type: pulumi.String("instance_server"),
},
Type: pulumi.String("ipv6"),
}, nil)
invokeCidrhost, err := std.Cidrhost(ctx, map[string]interface{}{
"input": ipam01.ApplyT(func(ipam01 ipam.GetIpResult) (*string, error) {
return &ipam01.AddressCidr, nil
}).(pulumi.StringPtrOutput),
"host": 42,
}, nil)
if err != nil {
return err
}
_, err = domain.NewRecord(ctx, "tf_AAAA", &domain.RecordArgs{
DnsZone: pulumi.String("example.com"),
Name: pulumi.String(""),
Type: pulumi.String("AAAA"),
Data: invokeCidrhost.Result,
Ttl: pulumi.Int(3600),
Priority: pulumi.Int(1),
})
if err != nil {
return err
}
invokeCidrhost1, err := std.Cidrhost(ctx, map[string]interface{}{
"input": ipam01.ApplyT(func(ipam01 ipam.GetIpResult) (*string, error) {
return &ipam01.AddressCidr, nil
}).(pulumi.StringPtrOutput),
"host": 42,
}, nil)
if err != nil {
return err
}
_, err = ipam.NewIpReverseDns(ctx, "base", &ipam.IpReverseDnsArgs{
IpamIpId: pulumi.String(ipam01.ApplyT(func(ipam01 ipam.GetIpResult) (*string, error) {
return &ipam01.Id, nil
}).(pulumi.StringPtrOutput)),
Hostname: pulumi.String("example.com"),
Address: invokeCidrhost1.Result,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumi.Scaleway;
using Scaleway = Pulumiverse.Scaleway;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var ip01 = new Scaleway.Instance.Ip("ip01", new()
{
Type = "routed_ipv6",
});
var srv01 = new Scaleway.Instance.Server("srv01", new()
{
Name = "tf-tests-instance-server-ips",
IpIds = new[]
{
ip01.Id,
},
Image = "ubuntu_jammy",
Type = "PRO2-XXS",
State = "stopped",
});
var ipam01 = Scaleway.Ipam.GetIp.Invoke(new()
{
Resource = new Scaleway.Ipam.Inputs.GetIpResourceInputArgs
{
Id = srv01.Id,
Type = "instance_server",
},
Type = "ipv6",
});
var tfAAAA = new Scaleway.Domain.Record("tf_AAAA", new()
{
DnsZone = "example.com",
Name = "",
Type = "AAAA",
Data = Std.Index.Cidrhost.Invoke(new()
{
Input = ipam01.Apply(getIpResult => getIpResult.AddressCidr),
Host = 42,
}).Result,
Ttl = 3600,
Priority = 1,
});
var @base = new Scaleway.Ipam.IpReverseDns("base", new()
{
IpamIpId = ipam01.Apply(getIpResult => getIpResult.Id),
Hostname = "example.com",
Address = Std.Index.Cidrhost.Invoke(new()
{
Input = ipam01.Apply(getIpResult => getIpResult.AddressCidr),
Host = 42,
}).Result,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.instance.Ip;
import com.pulumi.scaleway.instance.IpArgs;
import com.pulumi.scaleway.instance.Server;
import com.pulumi.scaleway.instance.ServerArgs;
import com.pulumi.scaleway.ipam.IpamFunctions;
import com.pulumi.scaleway.ipam.inputs.GetIpArgs;
import com.pulumi.scaleway.ipam.inputs.GetIpResourceArgs;
import com.pulumi.scaleway.domain.Record;
import com.pulumi.scaleway.domain.RecordArgs;
import com.pulumi.std.StdFunctions;
import com.pulumi.scaleway.ipam.IpReverseDns;
import com.pulumi.scaleway.ipam.IpReverseDnsArgs;
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 ip01 = new Ip("ip01", IpArgs.builder()
.type("routed_ipv6")
.build());
var srv01 = new Server("srv01", ServerArgs.builder()
.name("tf-tests-instance-server-ips")
.ipIds(ip01.id())
.image("ubuntu_jammy")
.type("PRO2-XXS")
.state("stopped")
.build());
final var ipam01 = IpamFunctions.getIp(GetIpArgs.builder()
.resource(GetIpResourceArgs.builder()
.id(srv01.id())
.type("instance_server")
.build())
.type("ipv6")
.build());
var tfAAAA = new Record("tfAAAA", RecordArgs.builder()
.dnsZone("example.com")
.name("")
.type("AAAA")
.data(StdFunctions.cidrhost(Map.ofEntries(
Map.entry("input", ipam01.applyValue(_ipam01 -> _ipam01.addressCidr())),
Map.entry("host", 42)
)).result())
.ttl(3600)
.priority(1)
.build());
var base = new IpReverseDns("base", IpReverseDnsArgs.builder()
.ipamIpId(ipam01.applyValue(_ipam01 -> _ipam01.id()))
.hostname("example.com")
.address(StdFunctions.cidrhost(Map.ofEntries(
Map.entry("input", ipam01.applyValue(_ipam01 -> _ipam01.addressCidr())),
Map.entry("host", 42)
)).result())
.build());
}
}
resources:
ip01:
type: scaleway:instance:Ip
properties:
type: routed_ipv6
srv01:
type: scaleway:instance:Server
properties:
name: tf-tests-instance-server-ips
ipIds:
- ${ip01.id}
image: ubuntu_jammy
type: PRO2-XXS
state: stopped
tfAAAA:
type: scaleway:domain:Record
name: tf_AAAA
properties:
dnsZone: example.com
name: ""
type: AAAA
data:
fn::invoke:
function: std:cidrhost
arguments:
input: ${ipam01.addressCidr}
host: 42
return: result
ttl: 3600
priority: 1
base:
type: scaleway:ipam:IpReverseDns
properties:
ipamIpId: ${ipam01.id}
hostname: example.com
address:
fn::invoke:
function: std:cidrhost
arguments:
input: ${ipam01.addressCidr}
host: 42
return: result
variables:
ipam01:
fn::invoke:
function: scaleway:ipam:getIp
arguments:
resource:
id: ${srv01.id}
type: instance_server
type: ipv6
Create IpReverseDns Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new IpReverseDns(name: string, args: IpReverseDnsArgs, opts?: CustomResourceOptions);@overload
def IpReverseDns(resource_name: str,
args: IpReverseDnsArgs,
opts: Optional[ResourceOptions] = None)
@overload
def IpReverseDns(resource_name: str,
opts: Optional[ResourceOptions] = None,
address: Optional[str] = None,
hostname: Optional[str] = None,
ipam_ip_id: Optional[str] = None,
region: Optional[str] = None)func NewIpReverseDns(ctx *Context, name string, args IpReverseDnsArgs, opts ...ResourceOption) (*IpReverseDns, error)public IpReverseDns(string name, IpReverseDnsArgs args, CustomResourceOptions? opts = null)
public IpReverseDns(String name, IpReverseDnsArgs args)
public IpReverseDns(String name, IpReverseDnsArgs args, CustomResourceOptions options)
type: scaleway:ipam:IpReverseDns
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args IpReverseDnsArgs
- 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 IpReverseDnsArgs
- 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 IpReverseDnsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IpReverseDnsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IpReverseDnsArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var scalewayIpReverseDnsResource = new Scaleway.Ipam.IpReverseDns("scalewayIpReverseDnsResource", new()
{
Address = "string",
Hostname = "string",
IpamIpId = "string",
Region = "string",
});
example, err := ipam.NewIpReverseDns(ctx, "scalewayIpReverseDnsResource", &ipam.IpReverseDnsArgs{
Address: pulumi.String("string"),
Hostname: pulumi.String("string"),
IpamIpId: pulumi.String("string"),
Region: pulumi.String("string"),
})
var scalewayIpReverseDnsResource = new com.pulumi.scaleway.ipam.IpReverseDns("scalewayIpReverseDnsResource", com.pulumi.scaleway.ipam.IpReverseDnsArgs.builder()
.address("string")
.hostname("string")
.ipamIpId("string")
.region("string")
.build());
scaleway_ip_reverse_dns_resource = scaleway.ipam.IpReverseDns("scalewayIpReverseDnsResource",
address="string",
hostname="string",
ipam_ip_id="string",
region="string")
const scalewayIpReverseDnsResource = new scaleway.ipam.IpReverseDns("scalewayIpReverseDnsResource", {
address: "string",
hostname: "string",
ipamIpId: "string",
region: "string",
});
type: scaleway:ipam:IpReverseDns
properties:
address: string
hostname: string
ipamIpId: string
region: string
IpReverseDns Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The IpReverseDns resource accepts the following input properties:
- address str
- The IP corresponding to the hostname.
- hostname str
- The reverse domain name.
- ipam_
ip_ strid - The IPAM IP ID.
- region str
region) The region of the IP reverse DNS.
Outputs
All input properties are implicitly available as output properties. Additionally, the IpReverseDns resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing IpReverseDns Resource
Get an existing IpReverseDns 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?: IpReverseDnsState, opts?: CustomResourceOptions): IpReverseDns@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
address: Optional[str] = None,
hostname: Optional[str] = None,
ipam_ip_id: Optional[str] = None,
region: Optional[str] = None) -> IpReverseDnsfunc GetIpReverseDns(ctx *Context, name string, id IDInput, state *IpReverseDnsState, opts ...ResourceOption) (*IpReverseDns, error)public static IpReverseDns Get(string name, Input<string> id, IpReverseDnsState? state, CustomResourceOptions? opts = null)public static IpReverseDns get(String name, Output<String> id, IpReverseDnsState state, CustomResourceOptions options)resources: _: type: scaleway:ipam:IpReverseDns get: id: ${id}- 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.
- address str
- The IP corresponding to the hostname.
- hostname str
- The reverse domain name.
- ipam_
ip_ strid - The IPAM IP ID.
- region str
region) The region of the IP reverse DNS.
Import
IPAM IP reverse DNS can be imported using {region}/{id}, e.g.
bash
$ pulumi import scaleway:ipam/ipReverseDns:IpReverseDns main fr-par/11111111-1111-1111-1111-111111111111
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- scaleway pulumiverse/pulumi-scaleway
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
scalewayTerraform Provider.
