1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. simpleapplicationserver
  5. getServerFirewallRules
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.simpleapplicationserver.getServerFirewallRules

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

    This data source provides the Simple Application Server Firewall Rules of the current Alibaba Cloud user.

    NOTE: Available in v1.143.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.simpleapplicationserver.getServerFirewallRules({
        instanceId: "example_value",
        ids: [
            "example_value-1",
            "example_value-2",
        ],
    });
    export const simpleApplicationServerFirewallRuleId1 = ids.then(ids => ids.rules?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.simpleapplicationserver.get_server_firewall_rules(instance_id="example_value",
        ids=[
            "example_value-1",
            "example_value-2",
        ])
    pulumi.export("simpleApplicationServerFirewallRuleId1", ids.rules[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/simpleapplicationserver"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := simpleapplicationserver.GetServerFirewallRules(ctx, &simpleapplicationserver.GetServerFirewallRulesArgs{
    			InstanceId: "example_value",
    			Ids: []string{
    				"example_value-1",
    				"example_value-2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("simpleApplicationServerFirewallRuleId1", ids.Rules[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.SimpleApplicationServer.GetServerFirewallRules.Invoke(new()
        {
            InstanceId = "example_value",
            Ids = new[]
            {
                "example_value-1",
                "example_value-2",
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["simpleApplicationServerFirewallRuleId1"] = ids.Apply(getServerFirewallRulesResult => getServerFirewallRulesResult.Rules[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.simpleapplicationserver.SimpleapplicationserverFunctions;
    import com.pulumi.alicloud.simpleapplicationserver.inputs.GetServerFirewallRulesArgs;
    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 ids = SimpleapplicationserverFunctions.getServerFirewallRules(GetServerFirewallRulesArgs.builder()
                .instanceId("example_value")
                .ids(            
                    "example_value-1",
                    "example_value-2")
                .build());
    
            ctx.export("simpleApplicationServerFirewallRuleId1", ids.applyValue(getServerFirewallRulesResult -> getServerFirewallRulesResult.rules()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:simpleapplicationserver:getServerFirewallRules
          Arguments:
            instanceId: example_value
            ids:
              - example_value-1
              - example_value-2
    outputs:
      simpleApplicationServerFirewallRuleId1: ${ids.rules[0].id}
    

    Using getServerFirewallRules

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getServerFirewallRules(args: GetServerFirewallRulesArgs, opts?: InvokeOptions): Promise<GetServerFirewallRulesResult>
    function getServerFirewallRulesOutput(args: GetServerFirewallRulesOutputArgs, opts?: InvokeOptions): Output<GetServerFirewallRulesResult>
    def get_server_firewall_rules(ids: Optional[Sequence[str]] = None,
                                  instance_id: Optional[str] = None,
                                  output_file: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetServerFirewallRulesResult
    def get_server_firewall_rules_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                  instance_id: Optional[pulumi.Input[str]] = None,
                                  output_file: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetServerFirewallRulesResult]
    func GetServerFirewallRules(ctx *Context, args *GetServerFirewallRulesArgs, opts ...InvokeOption) (*GetServerFirewallRulesResult, error)
    func GetServerFirewallRulesOutput(ctx *Context, args *GetServerFirewallRulesOutputArgs, opts ...InvokeOption) GetServerFirewallRulesResultOutput

    > Note: This function is named GetServerFirewallRules in the Go SDK.

    public static class GetServerFirewallRules 
    {
        public static Task<GetServerFirewallRulesResult> InvokeAsync(GetServerFirewallRulesArgs args, InvokeOptions? opts = null)
        public static Output<GetServerFirewallRulesResult> Invoke(GetServerFirewallRulesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetServerFirewallRulesResult> getServerFirewallRules(GetServerFirewallRulesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:simpleapplicationserver/getServerFirewallRules:getServerFirewallRules
      arguments:
        # arguments dictionary

    The following arguments are supported:

    InstanceId string
    Alibaba Cloud simple application server instance ID.
    Ids List<string>
    A list of Firewall Rule IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    InstanceId string
    Alibaba Cloud simple application server instance ID.
    Ids []string
    A list of Firewall Rule IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    instanceId String
    Alibaba Cloud simple application server instance ID.
    ids List<String>
    A list of Firewall Rule IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    instanceId string
    Alibaba Cloud simple application server instance ID.
    ids string[]
    A list of Firewall Rule IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    instance_id str
    Alibaba Cloud simple application server instance ID.
    ids Sequence[str]
    A list of Firewall Rule IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    instanceId String
    Alibaba Cloud simple application server instance ID.
    ids List<String>
    A list of Firewall Rule IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getServerFirewallRules Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    InstanceId string
    Rules List<Pulumi.AliCloud.SimpleApplicationServer.Outputs.GetServerFirewallRulesRule>
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    InstanceId string
    Rules []GetServerFirewallRulesRule
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instanceId String
    rules List<GetServerFirewallRulesRule>
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    instanceId string
    rules GetServerFirewallRulesRule[]
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    instance_id str
    rules Sequence[GetServerFirewallRulesRule]
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instanceId String
    rules List<Property Map>
    outputFile String

    Supporting Types

    GetServerFirewallRulesRule

    FirewallRuleId string
    The ID of the firewall rule.
    Id string
    The ID of the Firewall Rule. The value formats as <instance_id>:<firewall_rule_id>.
    InstanceId string
    Alibaba Cloud simple application server instance ID.
    Port string
    The port range of the firewall rule.
    Remark string
    The remarks of the firewall rule.
    RuleProtocol string
    The transport layer protocol. Valid values: Tcp, Udp, TcpAndUdp.
    FirewallRuleId string
    The ID of the firewall rule.
    Id string
    The ID of the Firewall Rule. The value formats as <instance_id>:<firewall_rule_id>.
    InstanceId string
    Alibaba Cloud simple application server instance ID.
    Port string
    The port range of the firewall rule.
    Remark string
    The remarks of the firewall rule.
    RuleProtocol string
    The transport layer protocol. Valid values: Tcp, Udp, TcpAndUdp.
    firewallRuleId String
    The ID of the firewall rule.
    id String
    The ID of the Firewall Rule. The value formats as <instance_id>:<firewall_rule_id>.
    instanceId String
    Alibaba Cloud simple application server instance ID.
    port String
    The port range of the firewall rule.
    remark String
    The remarks of the firewall rule.
    ruleProtocol String
    The transport layer protocol. Valid values: Tcp, Udp, TcpAndUdp.
    firewallRuleId string
    The ID of the firewall rule.
    id string
    The ID of the Firewall Rule. The value formats as <instance_id>:<firewall_rule_id>.
    instanceId string
    Alibaba Cloud simple application server instance ID.
    port string
    The port range of the firewall rule.
    remark string
    The remarks of the firewall rule.
    ruleProtocol string
    The transport layer protocol. Valid values: Tcp, Udp, TcpAndUdp.
    firewall_rule_id str
    The ID of the firewall rule.
    id str
    The ID of the Firewall Rule. The value formats as <instance_id>:<firewall_rule_id>.
    instance_id str
    Alibaba Cloud simple application server instance ID.
    port str
    The port range of the firewall rule.
    remark str
    The remarks of the firewall rule.
    rule_protocol str
    The transport layer protocol. Valid values: Tcp, Udp, TcpAndUdp.
    firewallRuleId String
    The ID of the firewall rule.
    id String
    The ID of the Firewall Rule. The value formats as <instance_id>:<firewall_rule_id>.
    instanceId String
    Alibaba Cloud simple application server instance ID.
    port String
    The port range of the firewall rule.
    remark String
    The remarks of the firewall rule.
    ruleProtocol String
    The transport layer protocol. Valid values: Tcp, Udp, TcpAndUdp.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi