1. Packages
  2. OpenStack
  3. API Docs
  4. networking
  5. getSecGroup
OpenStack v3.15.1 published on Thursday, Feb 1, 2024 by Pulumi

openstack.networking.getSecGroup

Explore with Pulumi AI

openstack logo
OpenStack v3.15.1 published on Thursday, Feb 1, 2024 by Pulumi

    Use this data source to get the ID of an available OpenStack security group.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using OpenStack = Pulumi.OpenStack;
    
    return await Deployment.RunAsync(() => 
    {
        var secgroup = OpenStack.Networking.GetSecGroup.Invoke(new()
        {
            Name = "tf_test_secgroup",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/networking"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := networking.LookupSecGroup(ctx, &networking.LookupSecGroupArgs{
    			Name: pulumi.StringRef("tf_test_secgroup"),
    		}, 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.openstack.networking.NetworkingFunctions;
    import com.pulumi.openstack.networking.inputs.GetSecGroupArgs;
    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 secgroup = NetworkingFunctions.getSecGroup(GetSecGroupArgs.builder()
                .name("tf_test_secgroup")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_openstack as openstack
    
    secgroup = openstack.networking.get_sec_group(name="tf_test_secgroup")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as openstack from "@pulumi/openstack";
    
    const secgroup = openstack.networking.getSecGroup({
        name: "tf_test_secgroup",
    });
    
    variables:
      secgroup:
        fn::invoke:
          Function: openstack:networking:getSecGroup
          Arguments:
            name: tf_test_secgroup
    

    Using getSecGroup

    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 getSecGroup(args: GetSecGroupArgs, opts?: InvokeOptions): Promise<GetSecGroupResult>
    function getSecGroupOutput(args: GetSecGroupOutputArgs, opts?: InvokeOptions): Output<GetSecGroupResult>
    def get_sec_group(description: Optional[str] = None,
                      name: Optional[str] = None,
                      region: Optional[str] = None,
                      secgroup_id: Optional[str] = None,
                      tags: Optional[Sequence[str]] = None,
                      tenant_id: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetSecGroupResult
    def get_sec_group_output(description: Optional[pulumi.Input[str]] = None,
                      name: Optional[pulumi.Input[str]] = None,
                      region: Optional[pulumi.Input[str]] = None,
                      secgroup_id: Optional[pulumi.Input[str]] = None,
                      tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                      tenant_id: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetSecGroupResult]
    func LookupSecGroup(ctx *Context, args *LookupSecGroupArgs, opts ...InvokeOption) (*LookupSecGroupResult, error)
    func LookupSecGroupOutput(ctx *Context, args *LookupSecGroupOutputArgs, opts ...InvokeOption) LookupSecGroupResultOutput

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

    public static class GetSecGroup 
    {
        public static Task<GetSecGroupResult> InvokeAsync(GetSecGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetSecGroupResult> Invoke(GetSecGroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSecGroupResult> getSecGroup(GetSecGroupArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: openstack:networking/getSecGroup:getSecGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Description string
    Human-readable description the the subnet.
    Name string
    The name of the security group.
    Region string
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve security groups ids. If omitted, the region argument of the provider is used.
    SecgroupId string
    The ID of the security group.
    Tags List<string>
    The list of security group tags to filter.
    TenantId string
    The owner of the security group.
    Description string
    Human-readable description the the subnet.
    Name string
    The name of the security group.
    Region string
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve security groups ids. If omitted, the region argument of the provider is used.
    SecgroupId string
    The ID of the security group.
    Tags []string
    The list of security group tags to filter.
    TenantId string
    The owner of the security group.
    description String
    Human-readable description the the subnet.
    name String
    The name of the security group.
    region String
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve security groups ids. If omitted, the region argument of the provider is used.
    secgroupId String
    The ID of the security group.
    tags List<String>
    The list of security group tags to filter.
    tenantId String
    The owner of the security group.
    description string
    Human-readable description the the subnet.
    name string
    The name of the security group.
    region string
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve security groups ids. If omitted, the region argument of the provider is used.
    secgroupId string
    The ID of the security group.
    tags string[]
    The list of security group tags to filter.
    tenantId string
    The owner of the security group.
    description str
    Human-readable description the the subnet.
    name str
    The name of the security group.
    region str
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve security groups ids. If omitted, the region argument of the provider is used.
    secgroup_id str
    The ID of the security group.
    tags Sequence[str]
    The list of security group tags to filter.
    tenant_id str
    The owner of the security group.
    description String
    Human-readable description the the subnet.
    name String
    The name of the security group.
    region String
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve security groups ids. If omitted, the region argument of the provider is used.
    secgroupId String
    The ID of the security group.
    tags List<String>
    The list of security group tags to filter.
    tenantId String
    The owner of the security group.

    getSecGroup Result

    The following output properties are available:

    AllTags List<string>
    The set of string tags applied on the security group.
    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    See Argument Reference above.
    TenantId string
    Description string
    See Argument Reference above.
    Name string
    See Argument Reference above.
    SecgroupId string
    Tags List<string>
    AllTags []string
    The set of string tags applied on the security group.
    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    See Argument Reference above.
    TenantId string
    Description string
    See Argument Reference above.
    Name string
    See Argument Reference above.
    SecgroupId string
    Tags []string
    allTags List<String>
    The set of string tags applied on the security group.
    id String
    The provider-assigned unique ID for this managed resource.
    region String
    See Argument Reference above.
    tenantId String
    description String
    See Argument Reference above.
    name String
    See Argument Reference above.
    secgroupId String
    tags List<String>
    allTags string[]
    The set of string tags applied on the security group.
    id string
    The provider-assigned unique ID for this managed resource.
    region string
    See Argument Reference above.
    tenantId string
    description string
    See Argument Reference above.
    name string
    See Argument Reference above.
    secgroupId string
    tags string[]
    all_tags Sequence[str]
    The set of string tags applied on the security group.
    id str
    The provider-assigned unique ID for this managed resource.
    region str
    See Argument Reference above.
    tenant_id str
    description str
    See Argument Reference above.
    name str
    See Argument Reference above.
    secgroup_id str
    tags Sequence[str]
    allTags List<String>
    The set of string tags applied on the security group.
    id String
    The provider-assigned unique ID for this managed resource.
    region String
    See Argument Reference above.
    tenantId String
    description String
    See Argument Reference above.
    name String
    See Argument Reference above.
    secgroupId String
    tags List<String>

    Package Details

    Repository
    OpenStack pulumi/pulumi-openstack
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the openstack Terraform Provider.
    openstack logo
    OpenStack v3.15.1 published on Thursday, Feb 1, 2024 by Pulumi