vcd.getNsxtSecurityGroup
Explore with Pulumi AI
Supported in provider v3.3+ and VCD 10.1+ with NSX-T backed VDCs.
Provides a data source to access NSX-T Security Group configuration. Security Groups are groups of data center group networks to which distributed firewall rules apply. Grouping networks helps you to reduce the total number of distributed firewall rules to be created.
Example Usage
1
import * as pulumi from "@pulumi/pulumi";
import * as vcd from "@pulumi/vcd";
const main = vcd.getNsxtEdgegateway({
org: "my-org",
name: "main-edge",
});
const group1 = main.then(main => vcd.getNsxtSecurityGroup({
org: "my-org",
edgeGatewayId: main.id,
name: "test-security-group-changed",
}));
import pulumi
import pulumi_vcd as vcd
main = vcd.get_nsxt_edgegateway(org="my-org",
name="main-edge")
group1 = vcd.get_nsxt_security_group(org="my-org",
edge_gateway_id=main.id,
name="test-security-group-changed")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/vcd/v3/vcd"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
main, err := vcd.LookupNsxtEdgegateway(ctx, &vcd.LookupNsxtEdgegatewayArgs{
Org: pulumi.StringRef("my-org"),
Name: "main-edge",
}, nil)
if err != nil {
return err
}
_, err = vcd.LookupNsxtSecurityGroup(ctx, &vcd.LookupNsxtSecurityGroupArgs{
Org: pulumi.StringRef("my-org"),
EdgeGatewayId: main.Id,
Name: "test-security-group-changed",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vcd = Pulumi.Vcd;
return await Deployment.RunAsync(() =>
{
var main = Vcd.GetNsxtEdgegateway.Invoke(new()
{
Org = "my-org",
Name = "main-edge",
});
var group1 = Vcd.GetNsxtSecurityGroup.Invoke(new()
{
Org = "my-org",
EdgeGatewayId = main.Apply(getNsxtEdgegatewayResult => getNsxtEdgegatewayResult.Id),
Name = "test-security-group-changed",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vcd.VcdFunctions;
import com.pulumi.vcd.inputs.GetNsxtEdgegatewayArgs;
import com.pulumi.vcd.inputs.GetNsxtSecurityGroupArgs;
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 main = VcdFunctions.getNsxtEdgegateway(GetNsxtEdgegatewayArgs.builder()
.org("my-org")
.name("main-edge")
.build());
final var group1 = VcdFunctions.getNsxtSecurityGroup(GetNsxtSecurityGroupArgs.builder()
.org("my-org")
.edgeGatewayId(main.applyValue(getNsxtEdgegatewayResult -> getNsxtEdgegatewayResult.id()))
.name("test-security-group-changed")
.build());
}
}
variables:
main:
fn::invoke:
function: vcd:getNsxtEdgegateway
arguments:
org: my-org
name: main-edge
group1:
fn::invoke:
function: vcd:getNsxtSecurityGroup
arguments:
org: my-org
edgeGatewayId: ${main.id}
name: test-security-group-changed
Using getNsxtSecurityGroup
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 getNsxtSecurityGroup(args: GetNsxtSecurityGroupArgs, opts?: InvokeOptions): Promise<GetNsxtSecurityGroupResult>
function getNsxtSecurityGroupOutput(args: GetNsxtSecurityGroupOutputArgs, opts?: InvokeOptions): Output<GetNsxtSecurityGroupResult>
def get_nsxt_security_group(edge_gateway_id: Optional[str] = None,
id: Optional[str] = None,
name: Optional[str] = None,
org: Optional[str] = None,
vdc: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetNsxtSecurityGroupResult
def get_nsxt_security_group_output(edge_gateway_id: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
org: Optional[pulumi.Input[str]] = None,
vdc: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetNsxtSecurityGroupResult]
func LookupNsxtSecurityGroup(ctx *Context, args *LookupNsxtSecurityGroupArgs, opts ...InvokeOption) (*LookupNsxtSecurityGroupResult, error)
func LookupNsxtSecurityGroupOutput(ctx *Context, args *LookupNsxtSecurityGroupOutputArgs, opts ...InvokeOption) LookupNsxtSecurityGroupResultOutput
> Note: This function is named LookupNsxtSecurityGroup
in the Go SDK.
public static class GetNsxtSecurityGroup
{
public static Task<GetNsxtSecurityGroupResult> InvokeAsync(GetNsxtSecurityGroupArgs args, InvokeOptions? opts = null)
public static Output<GetNsxtSecurityGroupResult> Invoke(GetNsxtSecurityGroupInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNsxtSecurityGroupResult> getNsxtSecurityGroup(GetNsxtSecurityGroupArgs args, InvokeOptions options)
public static Output<GetNsxtSecurityGroupResult> getNsxtSecurityGroup(GetNsxtSecurityGroupArgs args, InvokeOptions options)
fn::invoke:
function: vcd:index/getNsxtSecurityGroup:getNsxtSecurityGroup
arguments:
# arguments dictionary
The following arguments are supported:
- Edge
Gateway stringId - The ID of the Edge Gateway (NSX-T only). Can be looked up using
- Name string
- Unique name of existing Security Group.
- Id string
- Org string
- The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
- Vdc string
- The name of VDC to use, optional if defined at provider level. Deprecated
in favor of
edge_gateway_id
field.
- Edge
Gateway stringId - The ID of the Edge Gateway (NSX-T only). Can be looked up using
- Name string
- Unique name of existing Security Group.
- Id string
- Org string
- The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
- Vdc string
- The name of VDC to use, optional if defined at provider level. Deprecated
in favor of
edge_gateway_id
field.
- edge
Gateway StringId - The ID of the Edge Gateway (NSX-T only). Can be looked up using
- name String
- Unique name of existing Security Group.
- id String
- org String
- The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
- vdc String
- The name of VDC to use, optional if defined at provider level. Deprecated
in favor of
edge_gateway_id
field.
- edge
Gateway stringId - The ID of the Edge Gateway (NSX-T only). Can be looked up using
- name string
- Unique name of existing Security Group.
- id string
- org string
- The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
- vdc string
- The name of VDC to use, optional if defined at provider level. Deprecated
in favor of
edge_gateway_id
field.
- edge_
gateway_ strid - The ID of the Edge Gateway (NSX-T only). Can be looked up using
- name str
- Unique name of existing Security Group.
- id str
- org str
- The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
- vdc str
- The name of VDC to use, optional if defined at provider level. Deprecated
in favor of
edge_gateway_id
field.
- edge
Gateway StringId - The ID of the Edge Gateway (NSX-T only). Can be looked up using
- name String
- Unique name of existing Security Group.
- id String
- org String
- The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
- vdc String
- The name of VDC to use, optional if defined at provider level. Deprecated
in favor of
edge_gateway_id
field.
getNsxtSecurityGroup Result
The following output properties are available:
- Description string
- Edge
Gateway stringId - Id string
- Member
Org List<string>Network Ids - Member
Vms List<GetNsxt Security Group Member Vm> - Name string
- Owner
Id string - Parent VDC or VDC Group ID.
- Org string
- Vdc string
- Description string
- Edge
Gateway stringId - Id string
- Member
Org []stringNetwork Ids - Member
Vms []GetNsxt Security Group Member Vm - Name string
- Owner
Id string - Parent VDC or VDC Group ID.
- Org string
- Vdc string
- description String
- edge
Gateway StringId - id String
- member
Org List<String>Network Ids - member
Vms List<GetNsxt Security Group Member Vm> - name String
- owner
Id String - Parent VDC or VDC Group ID.
- org String
- vdc String
- description string
- edge
Gateway stringId - id string
- member
Org string[]Network Ids - member
Vms GetNsxt Security Group Member Vm[] - name string
- owner
Id string - Parent VDC or VDC Group ID.
- org string
- vdc string
- description str
- edge_
gateway_ strid - id str
- member_
org_ Sequence[str]network_ ids - member_
vms Sequence[GetNsxt Security Group Member Vm] - name str
- owner_
id str - Parent VDC or VDC Group ID.
- org str
- vdc str
- description String
- edge
Gateway StringId - id String
- member
Org List<String>Network Ids - member
Vms List<Property Map> - name String
- owner
Id String - Parent VDC or VDC Group ID.
- org String
- vdc String
Supporting Types
GetNsxtSecurityGroupMemberVm
Package Details
- Repository
- vcd vmware/terraform-provider-vcd
- License
- Notes
- This Pulumi package is based on the
vcd
Terraform Provider.