IngressArgs

data class IngressArgs(val certId: Output<String>? = null, val certIds: Output<String>? = null, val defaultRule: Output<IngressDefaultRuleArgs>? = null, val description: Output<String>? = null, val listenerPort: Output<Int>? = null, val listenerProtocol: Output<String>? = null, val loadBalanceType: Output<String>? = null, val namespaceId: Output<String>? = null, val rules: Output<List<IngressRuleArgs>>? = null, val slbId: Output<String>? = null) : ConvertibleToJava<IngressArgs>

Provides a Serverless App Engine (SAE) Ingress resource. For information about Serverless App Engine (SAE) Ingress and how to use it, see What is Ingress.

NOTE: Available since v1.137.0.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetRegionsArgs;
import com.pulumi.random.RandomInteger;
import com.pulumi.random.RandomIntegerArgs;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.sae.Namespace;
import com.pulumi.alicloud.sae.NamespaceArgs;
import com.pulumi.alicloud.sae.Application;
import com.pulumi.alicloud.sae.ApplicationArgs;
import com.pulumi.alicloud.slb.ApplicationLoadBalancer;
import com.pulumi.alicloud.slb.ApplicationLoadBalancerArgs;
import com.pulumi.alicloud.sae.Ingress;
import com.pulumi.alicloud.sae.IngressArgs;
import com.pulumi.alicloud.sae.inputs.IngressRuleArgs;
import com.pulumi.alicloud.sae.inputs.IngressDefaultRuleArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("tf-example");
final var defaultRegions = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
.current(true)
.build());
var defaultRandomInteger = new RandomInteger("defaultRandomInteger", RandomIntegerArgs.builder()
.max(99999)
.min(10000)
.build());
final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("10.4.0.0/16")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vswitchName(name)
.cidrBlock("10.4.0.0/24")
.vpcId(defaultNetwork.id())
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.build());
var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
.vpcId(defaultNetwork.id())
.build());
var defaultNamespace = new Namespace("defaultNamespace", NamespaceArgs.builder()
.namespaceId(defaultRandomInteger.result().applyValue(result -> String.format("%s:example%s", defaultRegions.applyValue(getRegionsResult -> getRegionsResult.regions()[0].id()),result)))
.namespaceName(name)
.namespaceDescription(name)
.enableMicroRegistration(false)
.build());
var defaultApplication = new Application("defaultApplication", ApplicationArgs.builder()
.appDescription(name)
.appName(name)
.namespaceId(defaultNamespace.id())
.imageUrl(String.format("registry-vpc.%s.aliyuncs.com/sae-demo-image/consumer:1.0", defaultRegions.applyValue(getRegionsResult -> getRegionsResult.regions()[0].id())))
.packageType("Image")
.securityGroupId(defaultSecurityGroup.id())
.vpcId(defaultNetwork.id())
.vswitchId(defaultSwitch.id())
.timezone("Asia/Beijing")
.replicas("5")
.cpu("500")
.memory("2048")
.build());
var defaultApplicationLoadBalancer = new ApplicationLoadBalancer("defaultApplicationLoadBalancer", ApplicationLoadBalancerArgs.builder()
.loadBalancerName(name)
.vswitchId(defaultSwitch.id())
.loadBalancerSpec("slb.s2.small")
.addressType("intranet")
.build());
var defaultIngress = new Ingress("defaultIngress", IngressArgs.builder()
.slbId(defaultApplicationLoadBalancer.id())
.namespaceId(defaultNamespace.id())
.listenerPort("80")
.rules(IngressRuleArgs.builder()
.appId(defaultApplication.id())
.containerPort("443")
.domain("www.alicloud.com")
.appName(defaultApplication.appName())
.path("/")
.build())
.defaultRule(IngressDefaultRuleArgs.builder()
.appId(defaultApplication.id())
.containerPort("443")
.build())
.build());
}
}

Import

Serverless App Engine (SAE) Ingress can be imported using the id, e.g.

$ pulumi import alicloud:sae/ingress:Ingress example <id>

Constructors

Link copied to clipboard
fun IngressArgs(certId: Output<String>? = null, certIds: Output<String>? = null, defaultRule: Output<IngressDefaultRuleArgs>? = null, description: Output<String>? = null, listenerPort: Output<Int>? = null, listenerProtocol: Output<String>? = null, loadBalanceType: Output<String>? = null, namespaceId: Output<String>? = null, rules: Output<List<IngressRuleArgs>>? = null, slbId: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): IngressArgs

Properties

Link copied to clipboard
val certId: Output<String>? = null

The certificate ID of the HTTPS listener. The cert_id takes effect only when load_balance_type is set to clb.

Link copied to clipboard
val certIds: Output<String>? = null

The certificate IDs of the HTTPS listener, and multiple certificate IDs are separated by commas. The cert_ids takes effect only when load_balance_type is set to alb.

Link copied to clipboard
val defaultRule: Output<IngressDefaultRuleArgs>? = null

Default Rule. See default_rule below.

Link copied to clipboard
val description: Output<String>? = null

Description.

Link copied to clipboard
val listenerPort: Output<Int>? = null

SLB listening port.

Link copied to clipboard
val listenerProtocol: Output<String>? = null

The protocol that is used to forward requests. Default value: HTTP. Valid values: HTTP, HTTPS.

Link copied to clipboard
val loadBalanceType: Output<String>? = null

The type of the SLB instance. Default value: clb. Valid values: clb, alb.

Link copied to clipboard
val namespaceId: Output<String>? = null

The ID of Namespace. It can contain 2 to 32 lowercase characters.The value is in format {RegionId}:{namespace}.

Link copied to clipboard
val rules: Output<List<IngressRuleArgs>>? = null

Forwarding rules. Forward traffic to the specified application according to the domain name and path. See rules below.

Link copied to clipboard
val slbId: Output<String>? = null

SLB ID.