1. Packages
  2. Ionoscloud
  3. API Docs
  4. alb
  5. ForwardingRule
IonosCloud v0.2.2 published on Monday, May 12, 2025 by ionos-cloud

ionoscloud.alb.ForwardingRule

Explore with Pulumi AI

ionoscloud logo
IonosCloud v0.2.2 published on Monday, May 12, 2025 by ionos-cloud

    Manages an Application Load Balancer Forwarding Rule on IonosCloud.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@ionos-cloud/sdk-pulumi";
    
    const example = new ionoscloud.compute.Datacenter("example", {
        name: "Datacenter Example",
        location: "us/las",
        description: "datacenter description",
        secAuthProtection: false,
    });
    const example1 = new ionoscloud.compute.Lan("example_1", {
        datacenterId: example.id,
        "public": true,
        name: "Lan Example",
    });
    const example2 = new ionoscloud.compute.Lan("example_2", {
        datacenterId: example.id,
        "public": true,
        name: "Lan Example",
    });
    const exampleBalancer = new ionoscloud.alb.Balancer("example", {
        datacenterId: example.id,
        name: "ALB Example",
        listenerLan: example1.id,
        ips: ["10.12.118.224"],
        targetLan: example2.id,
        lbPrivateIps: ["10.13.72.225/24"],
    });
    //optionally you can add a certificate to the application load balancer
    const cert = new ionoscloud.cert.Certificate("cert", {
        name: "add_name_here",
        certificate: "your_certificate",
        certificateChain: "your_certificate_chain",
        privateKey: "your_private_key",
    });
    const exampleForwardingRule = new ionoscloud.alb.ForwardingRule("example", {
        datacenterId: example.id,
        applicationLoadbalancerId: exampleBalancer.id,
        name: "ALB FR Example",
        protocol: "HTTP",
        listenerIp: "10.12.118.224",
        listenerPort: 8080,
        clientTimeout: 1000,
        httpRules: [
            {
                name: "http_rule",
                type: "REDIRECT",
                dropQuery: true,
                location: "www.ionos.com",
                statusCode: 301,
                conditions: [{
                    type: "HEADER",
                    condition: "EQUALS",
                    negate: true,
                    key: "key",
                    value: "10.12.120.224/24",
                }],
            },
            {
                name: "http_rule_2",
                type: "STATIC",
                dropQuery: false,
                statusCode: 303,
                responseMessage: "Response",
                contentType: "text/plain",
                conditions: [{
                    type: "QUERY",
                    condition: "MATCHES",
                    negate: false,
                    key: "key",
                    value: "10.12.120.224/24",
                }],
            },
        ],
        serverCertificates: [cert.id],
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.compute.Datacenter("example",
        name="Datacenter Example",
        location="us/las",
        description="datacenter description",
        sec_auth_protection=False)
    example1 = ionoscloud.compute.Lan("example_1",
        datacenter_id=example.id,
        public=True,
        name="Lan Example")
    example2 = ionoscloud.compute.Lan("example_2",
        datacenter_id=example.id,
        public=True,
        name="Lan Example")
    example_balancer = ionoscloud.alb.Balancer("example",
        datacenter_id=example.id,
        name="ALB Example",
        listener_lan=example1.id,
        ips=["10.12.118.224"],
        target_lan=example2.id,
        lb_private_ips=["10.13.72.225/24"])
    #optionally you can add a certificate to the application load balancer
    cert = ionoscloud.cert.Certificate("cert",
        name="add_name_here",
        certificate="your_certificate",
        certificate_chain="your_certificate_chain",
        private_key="your_private_key")
    example_forwarding_rule = ionoscloud.alb.ForwardingRule("example",
        datacenter_id=example.id,
        application_loadbalancer_id=example_balancer.id,
        name="ALB FR Example",
        protocol="HTTP",
        listener_ip="10.12.118.224",
        listener_port=8080,
        client_timeout=1000,
        http_rules=[
            {
                "name": "http_rule",
                "type": "REDIRECT",
                "drop_query": True,
                "location": "www.ionos.com",
                "status_code": 301,
                "conditions": [{
                    "type": "HEADER",
                    "condition": "EQUALS",
                    "negate": True,
                    "key": "key",
                    "value": "10.12.120.224/24",
                }],
            },
            {
                "name": "http_rule_2",
                "type": "STATIC",
                "drop_query": False,
                "status_code": 303,
                "response_message": "Response",
                "content_type": "text/plain",
                "conditions": [{
                    "type": "QUERY",
                    "condition": "MATCHES",
                    "negate": False,
                    "key": "key",
                    "value": "10.12.120.224/24",
                }],
            },
        ],
        server_certificates=[cert.id])
    
    package main
    
    import (
    	"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/alb"
    	"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/cert"
    	"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := compute.NewDatacenter(ctx, "example", &compute.DatacenterArgs{
    			Name:              pulumi.String("Datacenter Example"),
    			Location:          pulumi.String("us/las"),
    			Description:       pulumi.String("datacenter description"),
    			SecAuthProtection: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		example1, err := compute.NewLan(ctx, "example_1", &compute.LanArgs{
    			DatacenterId: example.ID(),
    			Public:       pulumi.Bool(true),
    			Name:         pulumi.String("Lan Example"),
    		})
    		if err != nil {
    			return err
    		}
    		example2, err := compute.NewLan(ctx, "example_2", &compute.LanArgs{
    			DatacenterId: example.ID(),
    			Public:       pulumi.Bool(true),
    			Name:         pulumi.String("Lan Example"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleBalancer, err := alb.NewBalancer(ctx, "example", &alb.BalancerArgs{
    			DatacenterId: example.ID(),
    			Name:         pulumi.String("ALB Example"),
    			ListenerLan:  example1.ID(),
    			Ips: pulumi.StringArray{
    				pulumi.String("10.12.118.224"),
    			},
    			TargetLan: example2.ID(),
    			LbPrivateIps: pulumi.StringArray{
    				pulumi.String("10.13.72.225/24"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// optionally you can add a certificate to the application load balancer
    		cert, err := cert.NewCertificate(ctx, "cert", &cert.CertificateArgs{
    			Name:             pulumi.String("add_name_here"),
    			Certificate:      pulumi.String("your_certificate"),
    			CertificateChain: pulumi.String("your_certificate_chain"),
    			PrivateKey:       pulumi.String("your_private_key"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = alb.NewForwardingRule(ctx, "example", &alb.ForwardingRuleArgs{
    			DatacenterId:              example.ID(),
    			ApplicationLoadbalancerId: exampleBalancer.ID(),
    			Name:                      pulumi.String("ALB FR Example"),
    			Protocol:                  pulumi.String("HTTP"),
    			ListenerIp:                pulumi.String("10.12.118.224"),
    			ListenerPort:              pulumi.Int(8080),
    			ClientTimeout:             pulumi.Int(1000),
    			HttpRules: alb.ForwardingRuleHttpRuleArray{
    				&alb.ForwardingRuleHttpRuleArgs{
    					Name:       pulumi.String("http_rule"),
    					Type:       pulumi.String("REDIRECT"),
    					DropQuery:  pulumi.Bool(true),
    					Location:   pulumi.String("www.ionos.com"),
    					StatusCode: pulumi.Int(301),
    					Conditions: alb.ForwardingRuleHttpRuleConditionArray{
    						&alb.ForwardingRuleHttpRuleConditionArgs{
    							Type:      pulumi.String("HEADER"),
    							Condition: pulumi.String("EQUALS"),
    							Negate:    pulumi.Bool(true),
    							Key:       pulumi.String("key"),
    							Value:     pulumi.String("10.12.120.224/24"),
    						},
    					},
    				},
    				&alb.ForwardingRuleHttpRuleArgs{
    					Name:            pulumi.String("http_rule_2"),
    					Type:            pulumi.String("STATIC"),
    					DropQuery:       pulumi.Bool(false),
    					StatusCode:      pulumi.Int(303),
    					ResponseMessage: pulumi.String("Response"),
    					ContentType:     pulumi.String("text/plain"),
    					Conditions: alb.ForwardingRuleHttpRuleConditionArray{
    						&alb.ForwardingRuleHttpRuleConditionArgs{
    							Type:      pulumi.String("QUERY"),
    							Condition: pulumi.String("MATCHES"),
    							Negate:    pulumi.Bool(false),
    							Key:       pulumi.String("key"),
    							Value:     pulumi.String("10.12.120.224/24"),
    						},
    					},
    				},
    			},
    			ServerCertificates: pulumi.StringArray{
    				cert.ID(),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Ionoscloud.Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Ionoscloud.Compute.Datacenter("example", new()
        {
            Name = "Datacenter Example",
            Location = "us/las",
            Description = "datacenter description",
            SecAuthProtection = false,
        });
    
        var example1 = new Ionoscloud.Compute.Lan("example_1", new()
        {
            DatacenterId = example.Id,
            Public = true,
            Name = "Lan Example",
        });
    
        var example2 = new Ionoscloud.Compute.Lan("example_2", new()
        {
            DatacenterId = example.Id,
            Public = true,
            Name = "Lan Example",
        });
    
        var exampleBalancer = new Ionoscloud.Alb.Balancer("example", new()
        {
            DatacenterId = example.Id,
            Name = "ALB Example",
            ListenerLan = example1.Id,
            Ips = new[]
            {
                "10.12.118.224",
            },
            TargetLan = example2.Id,
            LbPrivateIps = new[]
            {
                "10.13.72.225/24",
            },
        });
    
        //optionally you can add a certificate to the application load balancer
        var cert = new Ionoscloud.Cert.IonosCertificate("cert", new()
        {
            Name = "add_name_here",
            Certificate = "your_certificate",
            CertificateChain = "your_certificate_chain",
            PrivateKey = "your_private_key",
        });
    
        var exampleForwardingRule = new Ionoscloud.Alb.ForwardingRule("example", new()
        {
            DatacenterId = example.Id,
            ApplicationLoadbalancerId = exampleBalancer.Id,
            Name = "ALB FR Example",
            Protocol = "HTTP",
            ListenerIp = "10.12.118.224",
            ListenerPort = 8080,
            ClientTimeout = 1000,
            HttpRules = new[]
            {
                new Ionoscloud.Alb.Inputs.ForwardingRuleHttpRuleArgs
                {
                    Name = "http_rule",
                    Type = "REDIRECT",
                    DropQuery = true,
                    Location = "www.ionos.com",
                    StatusCode = 301,
                    Conditions = new[]
                    {
                        new Ionoscloud.Alb.Inputs.ForwardingRuleHttpRuleConditionArgs
                        {
                            Type = "HEADER",
                            Condition = "EQUALS",
                            Negate = true,
                            Key = "key",
                            Value = "10.12.120.224/24",
                        },
                    },
                },
                new Ionoscloud.Alb.Inputs.ForwardingRuleHttpRuleArgs
                {
                    Name = "http_rule_2",
                    Type = "STATIC",
                    DropQuery = false,
                    StatusCode = 303,
                    ResponseMessage = "Response",
                    ContentType = "text/plain",
                    Conditions = new[]
                    {
                        new Ionoscloud.Alb.Inputs.ForwardingRuleHttpRuleConditionArgs
                        {
                            Type = "QUERY",
                            Condition = "MATCHES",
                            Negate = false,
                            Key = "key",
                            Value = "10.12.120.224/24",
                        },
                    },
                },
            },
            ServerCertificates = new[]
            {
                cert.Id,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.compute.Datacenter;
    import com.pulumi.ionoscloud.compute.DatacenterArgs;
    import com.pulumi.ionoscloud.compute.Lan;
    import com.pulumi.ionoscloud.compute.LanArgs;
    import com.pulumi.ionoscloud.alb.Balancer;
    import com.pulumi.ionoscloud.alb.BalancerArgs;
    import com.pulumi.ionoscloud.cert.Certificate;
    import com.pulumi.ionoscloud.cert.CertificateArgs;
    import com.pulumi.ionoscloud.alb.ForwardingRule;
    import com.pulumi.ionoscloud.alb.ForwardingRuleArgs;
    import com.pulumi.ionoscloud.alb.inputs.ForwardingRuleHttpRuleArgs;
    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 example = new Datacenter("example", DatacenterArgs.builder()
                .name("Datacenter Example")
                .location("us/las")
                .description("datacenter description")
                .secAuthProtection(false)
                .build());
    
            var example1 = new Lan("example1", LanArgs.builder()
                .datacenterId(example.id())
                .public_(true)
                .name("Lan Example")
                .build());
    
            var example2 = new Lan("example2", LanArgs.builder()
                .datacenterId(example.id())
                .public_(true)
                .name("Lan Example")
                .build());
    
            var exampleBalancer = new Balancer("exampleBalancer", BalancerArgs.builder()
                .datacenterId(example.id())
                .name("ALB Example")
                .listenerLan(example1.id())
                .ips("10.12.118.224")
                .targetLan(example2.id())
                .lbPrivateIps("10.13.72.225/24")
                .build());
    
            //optionally you can add a certificate to the application load balancer
            var cert = new Certificate("cert", CertificateArgs.builder()
                .name("add_name_here")
                .certificate("your_certificate")
                .certificateChain("your_certificate_chain")
                .privateKey("your_private_key")
                .build());
    
            var exampleForwardingRule = new ForwardingRule("exampleForwardingRule", ForwardingRuleArgs.builder()
                .datacenterId(example.id())
                .applicationLoadbalancerId(exampleBalancer.id())
                .name("ALB FR Example")
                .protocol("HTTP")
                .listenerIp("10.12.118.224")
                .listenerPort(8080)
                .clientTimeout(1000)
                .httpRules(            
                    ForwardingRuleHttpRuleArgs.builder()
                        .name("http_rule")
                        .type("REDIRECT")
                        .dropQuery(true)
                        .location("www.ionos.com")
                        .statusCode(301)
                        .conditions(ForwardingRuleHttpRuleConditionArgs.builder()
                            .type("HEADER")
                            .condition("EQUALS")
                            .negate(true)
                            .key("key")
                            .value("10.12.120.224/24")
                            .build())
                        .build(),
                    ForwardingRuleHttpRuleArgs.builder()
                        .name("http_rule_2")
                        .type("STATIC")
                        .dropQuery(false)
                        .statusCode(303)
                        .responseMessage("Response")
                        .contentType("text/plain")
                        .conditions(ForwardingRuleHttpRuleConditionArgs.builder()
                            .type("QUERY")
                            .condition("MATCHES")
                            .negate(false)
                            .key("key")
                            .value("10.12.120.224/24")
                            .build())
                        .build())
                .serverCertificates(cert.id())
                .build());
    
        }
    }
    
    resources:
      example:
        type: ionoscloud:compute:Datacenter
        properties:
          name: Datacenter Example
          location: us/las
          description: datacenter description
          secAuthProtection: false
      example1:
        type: ionoscloud:compute:Lan
        name: example_1
        properties:
          datacenterId: ${example.id}
          public: true
          name: Lan Example
      example2:
        type: ionoscloud:compute:Lan
        name: example_2
        properties:
          datacenterId: ${example.id}
          public: true
          name: Lan Example
      exampleBalancer:
        type: ionoscloud:alb:Balancer
        name: example
        properties:
          datacenterId: ${example.id}
          name: ALB Example
          listenerLan: ${example1.id}
          ips:
            - 10.12.118.224
          targetLan: ${example2.id}
          lbPrivateIps:
            - 10.13.72.225/24
      exampleForwardingRule:
        type: ionoscloud:alb:ForwardingRule
        name: example
        properties:
          datacenterId: ${example.id}
          applicationLoadbalancerId: ${exampleBalancer.id}
          name: ALB FR Example
          protocol: HTTP
          listenerIp: 10.12.118.224
          listenerPort: 8080
          clientTimeout: 1000
          httpRules:
            - name: http_rule
              type: REDIRECT
              dropQuery: true
              location: www.ionos.com
              statusCode: 301
              conditions:
                - type: HEADER
                  condition: EQUALS
                  negate: true
                  key: key
                  value: 10.12.120.224/24
            - name: http_rule_2
              type: STATIC
              dropQuery: false
              statusCode: 303
              responseMessage: Response
              contentType: text/plain
              conditions:
                - type: QUERY
                  condition: MATCHES
                  negate: false
                  key: key
                  value: 10.12.120.224/24
          serverCertificates:
            - ${cert.id}
      #optionally you can add a certificate to the application load balancer
      cert:
        type: ionoscloud:cert:Certificate
        properties:
          name: add_name_here
          certificate: your_certificate
          certificateChain: your_certificate_chain
          privateKey: your_private_key
    

    Create ForwardingRule Resource

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

    Constructor syntax

    new ForwardingRule(name: string, args: ForwardingRuleArgs, opts?: CustomResourceOptions);
    @overload
    def ForwardingRule(resource_name: str,
                       args: ForwardingRuleArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def ForwardingRule(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       application_loadbalancer_id: Optional[str] = None,
                       datacenter_id: Optional[str] = None,
                       listener_ip: Optional[str] = None,
                       listener_port: Optional[int] = None,
                       protocol: Optional[str] = None,
                       client_timeout: Optional[int] = None,
                       http_rules: Optional[Sequence[ForwardingRuleHttpRuleArgs]] = None,
                       name: Optional[str] = None,
                       server_certificates: Optional[Sequence[str]] = None)
    func NewForwardingRule(ctx *Context, name string, args ForwardingRuleArgs, opts ...ResourceOption) (*ForwardingRule, error)
    public ForwardingRule(string name, ForwardingRuleArgs args, CustomResourceOptions? opts = null)
    public ForwardingRule(String name, ForwardingRuleArgs args)
    public ForwardingRule(String name, ForwardingRuleArgs args, CustomResourceOptions options)
    
    type: ionoscloud:alb:ForwardingRule
    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 ForwardingRuleArgs
    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 ForwardingRuleArgs
    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 ForwardingRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ForwardingRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ForwardingRuleArgs
    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 forwardingRuleResource = new Ionoscloud.Alb.ForwardingRule("forwardingRuleResource", new()
    {
        ApplicationLoadbalancerId = "string",
        DatacenterId = "string",
        ListenerIp = "string",
        ListenerPort = 0,
        Protocol = "string",
        ClientTimeout = 0,
        HttpRules = new[]
        {
            new Ionoscloud.Alb.Inputs.ForwardingRuleHttpRuleArgs
            {
                Name = "string",
                Type = "string",
                Conditions = new[]
                {
                    new Ionoscloud.Alb.Inputs.ForwardingRuleHttpRuleConditionArgs
                    {
                        Type = "string",
                        Condition = "string",
                        Key = "string",
                        Negate = false,
                        Value = "string",
                    },
                },
                ContentType = "string",
                DropQuery = false,
                Location = "string",
                ResponseMessage = "string",
                StatusCode = 0,
                TargetGroup = "string",
            },
        },
        Name = "string",
        ServerCertificates = new[]
        {
            "string",
        },
    });
    
    example, err := alb.NewForwardingRule(ctx, "forwardingRuleResource", &alb.ForwardingRuleArgs{
    	ApplicationLoadbalancerId: pulumi.String("string"),
    	DatacenterId:              pulumi.String("string"),
    	ListenerIp:                pulumi.String("string"),
    	ListenerPort:              pulumi.Int(0),
    	Protocol:                  pulumi.String("string"),
    	ClientTimeout:             pulumi.Int(0),
    	HttpRules: alb.ForwardingRuleHttpRuleArray{
    		&alb.ForwardingRuleHttpRuleArgs{
    			Name: pulumi.String("string"),
    			Type: pulumi.String("string"),
    			Conditions: alb.ForwardingRuleHttpRuleConditionArray{
    				&alb.ForwardingRuleHttpRuleConditionArgs{
    					Type:      pulumi.String("string"),
    					Condition: pulumi.String("string"),
    					Key:       pulumi.String("string"),
    					Negate:    pulumi.Bool(false),
    					Value:     pulumi.String("string"),
    				},
    			},
    			ContentType:     pulumi.String("string"),
    			DropQuery:       pulumi.Bool(false),
    			Location:        pulumi.String("string"),
    			ResponseMessage: pulumi.String("string"),
    			StatusCode:      pulumi.Int(0),
    			TargetGroup:     pulumi.String("string"),
    		},
    	},
    	Name: pulumi.String("string"),
    	ServerCertificates: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var forwardingRuleResource = new com.ionoscloud.pulumi.ionoscloud.alb.ForwardingRule("forwardingRuleResource", com.ionoscloud.pulumi.ionoscloud.alb.ForwardingRuleArgs.builder()
        .applicationLoadbalancerId("string")
        .datacenterId("string")
        .listenerIp("string")
        .listenerPort(0)
        .protocol("string")
        .clientTimeout(0)
        .httpRules(ForwardingRuleHttpRuleArgs.builder()
            .name("string")
            .type("string")
            .conditions(ForwardingRuleHttpRuleConditionArgs.builder()
                .type("string")
                .condition("string")
                .key("string")
                .negate(false)
                .value("string")
                .build())
            .contentType("string")
            .dropQuery(false)
            .location("string")
            .responseMessage("string")
            .statusCode(0)
            .targetGroup("string")
            .build())
        .name("string")
        .serverCertificates("string")
        .build());
    
    forwarding_rule_resource = ionoscloud.alb.ForwardingRule("forwardingRuleResource",
        application_loadbalancer_id="string",
        datacenter_id="string",
        listener_ip="string",
        listener_port=0,
        protocol="string",
        client_timeout=0,
        http_rules=[{
            "name": "string",
            "type": "string",
            "conditions": [{
                "type": "string",
                "condition": "string",
                "key": "string",
                "negate": False,
                "value": "string",
            }],
            "content_type": "string",
            "drop_query": False,
            "location": "string",
            "response_message": "string",
            "status_code": 0,
            "target_group": "string",
        }],
        name="string",
        server_certificates=["string"])
    
    const forwardingRuleResource = new ionoscloud.alb.ForwardingRule("forwardingRuleResource", {
        applicationLoadbalancerId: "string",
        datacenterId: "string",
        listenerIp: "string",
        listenerPort: 0,
        protocol: "string",
        clientTimeout: 0,
        httpRules: [{
            name: "string",
            type: "string",
            conditions: [{
                type: "string",
                condition: "string",
                key: "string",
                negate: false,
                value: "string",
            }],
            contentType: "string",
            dropQuery: false,
            location: "string",
            responseMessage: "string",
            statusCode: 0,
            targetGroup: "string",
        }],
        name: "string",
        serverCertificates: ["string"],
    });
    
    type: ionoscloud:alb:ForwardingRule
    properties:
        applicationLoadbalancerId: string
        clientTimeout: 0
        datacenterId: string
        httpRules:
            - conditions:
                - condition: string
                  key: string
                  negate: false
                  type: string
                  value: string
              contentType: string
              dropQuery: false
              location: string
              name: string
              responseMessage: string
              statusCode: 0
              targetGroup: string
              type: string
        listenerIp: string
        listenerPort: 0
        name: string
        protocol: string
        serverCertificates:
            - string
    

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

    ApplicationLoadbalancerId string
    [string] The ID of Application Load Balancer.
    DatacenterId string
    [string] The ID of a Virtual Data Center.
    ListenerIp string
    [string] Listening (inbound) IP.
    ListenerPort int
    [int] Listening (inbound) port number; valid range is 1 to 65535.
    Protocol string
    [string] Balancing protocol.
    ClientTimeout int
    [int] The maximum time in milliseconds to wait for the client to acknowledge or send data; default is 50,000 (50 seconds).
    HttpRules List<Ionoscloud.ForwardingRuleHttpRule>
    [list] Array of items in that collection
    Name string
    [string] The name of the Application Load Balancer forwarding rule.
    ServerCertificates List<string>
    [list] Array of certificate ids. You can create certificates with the certificate resource.
    ApplicationLoadbalancerId string
    [string] The ID of Application Load Balancer.
    DatacenterId string
    [string] The ID of a Virtual Data Center.
    ListenerIp string
    [string] Listening (inbound) IP.
    ListenerPort int
    [int] Listening (inbound) port number; valid range is 1 to 65535.
    Protocol string
    [string] Balancing protocol.
    ClientTimeout int
    [int] The maximum time in milliseconds to wait for the client to acknowledge or send data; default is 50,000 (50 seconds).
    HttpRules []ForwardingRuleHttpRuleArgs
    [list] Array of items in that collection
    Name string
    [string] The name of the Application Load Balancer forwarding rule.
    ServerCertificates []string
    [list] Array of certificate ids. You can create certificates with the certificate resource.
    applicationLoadbalancerId String
    [string] The ID of Application Load Balancer.
    datacenterId String
    [string] The ID of a Virtual Data Center.
    listenerIp String
    [string] Listening (inbound) IP.
    listenerPort Integer
    [int] Listening (inbound) port number; valid range is 1 to 65535.
    protocol String
    [string] Balancing protocol.
    clientTimeout Integer
    [int] The maximum time in milliseconds to wait for the client to acknowledge or send data; default is 50,000 (50 seconds).
    httpRules List<ForwardingRuleHttpRule>
    [list] Array of items in that collection
    name String
    [string] The name of the Application Load Balancer forwarding rule.
    serverCertificates List<String>
    [list] Array of certificate ids. You can create certificates with the certificate resource.
    applicationLoadbalancerId string
    [string] The ID of Application Load Balancer.
    datacenterId string
    [string] The ID of a Virtual Data Center.
    listenerIp string
    [string] Listening (inbound) IP.
    listenerPort number
    [int] Listening (inbound) port number; valid range is 1 to 65535.
    protocol string
    [string] Balancing protocol.
    clientTimeout number
    [int] The maximum time in milliseconds to wait for the client to acknowledge or send data; default is 50,000 (50 seconds).
    httpRules ForwardingRuleHttpRule[]
    [list] Array of items in that collection
    name string
    [string] The name of the Application Load Balancer forwarding rule.
    serverCertificates string[]
    [list] Array of certificate ids. You can create certificates with the certificate resource.
    application_loadbalancer_id str
    [string] The ID of Application Load Balancer.
    datacenter_id str
    [string] The ID of a Virtual Data Center.
    listener_ip str
    [string] Listening (inbound) IP.
    listener_port int
    [int] Listening (inbound) port number; valid range is 1 to 65535.
    protocol str
    [string] Balancing protocol.
    client_timeout int
    [int] The maximum time in milliseconds to wait for the client to acknowledge or send data; default is 50,000 (50 seconds).
    http_rules Sequence[ForwardingRuleHttpRuleArgs]
    [list] Array of items in that collection
    name str
    [string] The name of the Application Load Balancer forwarding rule.
    server_certificates Sequence[str]
    [list] Array of certificate ids. You can create certificates with the certificate resource.
    applicationLoadbalancerId String
    [string] The ID of Application Load Balancer.
    datacenterId String
    [string] The ID of a Virtual Data Center.
    listenerIp String
    [string] Listening (inbound) IP.
    listenerPort Number
    [int] Listening (inbound) port number; valid range is 1 to 65535.
    protocol String
    [string] Balancing protocol.
    clientTimeout Number
    [int] The maximum time in milliseconds to wait for the client to acknowledge or send data; default is 50,000 (50 seconds).
    httpRules List<Property Map>
    [list] Array of items in that collection
    name String
    [string] The name of the Application Load Balancer forwarding rule.
    serverCertificates List<String>
    [list] Array of certificate ids. You can create certificates with the certificate resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ForwardingRule 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 ForwardingRule Resource

    Get an existing ForwardingRule 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?: ForwardingRuleState, opts?: CustomResourceOptions): ForwardingRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            application_loadbalancer_id: Optional[str] = None,
            client_timeout: Optional[int] = None,
            datacenter_id: Optional[str] = None,
            http_rules: Optional[Sequence[ForwardingRuleHttpRuleArgs]] = None,
            listener_ip: Optional[str] = None,
            listener_port: Optional[int] = None,
            name: Optional[str] = None,
            protocol: Optional[str] = None,
            server_certificates: Optional[Sequence[str]] = None) -> ForwardingRule
    func GetForwardingRule(ctx *Context, name string, id IDInput, state *ForwardingRuleState, opts ...ResourceOption) (*ForwardingRule, error)
    public static ForwardingRule Get(string name, Input<string> id, ForwardingRuleState? state, CustomResourceOptions? opts = null)
    public static ForwardingRule get(String name, Output<String> id, ForwardingRuleState state, CustomResourceOptions options)
    resources:  _:    type: ionoscloud:alb:ForwardingRule    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.
    The following state arguments are supported:
    ApplicationLoadbalancerId string
    [string] The ID of Application Load Balancer.
    ClientTimeout int
    [int] The maximum time in milliseconds to wait for the client to acknowledge or send data; default is 50,000 (50 seconds).
    DatacenterId string
    [string] The ID of a Virtual Data Center.
    HttpRules List<Ionoscloud.ForwardingRuleHttpRule>
    [list] Array of items in that collection
    ListenerIp string
    [string] Listening (inbound) IP.
    ListenerPort int
    [int] Listening (inbound) port number; valid range is 1 to 65535.
    Name string
    [string] The name of the Application Load Balancer forwarding rule.
    Protocol string
    [string] Balancing protocol.
    ServerCertificates List<string>
    [list] Array of certificate ids. You can create certificates with the certificate resource.
    ApplicationLoadbalancerId string
    [string] The ID of Application Load Balancer.
    ClientTimeout int
    [int] The maximum time in milliseconds to wait for the client to acknowledge or send data; default is 50,000 (50 seconds).
    DatacenterId string
    [string] The ID of a Virtual Data Center.
    HttpRules []ForwardingRuleHttpRuleArgs
    [list] Array of items in that collection
    ListenerIp string
    [string] Listening (inbound) IP.
    ListenerPort int
    [int] Listening (inbound) port number; valid range is 1 to 65535.
    Name string
    [string] The name of the Application Load Balancer forwarding rule.
    Protocol string
    [string] Balancing protocol.
    ServerCertificates []string
    [list] Array of certificate ids. You can create certificates with the certificate resource.
    applicationLoadbalancerId String
    [string] The ID of Application Load Balancer.
    clientTimeout Integer
    [int] The maximum time in milliseconds to wait for the client to acknowledge or send data; default is 50,000 (50 seconds).
    datacenterId String
    [string] The ID of a Virtual Data Center.
    httpRules List<ForwardingRuleHttpRule>
    [list] Array of items in that collection
    listenerIp String
    [string] Listening (inbound) IP.
    listenerPort Integer
    [int] Listening (inbound) port number; valid range is 1 to 65535.
    name String
    [string] The name of the Application Load Balancer forwarding rule.
    protocol String
    [string] Balancing protocol.
    serverCertificates List<String>
    [list] Array of certificate ids. You can create certificates with the certificate resource.
    applicationLoadbalancerId string
    [string] The ID of Application Load Balancer.
    clientTimeout number
    [int] The maximum time in milliseconds to wait for the client to acknowledge or send data; default is 50,000 (50 seconds).
    datacenterId string
    [string] The ID of a Virtual Data Center.
    httpRules ForwardingRuleHttpRule[]
    [list] Array of items in that collection
    listenerIp string
    [string] Listening (inbound) IP.
    listenerPort number
    [int] Listening (inbound) port number; valid range is 1 to 65535.
    name string
    [string] The name of the Application Load Balancer forwarding rule.
    protocol string
    [string] Balancing protocol.
    serverCertificates string[]
    [list] Array of certificate ids. You can create certificates with the certificate resource.
    application_loadbalancer_id str
    [string] The ID of Application Load Balancer.
    client_timeout int
    [int] The maximum time in milliseconds to wait for the client to acknowledge or send data; default is 50,000 (50 seconds).
    datacenter_id str
    [string] The ID of a Virtual Data Center.
    http_rules Sequence[ForwardingRuleHttpRuleArgs]
    [list] Array of items in that collection
    listener_ip str
    [string] Listening (inbound) IP.
    listener_port int
    [int] Listening (inbound) port number; valid range is 1 to 65535.
    name str
    [string] The name of the Application Load Balancer forwarding rule.
    protocol str
    [string] Balancing protocol.
    server_certificates Sequence[str]
    [list] Array of certificate ids. You can create certificates with the certificate resource.
    applicationLoadbalancerId String
    [string] The ID of Application Load Balancer.
    clientTimeout Number
    [int] The maximum time in milliseconds to wait for the client to acknowledge or send data; default is 50,000 (50 seconds).
    datacenterId String
    [string] The ID of a Virtual Data Center.
    httpRules List<Property Map>
    [list] Array of items in that collection
    listenerIp String
    [string] Listening (inbound) IP.
    listenerPort Number
    [int] Listening (inbound) port number; valid range is 1 to 65535.
    name String
    [string] The name of the Application Load Balancer forwarding rule.
    protocol String
    [string] Balancing protocol.
    serverCertificates List<String>
    [list] Array of certificate ids. You can create certificates with the certificate resource.

    Supporting Types

    ForwardingRuleHttpRule, ForwardingRuleHttpRuleArgs

    Name string
    [string] The unique name of the Application Load Balancer HTTP rule.
    Type string
    [string] Type of the Http Rule.
    Conditions List<Ionoscloud.ForwardingRuleHttpRuleCondition>
    [list] - An array of items in the collection.The action is only performed if each and every condition is met; if no conditions are set, the rule will always be performed.
    ContentType string
    [string] Valid only for STATIC actions.
    DropQuery bool
    [bool] Default is false; valid only for REDIRECT actions.
    Location string
    [string] The location for redirecting; mandatory and valid only for REDIRECT actions.
    ResponseMessage string
    [string] The response message of the request; mandatory for STATIC action.
    StatusCode int
    [int] Valid only for REDIRECT and STATIC actions. For REDIRECT actions, default is 301 and possible values are 301, 302, 303, 307, and 308. For STATIC actions, default is 503 and valid range is 200 to 599.
    TargetGroup string
    [string] The UUID of the target group; mandatory for FORWARD action.
    Name string
    [string] The unique name of the Application Load Balancer HTTP rule.
    Type string
    [string] Type of the Http Rule.
    Conditions []ForwardingRuleHttpRuleCondition
    [list] - An array of items in the collection.The action is only performed if each and every condition is met; if no conditions are set, the rule will always be performed.
    ContentType string
    [string] Valid only for STATIC actions.
    DropQuery bool
    [bool] Default is false; valid only for REDIRECT actions.
    Location string
    [string] The location for redirecting; mandatory and valid only for REDIRECT actions.
    ResponseMessage string
    [string] The response message of the request; mandatory for STATIC action.
    StatusCode int
    [int] Valid only for REDIRECT and STATIC actions. For REDIRECT actions, default is 301 and possible values are 301, 302, 303, 307, and 308. For STATIC actions, default is 503 and valid range is 200 to 599.
    TargetGroup string
    [string] The UUID of the target group; mandatory for FORWARD action.
    name String
    [string] The unique name of the Application Load Balancer HTTP rule.
    type String
    [string] Type of the Http Rule.
    conditions List<ForwardingRuleHttpRuleCondition>
    [list] - An array of items in the collection.The action is only performed if each and every condition is met; if no conditions are set, the rule will always be performed.
    contentType String
    [string] Valid only for STATIC actions.
    dropQuery Boolean
    [bool] Default is false; valid only for REDIRECT actions.
    location String
    [string] The location for redirecting; mandatory and valid only for REDIRECT actions.
    responseMessage String
    [string] The response message of the request; mandatory for STATIC action.
    statusCode Integer
    [int] Valid only for REDIRECT and STATIC actions. For REDIRECT actions, default is 301 and possible values are 301, 302, 303, 307, and 308. For STATIC actions, default is 503 and valid range is 200 to 599.
    targetGroup String
    [string] The UUID of the target group; mandatory for FORWARD action.
    name string
    [string] The unique name of the Application Load Balancer HTTP rule.
    type string
    [string] Type of the Http Rule.
    conditions ForwardingRuleHttpRuleCondition[]
    [list] - An array of items in the collection.The action is only performed if each and every condition is met; if no conditions are set, the rule will always be performed.
    contentType string
    [string] Valid only for STATIC actions.
    dropQuery boolean
    [bool] Default is false; valid only for REDIRECT actions.
    location string
    [string] The location for redirecting; mandatory and valid only for REDIRECT actions.
    responseMessage string
    [string] The response message of the request; mandatory for STATIC action.
    statusCode number
    [int] Valid only for REDIRECT and STATIC actions. For REDIRECT actions, default is 301 and possible values are 301, 302, 303, 307, and 308. For STATIC actions, default is 503 and valid range is 200 to 599.
    targetGroup string
    [string] The UUID of the target group; mandatory for FORWARD action.
    name str
    [string] The unique name of the Application Load Balancer HTTP rule.
    type str
    [string] Type of the Http Rule.
    conditions Sequence[ForwardingRuleHttpRuleCondition]
    [list] - An array of items in the collection.The action is only performed if each and every condition is met; if no conditions are set, the rule will always be performed.
    content_type str
    [string] Valid only for STATIC actions.
    drop_query bool
    [bool] Default is false; valid only for REDIRECT actions.
    location str
    [string] The location for redirecting; mandatory and valid only for REDIRECT actions.
    response_message str
    [string] The response message of the request; mandatory for STATIC action.
    status_code int
    [int] Valid only for REDIRECT and STATIC actions. For REDIRECT actions, default is 301 and possible values are 301, 302, 303, 307, and 308. For STATIC actions, default is 503 and valid range is 200 to 599.
    target_group str
    [string] The UUID of the target group; mandatory for FORWARD action.
    name String
    [string] The unique name of the Application Load Balancer HTTP rule.
    type String
    [string] Type of the Http Rule.
    conditions List<Property Map>
    [list] - An array of items in the collection.The action is only performed if each and every condition is met; if no conditions are set, the rule will always be performed.
    contentType String
    [string] Valid only for STATIC actions.
    dropQuery Boolean
    [bool] Default is false; valid only for REDIRECT actions.
    location String
    [string] The location for redirecting; mandatory and valid only for REDIRECT actions.
    responseMessage String
    [string] The response message of the request; mandatory for STATIC action.
    statusCode Number
    [int] Valid only for REDIRECT and STATIC actions. For REDIRECT actions, default is 301 and possible values are 301, 302, 303, 307, and 308. For STATIC actions, default is 503 and valid range is 200 to 599.
    targetGroup String
    [string] The UUID of the target group; mandatory for FORWARD action.

    ForwardingRuleHttpRuleCondition, ForwardingRuleHttpRuleConditionArgs

    Type string
    [string] Type of the Http Rule condition.
    Condition string
    [string] Matching rule for the HTTP rule condition attribute; mandatory for HEADER, PATH, QUERY, METHOD, HOST, and COOKIE types; must be null when type is SOURCE_IP.
    Key string
    [string] Must be null when type is PATH, METHOD, HOST, or SOURCE_IP. Key can only be set when type is COOKIES, HEADER, or QUERY.
    Negate bool
    [bool] Specifies whether the condition is negated or not; the default is False.
    Value string
    [string] Mandatory for conditions CONTAINS, EQUALS, MATCHES, STARTS_WITH, ENDS_WITH; must be null when condition is EXISTS; should be a valid CIDR if provided and if type is SOURCE_IP.
    Type string
    [string] Type of the Http Rule condition.
    Condition string
    [string] Matching rule for the HTTP rule condition attribute; mandatory for HEADER, PATH, QUERY, METHOD, HOST, and COOKIE types; must be null when type is SOURCE_IP.
    Key string
    [string] Must be null when type is PATH, METHOD, HOST, or SOURCE_IP. Key can only be set when type is COOKIES, HEADER, or QUERY.
    Negate bool
    [bool] Specifies whether the condition is negated or not; the default is False.
    Value string
    [string] Mandatory for conditions CONTAINS, EQUALS, MATCHES, STARTS_WITH, ENDS_WITH; must be null when condition is EXISTS; should be a valid CIDR if provided and if type is SOURCE_IP.
    type String
    [string] Type of the Http Rule condition.
    condition String
    [string] Matching rule for the HTTP rule condition attribute; mandatory for HEADER, PATH, QUERY, METHOD, HOST, and COOKIE types; must be null when type is SOURCE_IP.
    key String
    [string] Must be null when type is PATH, METHOD, HOST, or SOURCE_IP. Key can only be set when type is COOKIES, HEADER, or QUERY.
    negate Boolean
    [bool] Specifies whether the condition is negated or not; the default is False.
    value String
    [string] Mandatory for conditions CONTAINS, EQUALS, MATCHES, STARTS_WITH, ENDS_WITH; must be null when condition is EXISTS; should be a valid CIDR if provided and if type is SOURCE_IP.
    type string
    [string] Type of the Http Rule condition.
    condition string
    [string] Matching rule for the HTTP rule condition attribute; mandatory for HEADER, PATH, QUERY, METHOD, HOST, and COOKIE types; must be null when type is SOURCE_IP.
    key string
    [string] Must be null when type is PATH, METHOD, HOST, or SOURCE_IP. Key can only be set when type is COOKIES, HEADER, or QUERY.
    negate boolean
    [bool] Specifies whether the condition is negated or not; the default is False.
    value string
    [string] Mandatory for conditions CONTAINS, EQUALS, MATCHES, STARTS_WITH, ENDS_WITH; must be null when condition is EXISTS; should be a valid CIDR if provided and if type is SOURCE_IP.
    type str
    [string] Type of the Http Rule condition.
    condition str
    [string] Matching rule for the HTTP rule condition attribute; mandatory for HEADER, PATH, QUERY, METHOD, HOST, and COOKIE types; must be null when type is SOURCE_IP.
    key str
    [string] Must be null when type is PATH, METHOD, HOST, or SOURCE_IP. Key can only be set when type is COOKIES, HEADER, or QUERY.
    negate bool
    [bool] Specifies whether the condition is negated or not; the default is False.
    value str
    [string] Mandatory for conditions CONTAINS, EQUALS, MATCHES, STARTS_WITH, ENDS_WITH; must be null when condition is EXISTS; should be a valid CIDR if provided and if type is SOURCE_IP.
    type String
    [string] Type of the Http Rule condition.
    condition String
    [string] Matching rule for the HTTP rule condition attribute; mandatory for HEADER, PATH, QUERY, METHOD, HOST, and COOKIE types; must be null when type is SOURCE_IP.
    key String
    [string] Must be null when type is PATH, METHOD, HOST, or SOURCE_IP. Key can only be set when type is COOKIES, HEADER, or QUERY.
    negate Boolean
    [bool] Specifies whether the condition is negated or not; the default is False.
    value String
    [string] Mandatory for conditions CONTAINS, EQUALS, MATCHES, STARTS_WITH, ENDS_WITH; must be null when condition is EXISTS; should be a valid CIDR if provided and if type is SOURCE_IP.

    Import

    Resource Application Load Balancer Forwarding Rule can be imported using the resource id, alb id and datacenter id, e.g.

    $ pulumi import ionoscloud:alb/forwardingRule:ForwardingRule my_application_loadbalancer_forwardingrule datacenter uuid/application_loadbalancer uuid/application_loadbalancer_forwardingrule uuid
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    ionoscloud ionos-cloud/pulumi-ionoscloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    IonosCloud v0.2.2 published on Monday, May 12, 2025 by ionos-cloud