Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi
alicloud.simpleapplicationserver.getServerFirewallRules
Explore with Pulumi AI
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 dictionaryThe following arguments are supported:
- Instance
Id string - Alibaba Cloud simple application server instance ID.
 - Ids List<string>
 - A list of Firewall Rule IDs.
 - Output
File string - File name where to save data source results (after running 
pulumi preview). 
- Instance
Id string - Alibaba Cloud simple application server instance ID.
 - Ids []string
 - A list of Firewall Rule IDs.
 - Output
File string - File name where to save data source results (after running 
pulumi preview). 
- instance
Id String - Alibaba Cloud simple application server instance ID.
 - ids List<String>
 - A list of Firewall Rule IDs.
 - output
File String - File name where to save data source results (after running 
pulumi preview). 
- instance
Id string - Alibaba Cloud simple application server instance ID.
 - ids string[]
 - A list of Firewall Rule IDs.
 - output
File 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). 
- instance
Id String - Alibaba Cloud simple application server instance ID.
 - ids List<String>
 - A list of Firewall Rule IDs.
 - output
File 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>
 - Instance
Id string - Rules
List<Pulumi.
Ali Cloud. Simple Application Server. Outputs. Get Server Firewall Rules Rule>  - Output
File string 
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Ids []string
 - Instance
Id string - Rules
[]Get
Server Firewall Rules Rule  - Output
File string 
- id String
 - The provider-assigned unique ID for this managed resource.
 - ids List<String>
 - instance
Id String - rules
List<Get
Server Firewall Rules Rule>  - output
File String 
- id string
 - The provider-assigned unique ID for this managed resource.
 - ids string[]
 - instance
Id string - rules
Get
Server Firewall Rules Rule[]  - output
File string 
- id str
 - The provider-assigned unique ID for this managed resource.
 - ids Sequence[str]
 - instance_
id str - rules
Sequence[Get
Server Firewall Rules Rule]  - output_
file str 
- id String
 - The provider-assigned unique ID for this managed resource.
 - ids List<String>
 - instance
Id String - rules List<Property Map>
 - output
File String 
Supporting Types
GetServerFirewallRulesRule    
- Firewall
Rule stringId  - The ID of the firewall rule.
 - Id string
 - The ID of the Firewall Rule. The value formats as 
<instance_id>:<firewall_rule_id>. - Instance
Id 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.
 - Rule
Protocol string - The transport layer protocol. Valid values: 
Tcp,Udp,TcpAndUdp. 
- Firewall
Rule stringId  - The ID of the firewall rule.
 - Id string
 - The ID of the Firewall Rule. The value formats as 
<instance_id>:<firewall_rule_id>. - Instance
Id 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.
 - Rule
Protocol string - The transport layer protocol. Valid values: 
Tcp,Udp,TcpAndUdp. 
- firewall
Rule StringId  - The ID of the firewall rule.
 - id String
 - The ID of the Firewall Rule. The value formats as 
<instance_id>:<firewall_rule_id>. - instance
Id 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.
 - rule
Protocol String - The transport layer protocol. Valid values: 
Tcp,Udp,TcpAndUdp. 
- firewall
Rule stringId  - The ID of the firewall rule.
 - id string
 - The ID of the Firewall Rule. The value formats as 
<instance_id>:<firewall_rule_id>. - instance
Id 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.
 - rule
Protocol string - The transport layer protocol. Valid values: 
Tcp,Udp,TcpAndUdp. 
- firewall_
rule_ strid  - 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. 
- firewall
Rule StringId  - The ID of the firewall rule.
 - id String
 - The ID of the Firewall Rule. The value formats as 
<instance_id>:<firewall_rule_id>. - instance
Id 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.
 - rule
Protocol 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 
alicloudTerraform Provider.