1. Packages
  2. OVH
  3. API Docs
  4. Vrack
  5. IpAddress
OVHCloud v0.45.0 published on Tuesday, Jun 4, 2024 by OVHcloud

ovh.Vrack.IpAddress

Explore with Pulumi AI

ovh logo
OVHCloud v0.45.0 published on Tuesday, Jun 4, 2024 by OVHcloud

    Attach an IP block to a VRack.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovhcloud/pulumi-ovh";
    import * as ovh from "@pulumi/ovh";
    
    const myaccount = ovh.Me.getMe({});
    const mycart = myaccount.then(myaccount => ovh.Order.getCart({
        ovhSubsidiary: myaccount.ovhSubsidiary,
    }));
    const vrackCartProductPlan = mycart.then(mycart => ovh.Order.getCartProductPlan({
        cartId: mycart.id,
        priceCapacity: "renew",
        product: "vrack",
        planCode: "vrack",
    }));
    const vrackVrack = new ovh.vrack.Vrack("vrackVrack", {
        description: mycart.then(mycart => mycart.description),
        ovhSubsidiary: mycart.then(mycart => mycart.ovhSubsidiary),
        plan: {
            duration: vrackCartProductPlan.then(vrackCartProductPlan => vrackCartProductPlan.selectedPrices?.[0]?.duration),
            planCode: vrackCartProductPlan.then(vrackCartProductPlan => vrackCartProductPlan.planCode),
            pricingMode: vrackCartProductPlan.then(vrackCartProductPlan => vrackCartProductPlan.selectedPrices?.[0]?.pricingMode),
        },
    });
    const ipblockCartProductPlan = mycart.then(mycart => ovh.Order.getCartProductPlan({
        cartId: mycart.id,
        priceCapacity: "renew",
        product: "ip",
        planCode: "ip-v4-s30-ripe",
    }));
    const ipblockIpService = new ovh.ip.IpService("ipblockIpService", {
        ovhSubsidiary: mycart.then(mycart => mycart.ovhSubsidiary),
        description: mycart.then(mycart => mycart.description),
        plan: {
            duration: ipblockCartProductPlan.then(ipblockCartProductPlan => ipblockCartProductPlan.selectedPrices?.[0]?.duration),
            planCode: ipblockCartProductPlan.then(ipblockCartProductPlan => ipblockCartProductPlan.planCode),
            pricingMode: ipblockCartProductPlan.then(ipblockCartProductPlan => ipblockCartProductPlan.selectedPrices?.[0]?.pricingMode),
            configurations: [{
                label: "country",
                value: "FR",
            }],
        },
    });
    const vrackblock = new ovh.vrack.IpAddress("vrackblock", {
        serviceName: vrackVrack.serviceName,
        block: ipblockIpService.ip,
    });
    
    import pulumi
    import pulumi_ovh as ovh
    
    myaccount = ovh.Me.get_me()
    mycart = ovh.Order.get_cart(ovh_subsidiary=myaccount.ovh_subsidiary)
    vrack_cart_product_plan = ovh.Order.get_cart_product_plan(cart_id=mycart.id,
        price_capacity="renew",
        product="vrack",
        plan_code="vrack")
    vrack_vrack = ovh.vrack.Vrack("vrackVrack",
        description=mycart.description,
        ovh_subsidiary=mycart.ovh_subsidiary,
        plan=ovh.vrack.VrackPlanArgs(
            duration=vrack_cart_product_plan.selected_prices[0].duration,
            plan_code=vrack_cart_product_plan.plan_code,
            pricing_mode=vrack_cart_product_plan.selected_prices[0].pricing_mode,
        ))
    ipblock_cart_product_plan = ovh.Order.get_cart_product_plan(cart_id=mycart.id,
        price_capacity="renew",
        product="ip",
        plan_code="ip-v4-s30-ripe")
    ipblock_ip_service = ovh.ip.IpService("ipblockIpService",
        ovh_subsidiary=mycart.ovh_subsidiary,
        description=mycart.description,
        plan=ovh.ip.IpServicePlanArgs(
            duration=ipblock_cart_product_plan.selected_prices[0].duration,
            plan_code=ipblock_cart_product_plan.plan_code,
            pricing_mode=ipblock_cart_product_plan.selected_prices[0].pricing_mode,
            configurations=[ovh.ip.IpServicePlanConfigurationArgs(
                label="country",
                value="FR",
            )],
        ))
    vrackblock = ovh.vrack.IpAddress("vrackblock",
        service_name=vrack_vrack.service_name,
        block=ipblock_ip_service.ip)
    
    package main
    
    import (
    	"github.com/ovh/pulumi-ovh/sdk/go/ovh/Ip"
    	"github.com/ovh/pulumi-ovh/sdk/go/ovh/Me"
    	"github.com/ovh/pulumi-ovh/sdk/go/ovh/Order"
    	"github.com/ovh/pulumi-ovh/sdk/go/ovh/Vrack"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		myaccount, err := Me.GetMe(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		mycart, err := Order.GetCart(ctx, &order.GetCartArgs{
    			OvhSubsidiary: myaccount.OvhSubsidiary,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		vrackCartProductPlan, err := Order.GetCartProductPlan(ctx, &order.GetCartProductPlanArgs{
    			CartId:        mycart.Id,
    			PriceCapacity: "renew",
    			Product:       "vrack",
    			PlanCode:      "vrack",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		vrackVrack, err := Vrack.NewVrack(ctx, "vrackVrack", &Vrack.VrackArgs{
    			Description:   pulumi.String(mycart.Description),
    			OvhSubsidiary: pulumi.String(mycart.OvhSubsidiary),
    			Plan: &vrack.VrackPlanArgs{
    				Duration:    pulumi.String(vrackCartProductPlan.SelectedPrices[0].Duration),
    				PlanCode:    pulumi.String(vrackCartProductPlan.PlanCode),
    				PricingMode: pulumi.String(vrackCartProductPlan.SelectedPrices[0].PricingMode),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		ipblockCartProductPlan, err := Order.GetCartProductPlan(ctx, &order.GetCartProductPlanArgs{
    			CartId:        mycart.Id,
    			PriceCapacity: "renew",
    			Product:       "ip",
    			PlanCode:      "ip-v4-s30-ripe",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ipblockIpService, err := Ip.NewIpService(ctx, "ipblockIpService", &Ip.IpServiceArgs{
    			OvhSubsidiary: pulumi.String(mycart.OvhSubsidiary),
    			Description:   pulumi.String(mycart.Description),
    			Plan: &ip.IpServicePlanArgs{
    				Duration:    pulumi.String(ipblockCartProductPlan.SelectedPrices[0].Duration),
    				PlanCode:    pulumi.String(ipblockCartProductPlan.PlanCode),
    				PricingMode: pulumi.String(ipblockCartProductPlan.SelectedPrices[0].PricingMode),
    				Configurations: ip.IpServicePlanConfigurationArray{
    					&ip.IpServicePlanConfigurationArgs{
    						Label: pulumi.String("country"),
    						Value: pulumi.String("FR"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = Vrack.NewIpAddress(ctx, "vrackblock", &Vrack.IpAddressArgs{
    			ServiceName: vrackVrack.ServiceName,
    			Block:       ipblockIpService.Ip,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var myaccount = Ovh.Me.GetMe.Invoke();
    
        var mycart = Ovh.Order.GetCart.Invoke(new()
        {
            OvhSubsidiary = myaccount.Apply(getMeResult => getMeResult.OvhSubsidiary),
        });
    
        var vrackCartProductPlan = Ovh.Order.GetCartProductPlan.Invoke(new()
        {
            CartId = mycart.Apply(getCartResult => getCartResult.Id),
            PriceCapacity = "renew",
            Product = "vrack",
            PlanCode = "vrack",
        });
    
        var vrackVrack = new Ovh.Vrack.Vrack("vrackVrack", new()
        {
            Description = mycart.Apply(getCartResult => getCartResult.Description),
            OvhSubsidiary = mycart.Apply(getCartResult => getCartResult.OvhSubsidiary),
            Plan = new Ovh.Vrack.Inputs.VrackPlanArgs
            {
                Duration = vrackCartProductPlan.Apply(getCartProductPlanResult => getCartProductPlanResult.SelectedPrices[0]?.Duration),
                PlanCode = vrackCartProductPlan.Apply(getCartProductPlanResult => getCartProductPlanResult.PlanCode),
                PricingMode = vrackCartProductPlan.Apply(getCartProductPlanResult => getCartProductPlanResult.SelectedPrices[0]?.PricingMode),
            },
        });
    
        var ipblockCartProductPlan = Ovh.Order.GetCartProductPlan.Invoke(new()
        {
            CartId = mycart.Apply(getCartResult => getCartResult.Id),
            PriceCapacity = "renew",
            Product = "ip",
            PlanCode = "ip-v4-s30-ripe",
        });
    
        var ipblockIpService = new Ovh.Ip.IpService("ipblockIpService", new()
        {
            OvhSubsidiary = mycart.Apply(getCartResult => getCartResult.OvhSubsidiary),
            Description = mycart.Apply(getCartResult => getCartResult.Description),
            Plan = new Ovh.Ip.Inputs.IpServicePlanArgs
            {
                Duration = ipblockCartProductPlan.Apply(getCartProductPlanResult => getCartProductPlanResult.SelectedPrices[0]?.Duration),
                PlanCode = ipblockCartProductPlan.Apply(getCartProductPlanResult => getCartProductPlanResult.PlanCode),
                PricingMode = ipblockCartProductPlan.Apply(getCartProductPlanResult => getCartProductPlanResult.SelectedPrices[0]?.PricingMode),
                Configurations = new[]
                {
                    new Ovh.Ip.Inputs.IpServicePlanConfigurationArgs
                    {
                        Label = "country",
                        Value = "FR",
                    },
                },
            },
        });
    
        var vrackblock = new Ovh.Vrack.IpAddress("vrackblock", new()
        {
            ServiceName = vrackVrack.ServiceName,
            Block = ipblockIpService.Ip,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ovh.Me.MeFunctions;
    import com.pulumi.ovh.Order.OrderFunctions;
    import com.pulumi.ovh.Order.inputs.GetCartArgs;
    import com.pulumi.ovh.Order.inputs.GetCartProductPlanArgs;
    import com.pulumi.ovh.Vrack.Vrack;
    import com.pulumi.ovh.Vrack.VrackArgs;
    import com.pulumi.ovh.Vrack.inputs.VrackPlanArgs;
    import com.pulumi.ovh.Ip.IpService;
    import com.pulumi.ovh.Ip.IpServiceArgs;
    import com.pulumi.ovh.Ip.inputs.IpServicePlanArgs;
    import com.pulumi.ovh.Vrack.IpAddress;
    import com.pulumi.ovh.Vrack.IpAddressArgs;
    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 myaccount = MeFunctions.getMe();
    
            final var mycart = OrderFunctions.getCart(GetCartArgs.builder()
                .ovhSubsidiary(myaccount.applyValue(getMeResult -> getMeResult.ovhSubsidiary()))
                .build());
    
            final var vrackCartProductPlan = OrderFunctions.getCartProductPlan(GetCartProductPlanArgs.builder()
                .cartId(mycart.applyValue(getCartResult -> getCartResult.id()))
                .priceCapacity("renew")
                .product("vrack")
                .planCode("vrack")
                .build());
    
            var vrackVrack = new Vrack("vrackVrack", VrackArgs.builder()
                .description(mycart.applyValue(getCartResult -> getCartResult.description()))
                .ovhSubsidiary(mycart.applyValue(getCartResult -> getCartResult.ovhSubsidiary()))
                .plan(VrackPlanArgs.builder()
                    .duration(vrackCartProductPlan.applyValue(getCartProductPlanResult -> getCartProductPlanResult.selectedPrices()[0].duration()))
                    .planCode(vrackCartProductPlan.applyValue(getCartProductPlanResult -> getCartProductPlanResult.planCode()))
                    .pricingMode(vrackCartProductPlan.applyValue(getCartProductPlanResult -> getCartProductPlanResult.selectedPrices()[0].pricingMode()))
                    .build())
                .build());
    
            final var ipblockCartProductPlan = OrderFunctions.getCartProductPlan(GetCartProductPlanArgs.builder()
                .cartId(mycart.applyValue(getCartResult -> getCartResult.id()))
                .priceCapacity("renew")
                .product("ip")
                .planCode("ip-v4-s30-ripe")
                .build());
    
            var ipblockIpService = new IpService("ipblockIpService", IpServiceArgs.builder()
                .ovhSubsidiary(mycart.applyValue(getCartResult -> getCartResult.ovhSubsidiary()))
                .description(mycart.applyValue(getCartResult -> getCartResult.description()))
                .plan(IpServicePlanArgs.builder()
                    .duration(ipblockCartProductPlan.applyValue(getCartProductPlanResult -> getCartProductPlanResult.selectedPrices()[0].duration()))
                    .planCode(ipblockCartProductPlan.applyValue(getCartProductPlanResult -> getCartProductPlanResult.planCode()))
                    .pricingMode(ipblockCartProductPlan.applyValue(getCartProductPlanResult -> getCartProductPlanResult.selectedPrices()[0].pricingMode()))
                    .configurations(IpServicePlanConfigurationArgs.builder()
                        .label("country")
                        .value("FR")
                        .build())
                    .build())
                .build());
    
            var vrackblock = new IpAddress("vrackblock", IpAddressArgs.builder()
                .serviceName(vrackVrack.serviceName())
                .block(ipblockIpService.ip())
                .build());
    
        }
    }
    
    resources:
      vrackVrack:
        type: ovh:Vrack:Vrack
        properties:
          description: ${mycart.description}
          ovhSubsidiary: ${mycart.ovhSubsidiary}
          plan:
            duration: ${vrackCartProductPlan.selectedPrices[0].duration}
            planCode: ${vrackCartProductPlan.planCode}
            pricingMode: ${vrackCartProductPlan.selectedPrices[0].pricingMode}
      ipblockIpService:
        type: ovh:Ip:IpService
        properties:
          ovhSubsidiary: ${mycart.ovhSubsidiary}
          description: ${mycart.description}
          plan:
            duration: ${ipblockCartProductPlan.selectedPrices[0].duration}
            planCode: ${ipblockCartProductPlan.planCode}
            pricingMode: ${ipblockCartProductPlan.selectedPrices[0].pricingMode}
            configurations:
              - label: country
                value: FR
      vrackblock:
        type: ovh:Vrack:IpAddress
        properties:
          serviceName: ${vrackVrack.serviceName}
          block: ${ipblockIpService.ip}
    variables:
      myaccount:
        fn::invoke:
          Function: ovh:Me:getMe
          Arguments: {}
      mycart:
        fn::invoke:
          Function: ovh:Order:getCart
          Arguments:
            ovhSubsidiary: ${myaccount.ovhSubsidiary}
      vrackCartProductPlan:
        fn::invoke:
          Function: ovh:Order:getCartProductPlan
          Arguments:
            cartId: ${mycart.id}
            priceCapacity: renew
            product: vrack
            planCode: vrack
      ipblockCartProductPlan:
        fn::invoke:
          Function: ovh:Order:getCartProductPlan
          Arguments:
            cartId: ${mycart.id}
            priceCapacity: renew
            product: ip
            planCode: ip-v4-s30-ripe
    

    Create IpAddress Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new IpAddress(name: string, args: IpAddressArgs, opts?: CustomResourceOptions);
    @overload
    def IpAddress(resource_name: str,
                  args: IpAddressArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def IpAddress(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  block: Optional[str] = None,
                  service_name: Optional[str] = None)
    func NewIpAddress(ctx *Context, name string, args IpAddressArgs, opts ...ResourceOption) (*IpAddress, error)
    public IpAddress(string name, IpAddressArgs args, CustomResourceOptions? opts = null)
    public IpAddress(String name, IpAddressArgs args)
    public IpAddress(String name, IpAddressArgs args, CustomResourceOptions options)
    
    type: ovh:Vrack:IpAddress
    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 IpAddressArgs
    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 IpAddressArgs
    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 IpAddressArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IpAddressArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IpAddressArgs
    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 ipAddressResource = new Ovh.Vrack.IpAddress("ipAddressResource", new()
    {
        Block = "string",
        ServiceName = "string",
    });
    
    example, err := Vrack.NewIpAddress(ctx, "ipAddressResource", &Vrack.IpAddressArgs{
    	Block:       pulumi.String("string"),
    	ServiceName: pulumi.String("string"),
    })
    
    var ipAddressResource = new IpAddress("ipAddressResource", IpAddressArgs.builder()
        .block("string")
        .serviceName("string")
        .build());
    
    ip_address_resource = ovh.vrack.IpAddress("ipAddressResource",
        block="string",
        service_name="string")
    
    const ipAddressResource = new ovh.vrack.IpAddress("ipAddressResource", {
        block: "string",
        serviceName: "string",
    });
    
    type: ovh:Vrack:IpAddress
    properties:
        block: string
        serviceName: string
    

    IpAddress 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 IpAddress resource accepts the following input properties:

    Block string
    Your IP block.
    ServiceName string
    The internal name of your vrack
    Block string
    Your IP block.
    ServiceName string
    The internal name of your vrack
    block String
    Your IP block.
    serviceName String
    The internal name of your vrack
    block string
    Your IP block.
    serviceName string
    The internal name of your vrack
    block str
    Your IP block.
    service_name str
    The internal name of your vrack
    block String
    Your IP block.
    serviceName String
    The internal name of your vrack

    Outputs

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

    Gateway string
    Your gateway
    Id string
    The provider-assigned unique ID for this managed resource.
    Ip string
    Your IP block
    Zone string
    Where you want your block announced on the network
    Gateway string
    Your gateway
    Id string
    The provider-assigned unique ID for this managed resource.
    Ip string
    Your IP block
    Zone string
    Where you want your block announced on the network
    gateway String
    Your gateway
    id String
    The provider-assigned unique ID for this managed resource.
    ip String
    Your IP block
    zone String
    Where you want your block announced on the network
    gateway string
    Your gateway
    id string
    The provider-assigned unique ID for this managed resource.
    ip string
    Your IP block
    zone string
    Where you want your block announced on the network
    gateway str
    Your gateway
    id str
    The provider-assigned unique ID for this managed resource.
    ip str
    Your IP block
    zone str
    Where you want your block announced on the network
    gateway String
    Your gateway
    id String
    The provider-assigned unique ID for this managed resource.
    ip String
    Your IP block
    zone String
    Where you want your block announced on the network

    Look up Existing IpAddress Resource

    Get an existing IpAddress 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?: IpAddressState, opts?: CustomResourceOptions): IpAddress
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            block: Optional[str] = None,
            gateway: Optional[str] = None,
            ip: Optional[str] = None,
            service_name: Optional[str] = None,
            zone: Optional[str] = None) -> IpAddress
    func GetIpAddress(ctx *Context, name string, id IDInput, state *IpAddressState, opts ...ResourceOption) (*IpAddress, error)
    public static IpAddress Get(string name, Input<string> id, IpAddressState? state, CustomResourceOptions? opts = null)
    public static IpAddress get(String name, Output<String> id, IpAddressState 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:
    Block string
    Your IP block.
    Gateway string
    Your gateway
    Ip string
    Your IP block
    ServiceName string
    The internal name of your vrack
    Zone string
    Where you want your block announced on the network
    Block string
    Your IP block.
    Gateway string
    Your gateway
    Ip string
    Your IP block
    ServiceName string
    The internal name of your vrack
    Zone string
    Where you want your block announced on the network
    block String
    Your IP block.
    gateway String
    Your gateway
    ip String
    Your IP block
    serviceName String
    The internal name of your vrack
    zone String
    Where you want your block announced on the network
    block string
    Your IP block.
    gateway string
    Your gateway
    ip string
    Your IP block
    serviceName string
    The internal name of your vrack
    zone string
    Where you want your block announced on the network
    block str
    Your IP block.
    gateway str
    Your gateway
    ip str
    Your IP block
    service_name str
    The internal name of your vrack
    zone str
    Where you want your block announced on the network
    block String
    Your IP block.
    gateway String
    Your gateway
    ip String
    Your IP block
    serviceName String
    The internal name of your vrack
    zone String
    Where you want your block announced on the network

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    OVHCloud v0.45.0 published on Tuesday, Jun 4, 2024 by OVHcloud