Class Ingress


  • public class Ingress
    extends com.pulumi.resources.CustomResource
    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](https://www.alibabacloud.com/help/en/sae/latest/createingress). > **NOTE:** Available since v1.137.0. ## Example Usage Basic Usage ```java 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. ```sh $ pulumi import alicloud:sae/ingress:Ingress example <id> ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Ingress​(java.lang.String name)  
      Ingress​(java.lang.String name, IngressArgs args)  
      Ingress​(java.lang.String name, IngressArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> certId()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> certIds()  
      com.pulumi.core.Output<java.util.Optional<IngressDefaultRule>> defaultRule()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()  
      static Ingress get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, IngressState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.Integer> listenerPort()  
      com.pulumi.core.Output<java.lang.String> listenerProtocol()  
      com.pulumi.core.Output<java.lang.String> loadBalanceType()  
      com.pulumi.core.Output<java.lang.String> namespaceId()  
      com.pulumi.core.Output<java.util.List<IngressRule>> rules()  
      com.pulumi.core.Output<java.lang.String> slbId()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Ingress

        public Ingress​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Ingress

        public Ingress​(java.lang.String name,
                       IngressArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Ingress

        public Ingress​(java.lang.String name,
                       IngressArgs args,
                       @Nullable
                       com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • certId

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> certId()
        Returns:
        The certificate ID of the HTTPS listener. The `cert_id` takes effect only when `load_balance_type` is set to `clb`.
      • certIds

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> certIds()
        Returns:
        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`.
      • defaultRule

        public com.pulumi.core.Output<java.util.Optional<IngressDefaultRule>> defaultRule()
        Returns:
        Default Rule. See `default_rule` below.
      • description

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
        Returns:
        Description.
      • listenerPort

        public com.pulumi.core.Output<java.lang.Integer> listenerPort()
        Returns:
        SLB listening port.
      • listenerProtocol

        public com.pulumi.core.Output<java.lang.String> listenerProtocol()
        Returns:
        The protocol that is used to forward requests. Default value: `HTTP`. Valid values: `HTTP`, `HTTPS`.
      • loadBalanceType

        public com.pulumi.core.Output<java.lang.String> loadBalanceType()
        Returns:
        The type of the SLB instance. Default value: `clb`. Valid values: `clb`, `alb`.
      • namespaceId

        public com.pulumi.core.Output<java.lang.String> namespaceId()
        Returns:
        The ID of Namespace. It can contain 2 to 32 lowercase characters.The value is in format `{RegionId}:{namespace}`.
      • rules

        public com.pulumi.core.Output<java.util.List<IngressRule>> rules()
        Returns:
        Forwarding rules. Forward traffic to the specified application according to the domain name and path. See `rules` below.
      • slbId

        public com.pulumi.core.Output<java.lang.String> slbId()
        Returns:
        SLB ID.
      • get

        public static Ingress get​(java.lang.String name,
                                  com.pulumi.core.Output<java.lang.String> id,
                                  @Nullable
                                  IngressState state,
                                  @Nullable
                                  com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.