Viewing docs for Google Cloud v9.20.0
published on Wednesday, Apr 15, 2026 by Pulumi
published on Wednesday, Apr 15, 2026 by Pulumi
Viewing docs for Google Cloud v9.20.0
published on Wednesday, Apr 15, 2026 by Pulumi
published on Wednesday, Apr 15, 2026 by Pulumi
AddressGroups are used to group IP addresses together for use in firewall policies. This data source allows you to list address groups in a project and location.
To get more information about Address Groups, see:
- API documentation
- How-to Guides
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const all = gcp.networksecurity.getAddressGroups({
location: "us-central1",
project: "my-project-id",
});
import pulumi
import pulumi_gcp as gcp
all = gcp.networksecurity.get_address_groups(location="us-central1",
project="my-project-id")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/networksecurity"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := networksecurity.GetAddressGroups(ctx, &networksecurity.GetAddressGroupsArgs{
Location: "us-central1",
Project: pulumi.StringRef("my-project-id"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var all = Gcp.NetworkSecurity.GetAddressGroups.Invoke(new()
{
Location = "us-central1",
Project = "my-project-id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.networksecurity.NetworksecurityFunctions;
import com.pulumi.gcp.networksecurity.inputs.GetAddressGroupsArgs;
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 all = NetworksecurityFunctions.getAddressGroups(GetAddressGroupsArgs.builder()
.location("us-central1")
.project("my-project-id")
.build());
}
}
variables:
all:
fn::invoke:
function: gcp:networksecurity:getAddressGroups
arguments:
location: us-central1
project: my-project-id
Using getAddressGroups
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 getAddressGroups(args: GetAddressGroupsArgs, opts?: InvokeOptions): Promise<GetAddressGroupsResult>
function getAddressGroupsOutput(args: GetAddressGroupsOutputArgs, opts?: InvokeOptions): Output<GetAddressGroupsResult>def get_address_groups(location: Optional[str] = None,
project: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetAddressGroupsResult
def get_address_groups_output(location: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetAddressGroupsResult]func GetAddressGroups(ctx *Context, args *GetAddressGroupsArgs, opts ...InvokeOption) (*GetAddressGroupsResult, error)
func GetAddressGroupsOutput(ctx *Context, args *GetAddressGroupsOutputArgs, opts ...InvokeOption) GetAddressGroupsResultOutput> Note: This function is named GetAddressGroups in the Go SDK.
public static class GetAddressGroups
{
public static Task<GetAddressGroupsResult> InvokeAsync(GetAddressGroupsArgs args, InvokeOptions? opts = null)
public static Output<GetAddressGroupsResult> Invoke(GetAddressGroupsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetAddressGroupsResult> getAddressGroups(GetAddressGroupsArgs args, InvokeOptions options)
public static Output<GetAddressGroupsResult> getAddressGroups(GetAddressGroupsArgs args, InvokeOptions options)
fn::invoke:
function: gcp:networksecurity/getAddressGroups:getAddressGroups
arguments:
# arguments dictionaryThe following arguments are supported:
getAddressGroups Result
The following output properties are available:
- Address
Groups List<GetAddress Groups Address Group> - A list of Address Groups in the selected project and location. Structure is defined below.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- Project string
- The ID of the project in which the resource belongs.
- Address
Groups []GetAddress Groups Address Group - A list of Address Groups in the selected project and location. Structure is defined below.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- Project string
- The ID of the project in which the resource belongs.
- address
Groups List<GetAddress Groups Address Group> - A list of Address Groups in the selected project and location. Structure is defined below.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- project String
- The ID of the project in which the resource belongs.
- address
Groups GetAddress Groups Address Group[] - A list of Address Groups in the selected project and location. Structure is defined below.
- id string
- The provider-assigned unique ID for this managed resource.
- location string
- project string
- The ID of the project in which the resource belongs.
- address_
groups Sequence[GetAddress Groups Address Group] - A list of Address Groups in the selected project and location. Structure is defined below.
- id str
- The provider-assigned unique ID for this managed resource.
- location str
- project str
- The ID of the project in which the resource belongs.
- address
Groups List<Property Map> - A list of Address Groups in the selected project and location. Structure is defined below.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- project String
- The ID of the project in which the resource belongs.
Supporting Types
GetAddressGroupsAddressGroup
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.
Viewing docs for Google Cloud v9.20.0
published on Wednesday, Apr 15, 2026 by Pulumi
published on Wednesday, Apr 15, 2026 by Pulumi
