1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ecs
  5. getSecurityGroups
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

alicloud.ecs.getSecurityGroups

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

    This data source provides a list of Security Groups in an Alibaba Cloud account according to the specified filters.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const secGroupsDs = alicloud.ecs.getSecurityGroups({
        nameRegex: "^web-",
        outputFile: "web_access.json",
    });
    // In conjunction with a VPC
    const primaryVpcDs = new alicloud.vpc.Network("primaryVpcDs", {});
    const primarySecGroupsDs = alicloud.ecs.getSecurityGroupsOutput({
        vpcId: primaryVpcDs.id,
    });
    export const firstGroupId = primarySecGroupsDs.apply(primarySecGroupsDs => primarySecGroupsDs.groups?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    sec_groups_ds = alicloud.ecs.get_security_groups(name_regex="^web-",
        output_file="web_access.json")
    # In conjunction with a VPC
    primary_vpc_ds = alicloud.vpc.Network("primaryVpcDs")
    primary_sec_groups_ds = alicloud.ecs.get_security_groups_output(vpc_id=primary_vpc_ds.id)
    pulumi.export("firstGroupId", primary_sec_groups_ds.groups[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"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 {
    		_, err := ecs.GetSecurityGroups(ctx, &ecs.GetSecurityGroupsArgs{
    			NameRegex:  pulumi.StringRef("^web-"),
    			OutputFile: pulumi.StringRef("web_access.json"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// In conjunction with a VPC
    		primaryVpcDs, err := vpc.NewNetwork(ctx, "primaryVpcDs", nil)
    		if err != nil {
    			return err
    		}
    		primarySecGroupsDs := ecs.GetSecurityGroupsOutput(ctx, ecs.GetSecurityGroupsOutputArgs{
    			VpcId: primaryVpcDs.ID(),
    		}, nil)
    		ctx.Export("firstGroupId", primarySecGroupsDs.ApplyT(func(primarySecGroupsDs ecs.GetSecurityGroupsResult) (*string, error) {
    			return &primarySecGroupsDs.Groups[0].Id, nil
    		}).(pulumi.StringPtrOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var secGroupsDs = AliCloud.Ecs.GetSecurityGroups.Invoke(new()
        {
            NameRegex = "^web-",
            OutputFile = "web_access.json",
        });
    
        // In conjunction with a VPC
        var primaryVpcDs = new AliCloud.Vpc.Network("primaryVpcDs");
    
        var primarySecGroupsDs = AliCloud.Ecs.GetSecurityGroups.Invoke(new()
        {
            VpcId = primaryVpcDs.Id,
        });
    
        return new Dictionary<string, object?>
        {
            ["firstGroupId"] = primarySecGroupsDs.Apply(getSecurityGroupsResult => getSecurityGroupsResult.Groups[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetSecurityGroupsArgs;
    import com.pulumi.alicloud.vpc.Network;
    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 secGroupsDs = EcsFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
                .nameRegex("^web-")
                .outputFile("web_access.json")
                .build());
    
            // In conjunction with a VPC
            var primaryVpcDs = new Network("primaryVpcDs");
    
            final var primarySecGroupsDs = EcsFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
                .vpcId(primaryVpcDs.id())
                .build());
    
            ctx.export("firstGroupId", primarySecGroupsDs.applyValue(getSecurityGroupsResult -> getSecurityGroupsResult).applyValue(primarySecGroupsDs -> primarySecGroupsDs.applyValue(getSecurityGroupsResult -> getSecurityGroupsResult.groups()[0].id())));
        }
    }
    
    resources:
      # In conjunction with a VPC
      primaryVpcDs:
        type: alicloud:vpc:Network
    variables:
      secGroupsDs:
        fn::invoke:
          Function: alicloud:ecs:getSecurityGroups
          Arguments:
            nameRegex: ^web-
            outputFile: web_access.json
      primarySecGroupsDs:
        fn::invoke:
          Function: alicloud:ecs:getSecurityGroups
          Arguments:
            vpcId: ${primaryVpcDs.id}
    outputs:
      firstGroupId: ${primarySecGroupsDs.groups[0].id}
    

    Using getSecurityGroups

    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 getSecurityGroups(args: GetSecurityGroupsArgs, opts?: InvokeOptions): Promise<GetSecurityGroupsResult>
    function getSecurityGroupsOutput(args: GetSecurityGroupsOutputArgs, opts?: InvokeOptions): Output<GetSecurityGroupsResult>
    def get_security_groups(enable_details: Optional[bool] = None,
                            ids: Optional[Sequence[str]] = None,
                            name_regex: Optional[str] = None,
                            output_file: Optional[str] = None,
                            page_number: Optional[int] = None,
                            page_size: Optional[int] = None,
                            resource_group_id: Optional[str] = None,
                            tags: Optional[Mapping[str, Any]] = None,
                            vpc_id: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetSecurityGroupsResult
    def get_security_groups_output(enable_details: Optional[pulumi.Input[bool]] = None,
                            ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                            name_regex: Optional[pulumi.Input[str]] = None,
                            output_file: Optional[pulumi.Input[str]] = None,
                            page_number: Optional[pulumi.Input[int]] = None,
                            page_size: Optional[pulumi.Input[int]] = None,
                            resource_group_id: Optional[pulumi.Input[str]] = None,
                            tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                            vpc_id: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetSecurityGroupsResult]
    func GetSecurityGroups(ctx *Context, args *GetSecurityGroupsArgs, opts ...InvokeOption) (*GetSecurityGroupsResult, error)
    func GetSecurityGroupsOutput(ctx *Context, args *GetSecurityGroupsOutputArgs, opts ...InvokeOption) GetSecurityGroupsResultOutput

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

    public static class GetSecurityGroups 
    {
        public static Task<GetSecurityGroupsResult> InvokeAsync(GetSecurityGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetSecurityGroupsResult> Invoke(GetSecurityGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSecurityGroupsResult> getSecurityGroups(GetSecurityGroupsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ecs/getSecurityGroups:getSecurityGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EnableDetails bool
    Ids List<string>
    A list of Security Group IDs.
    NameRegex string
    A regex string to filter the resulting security groups by their names.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    ResourceGroupId string
    The Id of resource group which the security_group belongs.
    Tags Dictionary<string, object>
    A map of tags assigned to the ECS instances. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const taggedSecurityGroups = alicloud.ecs.getSecurityGroups({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    tagged_security_groups = alicloud.ecs.get_security_groups(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var taggedSecurityGroups = AliCloud.Ecs.GetSecurityGroups.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecs.GetSecurityGroups(ctx, &ecs.GetSecurityGroupsArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetSecurityGroupsArgs;
    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 taggedSecurityGroups = EcsFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      taggedSecurityGroups:
        fn::invoke:
          Function: alicloud:ecs:getSecurityGroups
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    title="Optional"> <span id="vpcid_csharp">

    VpcId string

    Used to retrieve security groups that belong to the specified VPC ID.

    EnableDetails bool
    Ids []string
    A list of Security Group IDs.
    NameRegex string
    A regex string to filter the resulting security groups by their names.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    ResourceGroupId string
    The Id of resource group which the security_group belongs.
    Tags map[string]interface{}
    A map of tags assigned to the ECS instances. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const taggedSecurityGroups = alicloud.ecs.getSecurityGroups({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    tagged_security_groups = alicloud.ecs.get_security_groups(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var taggedSecurityGroups = AliCloud.Ecs.GetSecurityGroups.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecs.GetSecurityGroups(ctx, &ecs.GetSecurityGroupsArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetSecurityGroupsArgs;
    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 taggedSecurityGroups = EcsFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      taggedSecurityGroups:
        fn::invoke:
          Function: alicloud:ecs:getSecurityGroups
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    title="Optional"> <span id="vpcid_go">

    VpcId string

    Used to retrieve security groups that belong to the specified VPC ID.

    enableDetails Boolean
    ids List<String>
    A list of Security Group IDs.
    nameRegex String
    A regex string to filter the resulting security groups by their names.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Integer
    pageSize Integer
    resourceGroupId String
    The Id of resource group which the security_group belongs.
    tags Map<String,Object>
    A map of tags assigned to the ECS instances. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const taggedSecurityGroups = alicloud.ecs.getSecurityGroups({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    tagged_security_groups = alicloud.ecs.get_security_groups(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var taggedSecurityGroups = AliCloud.Ecs.GetSecurityGroups.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecs.GetSecurityGroups(ctx, &ecs.GetSecurityGroupsArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetSecurityGroupsArgs;
    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 taggedSecurityGroups = EcsFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      taggedSecurityGroups:
        fn::invoke:
          Function: alicloud:ecs:getSecurityGroups
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    title="Optional"> <span id="vpcid_java">

    vpcId String

    Used to retrieve security groups that belong to the specified VPC ID.

    enableDetails boolean
    ids string[]
    A list of Security Group IDs.
    nameRegex string
    A regex string to filter the resulting security groups by their names.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    pageNumber number
    pageSize number
    resourceGroupId string
    The Id of resource group which the security_group belongs.
    tags {[key: string]: any}
    A map of tags assigned to the ECS instances. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const taggedSecurityGroups = alicloud.ecs.getSecurityGroups({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    tagged_security_groups = alicloud.ecs.get_security_groups(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var taggedSecurityGroups = AliCloud.Ecs.GetSecurityGroups.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecs.GetSecurityGroups(ctx, &ecs.GetSecurityGroupsArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetSecurityGroupsArgs;
    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 taggedSecurityGroups = EcsFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      taggedSecurityGroups:
        fn::invoke:
          Function: alicloud:ecs:getSecurityGroups
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    title="Optional"> <span id="vpcid_nodejs">

    vpcId string

    Used to retrieve security groups that belong to the specified VPC ID.

    enable_details bool
    ids Sequence[str]
    A list of Security Group IDs.
    name_regex str
    A regex string to filter the resulting security groups by their names.
    output_file str
    File name where to save data source results (after running pulumi preview).
    page_number int
    page_size int
    resource_group_id str
    The Id of resource group which the security_group belongs.
    tags Mapping[str, Any]
    A map of tags assigned to the ECS instances. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const taggedSecurityGroups = alicloud.ecs.getSecurityGroups({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    tagged_security_groups = alicloud.ecs.get_security_groups(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var taggedSecurityGroups = AliCloud.Ecs.GetSecurityGroups.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecs.GetSecurityGroups(ctx, &ecs.GetSecurityGroupsArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetSecurityGroupsArgs;
    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 taggedSecurityGroups = EcsFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      taggedSecurityGroups:
        fn::invoke:
          Function: alicloud:ecs:getSecurityGroups
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    title="Optional"> <span id="vpc_id_python">

    vpc_id str

    Used to retrieve security groups that belong to the specified VPC ID.

    enableDetails Boolean
    ids List<String>
    A list of Security Group IDs.
    nameRegex String
    A regex string to filter the resulting security groups by their names.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Number
    pageSize Number
    resourceGroupId String
    The Id of resource group which the security_group belongs.
    tags Map<Any>
    A map of tags assigned to the ECS instances. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const taggedSecurityGroups = alicloud.ecs.getSecurityGroups({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    tagged_security_groups = alicloud.ecs.get_security_groups(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var taggedSecurityGroups = AliCloud.Ecs.GetSecurityGroups.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecs.GetSecurityGroups(ctx, &ecs.GetSecurityGroupsArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetSecurityGroupsArgs;
    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 taggedSecurityGroups = EcsFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      taggedSecurityGroups:
        fn::invoke:
          Function: alicloud:ecs:getSecurityGroups
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    title="Optional"> <span id="vpcid_yaml">

    vpcId String

    Used to retrieve security groups that belong to the specified VPC ID.

    getSecurityGroups Result

    The following output properties are available:

    Groups List<Pulumi.AliCloud.Ecs.Outputs.GetSecurityGroupsGroup>
    A list of Security Groups. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of Security Group IDs.
    Names List<string>
    A list of Security Group names.
    TotalCount int
    EnableDetails bool
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    ResourceGroupId string
    The Id of resource group which the security_group belongs.
    Tags Dictionary<string, object>
    A map of tags assigned to the ECS instance.
    VpcId string
    The ID of the VPC that owns the security group.
    Groups []GetSecurityGroupsGroup
    A list of Security Groups. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of Security Group IDs.
    Names []string
    A list of Security Group names.
    TotalCount int
    EnableDetails bool
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    ResourceGroupId string
    The Id of resource group which the security_group belongs.
    Tags map[string]interface{}
    A map of tags assigned to the ECS instance.
    VpcId string
    The ID of the VPC that owns the security group.
    groups List<GetSecurityGroupsGroup>
    A list of Security Groups. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Security Group IDs.
    names List<String>
    A list of Security Group names.
    totalCount Integer
    enableDetails Boolean
    nameRegex String
    outputFile String
    pageNumber Integer
    pageSize Integer
    resourceGroupId String
    The Id of resource group which the security_group belongs.
    tags Map<String,Object>
    A map of tags assigned to the ECS instance.
    vpcId String
    The ID of the VPC that owns the security group.
    groups GetSecurityGroupsGroup[]
    A list of Security Groups. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of Security Group IDs.
    names string[]
    A list of Security Group names.
    totalCount number
    enableDetails boolean
    nameRegex string
    outputFile string
    pageNumber number
    pageSize number
    resourceGroupId string
    The Id of resource group which the security_group belongs.
    tags {[key: string]: any}
    A map of tags assigned to the ECS instance.
    vpcId string
    The ID of the VPC that owns the security group.
    groups Sequence[GetSecurityGroupsGroup]
    A list of Security Groups. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of Security Group IDs.
    names Sequence[str]
    A list of Security Group names.
    total_count int
    enable_details bool
    name_regex str
    output_file str
    page_number int
    page_size int
    resource_group_id str
    The Id of resource group which the security_group belongs.
    tags Mapping[str, Any]
    A map of tags assigned to the ECS instance.
    vpc_id str
    The ID of the VPC that owns the security group.
    groups List<Property Map>
    A list of Security Groups. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Security Group IDs.
    names List<String>
    A list of Security Group names.
    totalCount Number
    enableDetails Boolean
    nameRegex String
    outputFile String
    pageNumber Number
    pageSize Number
    resourceGroupId String
    The Id of resource group which the security_group belongs.
    tags Map<Any>
    A map of tags assigned to the ECS instance.
    vpcId String
    The ID of the VPC that owns the security group.

    Supporting Types

    GetSecurityGroupsGroup

    CreationTime string
    Creation time of the security group.
    Description string
    The description of the security group.
    Id string
    The ID of the security group.
    InnerAccess bool
    Whether to allow inner network access.
    Name string
    The name of the security group.
    ResourceGroupId string
    The Id of resource group which the security_group belongs.
    SecurityGroupType string
    The type of the security group.
    VpcId string
    Used to retrieve security groups that belong to the specified VPC ID.
    Tags Dictionary<string, object>
    A map of tags assigned to the ECS instances. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const taggedSecurityGroups = alicloud.ecs.getSecurityGroups({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    tagged_security_groups = alicloud.ecs.get_security_groups(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var taggedSecurityGroups = AliCloud.Ecs.GetSecurityGroups.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecs.GetSecurityGroups(ctx, &ecs.GetSecurityGroupsArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetSecurityGroupsArgs;
    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 taggedSecurityGroups = EcsFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      taggedSecurityGroups:
        fn::invoke:
          Function: alicloud:ecs:getSecurityGroups
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    CreationTime string
    Creation time of the security group.
    Description string
    The description of the security group.
    Id string
    The ID of the security group.
    InnerAccess bool
    Whether to allow inner network access.
    Name string
    The name of the security group.
    ResourceGroupId string
    The Id of resource group which the security_group belongs.
    SecurityGroupType string
    The type of the security group.
    VpcId string
    Used to retrieve security groups that belong to the specified VPC ID.
    Tags map[string]interface{}
    A map of tags assigned to the ECS instances. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const taggedSecurityGroups = alicloud.ecs.getSecurityGroups({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    tagged_security_groups = alicloud.ecs.get_security_groups(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var taggedSecurityGroups = AliCloud.Ecs.GetSecurityGroups.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecs.GetSecurityGroups(ctx, &ecs.GetSecurityGroupsArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetSecurityGroupsArgs;
    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 taggedSecurityGroups = EcsFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      taggedSecurityGroups:
        fn::invoke:
          Function: alicloud:ecs:getSecurityGroups
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    creationTime String
    Creation time of the security group.
    description String
    The description of the security group.
    id String
    The ID of the security group.
    innerAccess Boolean
    Whether to allow inner network access.
    name String
    The name of the security group.
    resourceGroupId String
    The Id of resource group which the security_group belongs.
    securityGroupType String
    The type of the security group.
    vpcId String
    Used to retrieve security groups that belong to the specified VPC ID.
    tags Map<String,Object>
    A map of tags assigned to the ECS instances. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const taggedSecurityGroups = alicloud.ecs.getSecurityGroups({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    tagged_security_groups = alicloud.ecs.get_security_groups(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var taggedSecurityGroups = AliCloud.Ecs.GetSecurityGroups.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecs.GetSecurityGroups(ctx, &ecs.GetSecurityGroupsArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetSecurityGroupsArgs;
    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 taggedSecurityGroups = EcsFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      taggedSecurityGroups:
        fn::invoke:
          Function: alicloud:ecs:getSecurityGroups
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    creationTime string
    Creation time of the security group.
    description string
    The description of the security group.
    id string
    The ID of the security group.
    innerAccess boolean
    Whether to allow inner network access.
    name string
    The name of the security group.
    resourceGroupId string
    The Id of resource group which the security_group belongs.
    securityGroupType string
    The type of the security group.
    vpcId string
    Used to retrieve security groups that belong to the specified VPC ID.
    tags {[key: string]: any}
    A map of tags assigned to the ECS instances. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const taggedSecurityGroups = alicloud.ecs.getSecurityGroups({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    tagged_security_groups = alicloud.ecs.get_security_groups(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var taggedSecurityGroups = AliCloud.Ecs.GetSecurityGroups.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecs.GetSecurityGroups(ctx, &ecs.GetSecurityGroupsArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetSecurityGroupsArgs;
    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 taggedSecurityGroups = EcsFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      taggedSecurityGroups:
        fn::invoke:
          Function: alicloud:ecs:getSecurityGroups
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    creation_time str
    Creation time of the security group.
    description str
    The description of the security group.
    id str
    The ID of the security group.
    inner_access bool
    Whether to allow inner network access.
    name str
    The name of the security group.
    resource_group_id str
    The Id of resource group which the security_group belongs.
    security_group_type str
    The type of the security group.
    vpc_id str
    Used to retrieve security groups that belong to the specified VPC ID.
    tags Mapping[str, Any]
    A map of tags assigned to the ECS instances. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const taggedSecurityGroups = alicloud.ecs.getSecurityGroups({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    tagged_security_groups = alicloud.ecs.get_security_groups(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var taggedSecurityGroups = AliCloud.Ecs.GetSecurityGroups.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecs.GetSecurityGroups(ctx, &ecs.GetSecurityGroupsArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetSecurityGroupsArgs;
    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 taggedSecurityGroups = EcsFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      taggedSecurityGroups:
        fn::invoke:
          Function: alicloud:ecs:getSecurityGroups
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    creationTime String
    Creation time of the security group.
    description String
    The description of the security group.
    id String
    The ID of the security group.
    innerAccess Boolean
    Whether to allow inner network access.
    name String
    The name of the security group.
    resourceGroupId String
    The Id of resource group which the security_group belongs.
    securityGroupType String
    The type of the security group.
    vpcId String
    Used to retrieve security groups that belong to the specified VPC ID.
    tags Map<Any>
    A map of tags assigned to the ECS instances. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const taggedSecurityGroups = alicloud.ecs.getSecurityGroups({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    tagged_security_groups = alicloud.ecs.get_security_groups(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var taggedSecurityGroups = AliCloud.Ecs.GetSecurityGroups.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecs.GetSecurityGroups(ctx, &ecs.GetSecurityGroupsArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetSecurityGroupsArgs;
    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 taggedSecurityGroups = EcsFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      taggedSecurityGroups:
        fn::invoke:
          Function: alicloud:ecs:getSecurityGroups
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    

    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.53.0 published on Wednesday, Apr 17, 2024 by Pulumi