OpenStack v5.0.0 published on Friday, Sep 27, 2024 by Pulumi
openstack.networking.getSecGroup
Explore with Pulumi AI
Use this data source to get the ID of an available OpenStack security group.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const secgroup = openstack.networking.getSecGroup({
name: "tf_test_secgroup",
});
import pulumi
import pulumi_openstack as openstack
secgroup = openstack.networking.get_sec_group(name="tf_test_secgroup")
package main
import (
"github.com/pulumi/pulumi-openstack/sdk/v5/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
})
}
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 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());
}
}
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,
stateful: Optional[bool] = 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,
stateful: Optional[pulumi.Input[bool]] = 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. - Secgroup
Id string - The ID of the security group.
- Stateful bool
- Whether the security group is stateful or not.
- List<string>
- The list of security group tags to filter.
- Tenant
Id 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. - Secgroup
Id string - The ID of the security group.
- Stateful bool
- Whether the security group is stateful or not.
- []string
- The list of security group tags to filter.
- Tenant
Id 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. - secgroup
Id String - The ID of the security group.
- stateful Boolean
- Whether the security group is stateful or not.
- List<String>
- The list of security group tags to filter.
- tenant
Id 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. - secgroup
Id string - The ID of the security group.
- stateful boolean
- Whether the security group is stateful or not.
- string[]
- The list of security group tags to filter.
- tenant
Id 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.
- stateful bool
- Whether the security group is stateful or not.
- 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. - secgroup
Id String - The ID of the security group.
- stateful Boolean
- Whether the security group is stateful or not.
- List<String>
- The list of security group tags to filter.
- tenant
Id String - The owner of the security group.
getSecGroup Result
The following output properties are available:
- 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.
- Stateful bool
- See Argument Reference above.
- Tenant
Id string - Description string
- See Argument Reference above.
- Name string
- See Argument Reference above.
- Secgroup
Id string - List<string>
- []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.
- Stateful bool
- See Argument Reference above.
- Tenant
Id string - Description string
- See Argument Reference above.
- Name string
- See Argument Reference above.
- Secgroup
Id string - []string
- 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.
- stateful Boolean
- See Argument Reference above.
- tenant
Id String - description String
- See Argument Reference above.
- name String
- See Argument Reference above.
- secgroup
Id String - List<String>
- 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.
- stateful boolean
- See Argument Reference above.
- tenant
Id string - description string
- See Argument Reference above.
- name string
- See Argument Reference above.
- secgroup
Id string - string[]
- 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.
- stateful bool
- See Argument Reference above.
- tenant_
id str - description str
- See Argument Reference above.
- name str
- See Argument Reference above.
- secgroup_
id str - Sequence[str]
- 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.
- stateful Boolean
- See Argument Reference above.
- tenant
Id String - description String
- See Argument Reference above.
- name String
- See Argument Reference above.
- secgroup
Id String - List<String>
Package Details
- Repository
- OpenStack pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
openstack
Terraform Provider.