title: "getSecgroup" title_tag: "huaweicloud.Vpc.getSecgroup" meta_desc: "Documentation for the huaweicloud.Vpc.getSecgroup function with examples, input properties, output properties, and supporting types." layout: api no_edit_this_page: true
Use this data source to get the ID of an available HuaweiCloud security group.
using System.Collections.Generic;
using Pulumi;
using Huaweicloud = Pulumi.Huaweicloud;
return await Deployment.RunAsync(() =>
{
var secgroup = Huaweicloud.Vpc.GetSecgroup.Invoke(new()
{
Name = "tf_test_secgroup",
});
});
package main
import (
"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Vpc"
"github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/Vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := Vpc.GetSecgroup(ctx, &vpc.GetSecgroupArgs{
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.huaweicloud.Vpc.VpcFunctions;
import com.pulumi.huaweicloud.Vpc.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 = VpcFunctions.getSecgroup(GetSecgroupArgs.builder()
.name("tf_test_secgroup")
.build());
}
}
import pulumi
import pulumi_huaweicloud as huaweicloud
secgroup = huaweicloud.Vpc.get_secgroup(name="tf_test_secgroup")
import * as pulumi from "@pulumi/pulumi";
import * as huaweicloud from "@pulumi/huaweicloud";
const secgroup = pulumi.output(huaweicloud.Vpc.getSecgroup({
name: "tf_test_secgroup",
}));
variables:
secgroup:
Fn::Invoke:
Function: huaweicloud:Vpc:getSecgroup
Arguments:
name: tf_test_secgroup
Using getSecgroup {#using}
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_secgroup(enterprise_project_id: Optional[str] = None,
name: Optional[str] = None,
region: Optional[str] = None,
secgroup_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetSecgroupResult
def get_secgroup_output(enterprise_project_id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
region: Optional[pulumi.Input[str]] = None,
secgroup_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSecgroupResult]
func GetSecgroup(ctx *Context, args *GetSecgroupArgs, opts ...InvokeOption) (*GetSecgroupResult, error)
func GetSecgroupOutput(ctx *Context, args *GetSecgroupOutputArgs, opts ...InvokeOption) GetSecgroupResultOutput
> Note: This function is named GetSecgroup
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: huaweicloud:Vpc/getSecgroup:getSecgroup
Arguments:
# Arguments dictionary
The following arguments are supported:
-
Enterprise
Project stringId - Name string
Specifies the name of the security group.
- Region string
Specifies the region in which to obtain the security group. If omitted, the provider-level region will be used.
-
Secgroup
Id string Specifiest he ID of the security group.
-
Enterprise
Project stringId - Name string
Specifies the name of the security group.
- Region string
Specifies the region in which to obtain the security group. If omitted, the provider-level region will be used.
-
Secgroup
Id string Specifiest he ID of the security group.
-
enterprise
Project StringId - name String
Specifies the name of the security group.
- region String
Specifies the region in which to obtain the security group. If omitted, the provider-level region will be used.
-
secgroup
Id String Specifiest he ID of the security group.
-
enterprise
Project stringId - name string
Specifies the name of the security group.
- region string
Specifies the region in which to obtain the security group. If omitted, the provider-level region will be used.
-
secgroup
Id string Specifiest he ID of the security group.
-
enterprise_
project_ strid - name str
Specifies the name of the security group.
- region str
Specifies the region in which to obtain the security group. If omitted, the provider-level region will be used.
-
secgroup_
id str Specifiest he ID of the security group.
-
enterprise
Project StringId - name String
Specifies the name of the security group.
- region String
Specifies the region in which to obtain the security group. If omitted, the provider-level region will be used.
-
secgroup
Id String Specifiest he ID of the security group.
getSecgroup Result {#result}
The following output properties are available:
-
Created
At string The creation time, in UTC format.
- Description string
The supplementary information about the security group rule.
- Id string
The provider-assigned unique ID for this managed resource.
- Name string
- Region string
-
Rules
List<Get
Secgroup Rule> The array of security group rules associating with the security group. The rule object is documented below.
-
Updated
At string The last update time, in UTC format.
-
Enterprise
Project stringId -
Secgroup
Id string
-
Created
At string The creation time, in UTC format.
- Description string
The supplementary information about the security group rule.
- Id string
The provider-assigned unique ID for this managed resource.
- Name string
- Region string
-
Rules
[]Get
Secgroup Rule Type The array of security group rules associating with the security group. The rule object is documented below.
-
Updated
At string The last update time, in UTC format.
-
Enterprise
Project stringId -
Secgroup
Id string
-
created
At String The creation time, in UTC format.
- description String
The supplementary information about the security group rule.
- id String
The provider-assigned unique ID for this managed resource.
- name String
- region String
-
rules
List<Get
Secgroup Rule> The array of security group rules associating with the security group. The rule object is documented below.
-
updated
At String The last update time, in UTC format.
-
enterprise
Project StringId -
secgroup
Id String
-
created
At string The creation time, in UTC format.
- description string
The supplementary information about the security group rule.
- id string
The provider-assigned unique ID for this managed resource.
- name string
- region string
-
rules
Get
Secgroup Rule[] The array of security group rules associating with the security group. The rule object is documented below.
-
updated
At string The last update time, in UTC format.
-
enterprise
Project stringId -
secgroup
Id string
-
created_
at str The creation time, in UTC format.
- description str
The supplementary information about the security group rule.
- id str
The provider-assigned unique ID for this managed resource.
- name str
- region str
-
rules
Get
Secgroup Rule] The array of security group rules associating with the security group. The rule object is documented below.
-
updated_
at str The last update time, in UTC format.
-
enterprise_
project_ strid -
secgroup_
id str
-
created
At String The creation time, in UTC format.
- description String
The supplementary information about the security group rule.
- id String
The provider-assigned unique ID for this managed resource.
- name String
- region String
- rules List<Property Map>
The array of security group rules associating with the security group. The rule object is documented below.
-
updated
At String The last update time, in UTC format.
-
enterprise
Project StringId -
secgroup
Id String
Supporting Types
GetSecgroupRule
- Action string
The effective policy.
- Description string
The supplementary information about the security group rule.
- Direction string
The direction of the rule. The value can be egress or ingress.
- Ethertype string
The IP protocol version. The value can be IPv4 or IPv6.
- Id string
The security group rule ID.
-
Port
Range intMax -
Port
Range intMin - Ports string
The port value range.
- Priority int
The priority number.
- Protocol string
The protocol type.
-
Remote
Address stringGroup Id The ID of the remote address group.
-
Remote
Group stringId The ID of the peer security group.
-
Remote
Ip stringPrefix The remote IP address. The value can be in the CIDR format or IP addresses.
- Action string
The effective policy.
- Description string
The supplementary information about the security group rule.
- Direction string
The direction of the rule. The value can be egress or ingress.
- Ethertype string
The IP protocol version. The value can be IPv4 or IPv6.
- Id string
The security group rule ID.
-
Port
Range intMax -
Port
Range intMin - Ports string
The port value range.
- Priority int
The priority number.
- Protocol string
The protocol type.
-
Remote
Address stringGroup Id The ID of the remote address group.
-
Remote
Group stringId The ID of the peer security group.
-
Remote
Ip stringPrefix The remote IP address. The value can be in the CIDR format or IP addresses.
- action String
The effective policy.
- description String
The supplementary information about the security group rule.
- direction String
The direction of the rule. The value can be egress or ingress.
- ethertype String
The IP protocol version. The value can be IPv4 or IPv6.
- id String
The security group rule ID.
-
port
Range IntegerMax -
port
Range IntegerMin - ports String
The port value range.
- priority Integer
The priority number.
- protocol String
The protocol type.
-
remote
Address StringGroup Id The ID of the remote address group.
-
remote
Group StringId The ID of the peer security group.
-
remote
Ip StringPrefix The remote IP address. The value can be in the CIDR format or IP addresses.
- action string
The effective policy.
- description string
The supplementary information about the security group rule.
- direction string
The direction of the rule. The value can be egress or ingress.
- ethertype string
The IP protocol version. The value can be IPv4 or IPv6.
- id string
The security group rule ID.
-
port
Range numberMax -
port
Range numberMin - ports string
The port value range.
- priority number
The priority number.
- protocol string
The protocol type.
-
remote
Address stringGroup Id The ID of the remote address group.
-
remote
Group stringId The ID of the peer security group.
-
remote
Ip stringPrefix The remote IP address. The value can be in the CIDR format or IP addresses.
- action str
The effective policy.
- description str
The supplementary information about the security group rule.
- direction str
The direction of the rule. The value can be egress or ingress.
- ethertype str
The IP protocol version. The value can be IPv4 or IPv6.
- id str
The security group rule ID.
-
port_
range_ intmax -
port_
range_ intmin - ports str
The port value range.
- priority int
The priority number.
- protocol str
The protocol type.
-
remote_
address_ strgroup_ id The ID of the remote address group.
-
remote_
group_ strid The ID of the peer security group.
-
remote_
ip_ strprefix The remote IP address. The value can be in the CIDR format or IP addresses.
- action String
The effective policy.
- description String
The supplementary information about the security group rule.
- direction String
The direction of the rule. The value can be egress or ingress.
- ethertype String
The IP protocol version. The value can be IPv4 or IPv6.
- id String
The security group rule ID.
-
port
Range NumberMax -
port
Range NumberMin - ports String
The port value range.
- priority Number
The priority number.
- protocol String
The protocol type.
-
remote
Address StringGroup Id The ID of the remote address group.
-
remote
Group StringId The ID of the peer security group.
-
remote
Ip StringPrefix The remote IP address. The value can be in the CIDR format or IP addresses.
Package Details
- Repository
- https://github.com/huaweicloud/pulumi-huaweicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
huaweicloud
Terraform Provider.