1. Packages
  2. Alicloud Provider
  3. API Docs
  4. vpc
  5. getNetworkAcls
Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi

alicloud.vpc.getNetworkAcls

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi

    This data source provides the Network Acls of the current Alibaba Cloud user.

    NOTE: Available in v1.122.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = alicloud.vpc.getNetworkAcls({
        ids: ["example_value"],
        nameRegex: "the_resource_name",
    });
    export const firstNetworkAclId = example.then(example => example.acls?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.vpc.get_network_acls(ids=["example_value"],
        name_regex="the_resource_name")
    pulumi.export("firstNetworkAclId", example.acls[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := vpc.GetNetworkAcls(ctx, &vpc.GetNetworkAclsArgs{
    			Ids: []string{
    				"example_value",
    			},
    			NameRegex: pulumi.StringRef("the_resource_name"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstNetworkAclId", example.Acls[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AliCloud.Vpc.GetNetworkAcls.Invoke(new()
        {
            Ids = new[]
            {
                "example_value",
            },
            NameRegex = "the_resource_name",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstNetworkAclId"] = example.Apply(getNetworkAclsResult => getNetworkAclsResult.Acls[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.vpc.VpcFunctions;
    import com.pulumi.alicloud.vpc.inputs.GetNetworkAclsArgs;
    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 example = VpcFunctions.getNetworkAcls(GetNetworkAclsArgs.builder()
                .ids("example_value")
                .nameRegex("the_resource_name")
                .build());
    
            ctx.export("firstNetworkAclId", example.applyValue(getNetworkAclsResult -> getNetworkAclsResult.acls()[0].id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: alicloud:vpc:getNetworkAcls
          Arguments:
            ids:
              - example_value
            nameRegex: the_resource_name
    outputs:
      firstNetworkAclId: ${example.acls[0].id}
    

    Using getNetworkAcls

    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 getNetworkAcls(args: GetNetworkAclsArgs, opts?: InvokeOptions): Promise<GetNetworkAclsResult>
    function getNetworkAclsOutput(args: GetNetworkAclsOutputArgs, opts?: InvokeOptions): Output<GetNetworkAclsResult>
    def get_network_acls(ids: Optional[Sequence[str]] = None,
                         name_regex: Optional[str] = None,
                         network_acl_name: Optional[str] = None,
                         output_file: Optional[str] = None,
                         resource_id: Optional[str] = None,
                         resource_type: Optional[str] = None,
                         status: Optional[str] = None,
                         vpc_id: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetNetworkAclsResult
    def get_network_acls_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                         name_regex: Optional[pulumi.Input[str]] = None,
                         network_acl_name: Optional[pulumi.Input[str]] = None,
                         output_file: Optional[pulumi.Input[str]] = None,
                         resource_id: Optional[pulumi.Input[str]] = None,
                         resource_type: Optional[pulumi.Input[str]] = None,
                         status: Optional[pulumi.Input[str]] = None,
                         vpc_id: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetNetworkAclsResult]
    func GetNetworkAcls(ctx *Context, args *GetNetworkAclsArgs, opts ...InvokeOption) (*GetNetworkAclsResult, error)
    func GetNetworkAclsOutput(ctx *Context, args *GetNetworkAclsOutputArgs, opts ...InvokeOption) GetNetworkAclsResultOutput

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

    public static class GetNetworkAcls 
    {
        public static Task<GetNetworkAclsResult> InvokeAsync(GetNetworkAclsArgs args, InvokeOptions? opts = null)
        public static Output<GetNetworkAclsResult> Invoke(GetNetworkAclsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNetworkAclsResult> getNetworkAcls(GetNetworkAclsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:vpc/getNetworkAcls:getNetworkAcls
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Network Acl ID.
    NameRegex string
    A regex string to filter results by Network Acl name.
    NetworkAclName string
    The name of the network ACL.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ResourceId string
    The ID of the associated resource.
    ResourceType string
    The type of the associated resource. Valid values VSwitch. resource_type and resource_id need to be specified at the same time to take effect.
    Status string
    The state of the network ACL. Valid values: Available and Modifying.
    VpcId string
    The ID of the associated VPC.
    Ids []string
    A list of Network Acl ID.
    NameRegex string
    A regex string to filter results by Network Acl name.
    NetworkAclName string
    The name of the network ACL.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ResourceId string
    The ID of the associated resource.
    ResourceType string
    The type of the associated resource. Valid values VSwitch. resource_type and resource_id need to be specified at the same time to take effect.
    Status string
    The state of the network ACL. Valid values: Available and Modifying.
    VpcId string
    The ID of the associated VPC.
    ids List<String>
    A list of Network Acl ID.
    nameRegex String
    A regex string to filter results by Network Acl name.
    networkAclName String
    The name of the network ACL.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    resourceId String
    The ID of the associated resource.
    resourceType String
    The type of the associated resource. Valid values VSwitch. resource_type and resource_id need to be specified at the same time to take effect.
    status String
    The state of the network ACL. Valid values: Available and Modifying.
    vpcId String
    The ID of the associated VPC.
    ids string[]
    A list of Network Acl ID.
    nameRegex string
    A regex string to filter results by Network Acl name.
    networkAclName string
    The name of the network ACL.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    resourceId string
    The ID of the associated resource.
    resourceType string
    The type of the associated resource. Valid values VSwitch. resource_type and resource_id need to be specified at the same time to take effect.
    status string
    The state of the network ACL. Valid values: Available and Modifying.
    vpcId string
    The ID of the associated VPC.
    ids Sequence[str]
    A list of Network Acl ID.
    name_regex str
    A regex string to filter results by Network Acl name.
    network_acl_name str
    The name of the network ACL.
    output_file str
    File name where to save data source results (after running pulumi preview).
    resource_id str
    The ID of the associated resource.
    resource_type str
    The type of the associated resource. Valid values VSwitch. resource_type and resource_id need to be specified at the same time to take effect.
    status str
    The state of the network ACL. Valid values: Available and Modifying.
    vpc_id str
    The ID of the associated VPC.
    ids List<String>
    A list of Network Acl ID.
    nameRegex String
    A regex string to filter results by Network Acl name.
    networkAclName String
    The name of the network ACL.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    resourceId String
    The ID of the associated resource.
    resourceType String
    The type of the associated resource. Valid values VSwitch. resource_type and resource_id need to be specified at the same time to take effect.
    status String
    The state of the network ACL. Valid values: Available and Modifying.
    vpcId String
    The ID of the associated VPC.

    getNetworkAcls Result

    The following output properties are available:

    Acls List<Pulumi.AliCloud.Vpc.Outputs.GetNetworkAclsAcl>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    NameRegex string
    NetworkAclName string
    OutputFile string
    ResourceId string
    ResourceType string
    Status string
    VpcId string
    Acls []GetNetworkAclsAcl
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    NameRegex string
    NetworkAclName string
    OutputFile string
    ResourceId string
    ResourceType string
    Status string
    VpcId string
    acls List<GetNetworkAclsAcl>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    nameRegex String
    networkAclName String
    outputFile String
    resourceId String
    resourceType String
    status String
    vpcId String
    acls GetNetworkAclsAcl[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    nameRegex string
    networkAclName string
    outputFile string
    resourceId string
    resourceType string
    status string
    vpcId string
    acls Sequence[GetNetworkAclsAcl]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    name_regex str
    network_acl_name str
    output_file str
    resource_id str
    resource_type str
    status str
    vpc_id str
    acls List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    nameRegex String
    networkAclName String
    outputFile String
    resourceId String
    resourceType String
    status String
    vpcId String

    Supporting Types

    GetNetworkAclsAcl

    Description string
    Description of network ACL information.
    EgressAclEntries List<Pulumi.AliCloud.Vpc.Inputs.GetNetworkAclsAclEgressAclEntry>
    Output direction rule information.
    Id string
    The ID of the Network Acl.
    IngressAclEntries List<Pulumi.AliCloud.Vpc.Inputs.GetNetworkAclsAclIngressAclEntry>
    Entry direction rule information.
    NetworkAclId string
    The first ID of the resource.
    NetworkAclName string
    The name of the network ACL.
    Resources List<Pulumi.AliCloud.Vpc.Inputs.GetNetworkAclsAclResource>
    The associated resource.
    Status string
    The state of the network ACL.
    VpcId string
    The ID of the associated VPC.
    Description string
    Description of network ACL information.
    EgressAclEntries []GetNetworkAclsAclEgressAclEntry
    Output direction rule information.
    Id string
    The ID of the Network Acl.
    IngressAclEntries []GetNetworkAclsAclIngressAclEntry
    Entry direction rule information.
    NetworkAclId string
    The first ID of the resource.
    NetworkAclName string
    The name of the network ACL.
    Resources []GetNetworkAclsAclResource
    The associated resource.
    Status string
    The state of the network ACL.
    VpcId string
    The ID of the associated VPC.
    description String
    Description of network ACL information.
    egressAclEntries List<GetNetworkAclsAclEgressAclEntry>
    Output direction rule information.
    id String
    The ID of the Network Acl.
    ingressAclEntries List<GetNetworkAclsAclIngressAclEntry>
    Entry direction rule information.
    networkAclId String
    The first ID of the resource.
    networkAclName String
    The name of the network ACL.
    resources List<GetNetworkAclsAclResource>
    The associated resource.
    status String
    The state of the network ACL.
    vpcId String
    The ID of the associated VPC.
    description string
    Description of network ACL information.
    egressAclEntries GetNetworkAclsAclEgressAclEntry[]
    Output direction rule information.
    id string
    The ID of the Network Acl.
    ingressAclEntries GetNetworkAclsAclIngressAclEntry[]
    Entry direction rule information.
    networkAclId string
    The first ID of the resource.
    networkAclName string
    The name of the network ACL.
    resources GetNetworkAclsAclResource[]
    The associated resource.
    status string
    The state of the network ACL.
    vpcId string
    The ID of the associated VPC.
    description str
    Description of network ACL information.
    egress_acl_entries Sequence[GetNetworkAclsAclEgressAclEntry]
    Output direction rule information.
    id str
    The ID of the Network Acl.
    ingress_acl_entries Sequence[GetNetworkAclsAclIngressAclEntry]
    Entry direction rule information.
    network_acl_id str
    The first ID of the resource.
    network_acl_name str
    The name of the network ACL.
    resources Sequence[GetNetworkAclsAclResource]
    The associated resource.
    status str
    The state of the network ACL.
    vpc_id str
    The ID of the associated VPC.
    description String
    Description of network ACL information.
    egressAclEntries List<Property Map>
    Output direction rule information.
    id String
    The ID of the Network Acl.
    ingressAclEntries List<Property Map>
    Entry direction rule information.
    networkAclId String
    The first ID of the resource.
    networkAclName String
    The name of the network ACL.
    resources List<Property Map>
    The associated resource.
    status String
    The state of the network ACL.
    vpcId String
    The ID of the associated VPC.

    GetNetworkAclsAclEgressAclEntry

    Description string
    Give the description information of the direction rule.
    DestinationCidrIp string
    The destination address segment.
    NetworkAclEntryName string
    The name of the entry for the direction rule.
    Policy string
    The authorization policy.
    Port string
    Destination port range.
    Protocol string
    Transport layer protocol.
    Description string
    Give the description information of the direction rule.
    DestinationCidrIp string
    The destination address segment.
    NetworkAclEntryName string
    The name of the entry for the direction rule.
    Policy string
    The authorization policy.
    Port string
    Destination port range.
    Protocol string
    Transport layer protocol.
    description String
    Give the description information of the direction rule.
    destinationCidrIp String
    The destination address segment.
    networkAclEntryName String
    The name of the entry for the direction rule.
    policy String
    The authorization policy.
    port String
    Destination port range.
    protocol String
    Transport layer protocol.
    description string
    Give the description information of the direction rule.
    destinationCidrIp string
    The destination address segment.
    networkAclEntryName string
    The name of the entry for the direction rule.
    policy string
    The authorization policy.
    port string
    Destination port range.
    protocol string
    Transport layer protocol.
    description str
    Give the description information of the direction rule.
    destination_cidr_ip str
    The destination address segment.
    network_acl_entry_name str
    The name of the entry for the direction rule.
    policy str
    The authorization policy.
    port str
    Destination port range.
    protocol str
    Transport layer protocol.
    description String
    Give the description information of the direction rule.
    destinationCidrIp String
    The destination address segment.
    networkAclEntryName String
    The name of the entry for the direction rule.
    policy String
    The authorization policy.
    port String
    Destination port range.
    protocol String
    Transport layer protocol.

    GetNetworkAclsAclIngressAclEntry

    Description string
    Description of the entry direction rule.
    NetworkAclEntryName string
    The name of the entry direction rule entry.
    Policy string
    The authorization policy.
    Port string
    Source port range.
    Protocol string
    Transport layer protocol.
    SourceCidrIp string
    The source address field.
    Description string
    Description of the entry direction rule.
    NetworkAclEntryName string
    The name of the entry direction rule entry.
    Policy string
    The authorization policy.
    Port string
    Source port range.
    Protocol string
    Transport layer protocol.
    SourceCidrIp string
    The source address field.
    description String
    Description of the entry direction rule.
    networkAclEntryName String
    The name of the entry direction rule entry.
    policy String
    The authorization policy.
    port String
    Source port range.
    protocol String
    Transport layer protocol.
    sourceCidrIp String
    The source address field.
    description string
    Description of the entry direction rule.
    networkAclEntryName string
    The name of the entry direction rule entry.
    policy string
    The authorization policy.
    port string
    Source port range.
    protocol string
    Transport layer protocol.
    sourceCidrIp string
    The source address field.
    description str
    Description of the entry direction rule.
    network_acl_entry_name str
    The name of the entry direction rule entry.
    policy str
    The authorization policy.
    port str
    Source port range.
    protocol str
    Transport layer protocol.
    source_cidr_ip str
    The source address field.
    description String
    Description of the entry direction rule.
    networkAclEntryName String
    The name of the entry direction rule entry.
    policy String
    The authorization policy.
    port String
    Source port range.
    protocol String
    Transport layer protocol.
    sourceCidrIp String
    The source address field.

    GetNetworkAclsAclResource

    ResourceId string
    The ID of the associated resource.
    ResourceType string
    The type of the associated resource.
    Status string
    The state of the associated resource.
    ResourceId string
    The ID of the associated resource.
    ResourceType string
    The type of the associated resource.
    Status string
    The state of the associated resource.
    resourceId String
    The ID of the associated resource.
    resourceType String
    The type of the associated resource.
    status String
    The state of the associated resource.
    resourceId string
    The ID of the associated resource.
    resourceType string
    The type of the associated resource.
    status string
    The state of the associated resource.
    resource_id str
    The ID of the associated resource.
    resource_type str
    The type of the associated resource.
    status str
    The state of the associated resource.
    resourceId String
    The ID of the associated resource.
    resourceType String
    The type of the associated resource.
    status String
    The state of the associated resource.

    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.63.0 published on Monday, Sep 30, 2024 by Pulumi