Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.CloudGuard.getSecurityZones
Explore with Pulumi AI
This data source provides the list of Security Zones in Oracle Cloud Infrastructure Cloud Guard service.
Returns a list of security zones (SecurityZone resources) in a compartment identified by compartmentId. List is contained in a page of SecurityZoneSummary resources.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testSecurityZones = oci.CloudGuard.getSecurityZones({
    compartmentId: compartmentId,
    displayName: securityZoneDisplayName,
    id: securityZoneId,
    isRequiredSecurityZonesInSubtree: securityZoneIsRequiredSecurityZonesInSubtree,
    securityRecipeId: testSecurityRecipe.id,
    state: securityZoneState,
});
import pulumi
import pulumi_oci as oci
test_security_zones = oci.CloudGuard.get_security_zones(compartment_id=compartment_id,
    display_name=security_zone_display_name,
    id=security_zone_id,
    is_required_security_zones_in_subtree=security_zone_is_required_security_zones_in_subtree,
    security_recipe_id=test_security_recipe["id"],
    state=security_zone_state)
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/cloudguard"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudguard.GetSecurityZones(ctx, &cloudguard.GetSecurityZonesArgs{
			CompartmentId:                    compartmentId,
			DisplayName:                      pulumi.StringRef(securityZoneDisplayName),
			Id:                               pulumi.StringRef(securityZoneId),
			IsRequiredSecurityZonesInSubtree: pulumi.BoolRef(securityZoneIsRequiredSecurityZonesInSubtree),
			SecurityRecipeId:                 pulumi.StringRef(testSecurityRecipe.Id),
			State:                            pulumi.StringRef(securityZoneState),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() => 
{
    var testSecurityZones = Oci.CloudGuard.GetSecurityZones.Invoke(new()
    {
        CompartmentId = compartmentId,
        DisplayName = securityZoneDisplayName,
        Id = securityZoneId,
        IsRequiredSecurityZonesInSubtree = securityZoneIsRequiredSecurityZonesInSubtree,
        SecurityRecipeId = testSecurityRecipe.Id,
        State = securityZoneState,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.CloudGuard.CloudGuardFunctions;
import com.pulumi.oci.CloudGuard.inputs.GetSecurityZonesArgs;
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 testSecurityZones = CloudGuardFunctions.getSecurityZones(GetSecurityZonesArgs.builder()
            .compartmentId(compartmentId)
            .displayName(securityZoneDisplayName)
            .id(securityZoneId)
            .isRequiredSecurityZonesInSubtree(securityZoneIsRequiredSecurityZonesInSubtree)
            .securityRecipeId(testSecurityRecipe.id())
            .state(securityZoneState)
            .build());
    }
}
variables:
  testSecurityZones:
    fn::invoke:
      function: oci:CloudGuard:getSecurityZones
      arguments:
        compartmentId: ${compartmentId}
        displayName: ${securityZoneDisplayName}
        id: ${securityZoneId}
        isRequiredSecurityZonesInSubtree: ${securityZoneIsRequiredSecurityZonesInSubtree}
        securityRecipeId: ${testSecurityRecipe.id}
        state: ${securityZoneState}
Using getSecurityZones
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 getSecurityZones(args: GetSecurityZonesArgs, opts?: InvokeOptions): Promise<GetSecurityZonesResult>
function getSecurityZonesOutput(args: GetSecurityZonesOutputArgs, opts?: InvokeOptions): Output<GetSecurityZonesResult>def get_security_zones(compartment_id: Optional[str] = None,
                       display_name: Optional[str] = None,
                       filters: Optional[Sequence[GetSecurityZonesFilter]] = None,
                       id: Optional[str] = None,
                       is_required_security_zones_in_subtree: Optional[bool] = None,
                       security_recipe_id: Optional[str] = None,
                       state: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetSecurityZonesResult
def get_security_zones_output(compartment_id: Optional[pulumi.Input[str]] = None,
                       display_name: Optional[pulumi.Input[str]] = None,
                       filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetSecurityZonesFilterArgs]]]] = None,
                       id: Optional[pulumi.Input[str]] = None,
                       is_required_security_zones_in_subtree: Optional[pulumi.Input[bool]] = None,
                       security_recipe_id: Optional[pulumi.Input[str]] = None,
                       state: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetSecurityZonesResult]func GetSecurityZones(ctx *Context, args *GetSecurityZonesArgs, opts ...InvokeOption) (*GetSecurityZonesResult, error)
func GetSecurityZonesOutput(ctx *Context, args *GetSecurityZonesOutputArgs, opts ...InvokeOption) GetSecurityZonesResultOutput> Note: This function is named GetSecurityZones in the Go SDK.
public static class GetSecurityZones 
{
    public static Task<GetSecurityZonesResult> InvokeAsync(GetSecurityZonesArgs args, InvokeOptions? opts = null)
    public static Output<GetSecurityZonesResult> Invoke(GetSecurityZonesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSecurityZonesResult> getSecurityZones(GetSecurityZonesArgs args, InvokeOptions options)
public static Output<GetSecurityZonesResult> getSecurityZones(GetSecurityZonesArgs args, InvokeOptions options)
fn::invoke:
  function: oci:CloudGuard/getSecurityZones:getSecurityZones
  arguments:
    # arguments dictionaryThe following arguments are supported:
- CompartmentId string
- The OCID of the compartment in which to list resources.
- DisplayName string
- A filter to return only resources that match the entire display name given.
- Filters
List<GetSecurity Zones Filter> 
- Id string
- The unique identifier of the security zone (SecurityZoneresource).
- IsRequired boolSecurity Zones In Subtree 
- Is security zones in the subtree?
- SecurityRecipe stringId 
- The unique identifier of the security zone recipe. (SecurityReciperesource).
- State string
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- CompartmentId string
- The OCID of the compartment in which to list resources.
- DisplayName string
- A filter to return only resources that match the entire display name given.
- Filters
[]GetSecurity Zones Filter 
- Id string
- The unique identifier of the security zone (SecurityZoneresource).
- IsRequired boolSecurity Zones In Subtree 
- Is security zones in the subtree?
- SecurityRecipe stringId 
- The unique identifier of the security zone recipe. (SecurityReciperesource).
- State string
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- compartmentId String
- The OCID of the compartment in which to list resources.
- displayName String
- A filter to return only resources that match the entire display name given.
- filters
List<GetSecurity Zones Filter> 
- id String
- The unique identifier of the security zone (SecurityZoneresource).
- isRequired BooleanSecurity Zones In Subtree 
- Is security zones in the subtree?
- securityRecipe StringId 
- The unique identifier of the security zone recipe. (SecurityReciperesource).
- state String
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- compartmentId string
- The OCID of the compartment in which to list resources.
- displayName string
- A filter to return only resources that match the entire display name given.
- filters
GetSecurity Zones Filter[] 
- id string
- The unique identifier of the security zone (SecurityZoneresource).
- isRequired booleanSecurity Zones In Subtree 
- Is security zones in the subtree?
- securityRecipe stringId 
- The unique identifier of the security zone recipe. (SecurityReciperesource).
- state string
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- compartment_id str
- The OCID of the compartment in which to list resources.
- display_name str
- A filter to return only resources that match the entire display name given.
- filters
Sequence[GetSecurity Zones Filter] 
- id str
- The unique identifier of the security zone (SecurityZoneresource).
- is_required_ boolsecurity_ zones_ in_ subtree 
- Is security zones in the subtree?
- security_recipe_ strid 
- The unique identifier of the security zone recipe. (SecurityReciperesource).
- state str
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- compartmentId String
- The OCID of the compartment in which to list resources.
- displayName String
- A filter to return only resources that match the entire display name given.
- filters List<Property Map>
- id String
- The unique identifier of the security zone (SecurityZoneresource).
- isRequired BooleanSecurity Zones In Subtree 
- Is security zones in the subtree?
- securityRecipe StringId 
- The unique identifier of the security zone recipe. (SecurityReciperesource).
- state String
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
getSecurityZones Result
The following output properties are available:
- CompartmentId string
- The OCID of the compartment for the security zone
- SecurityZone List<GetCollections Security Zones Security Zone Collection> 
- The list of security_zone_collection.
- DisplayName string
- The security zone's display name
- Filters
List<GetSecurity Zones Filter> 
- Id string
- Unique identifier that can’t be changed after creation
- IsRequired boolSecurity Zones In Subtree 
- SecurityRecipe stringId 
- State string
- The current lifecycle state of the security zone
- CompartmentId string
- The OCID of the compartment for the security zone
- SecurityZone []GetCollections Security Zones Security Zone Collection 
- The list of security_zone_collection.
- DisplayName string
- The security zone's display name
- Filters
[]GetSecurity Zones Filter 
- Id string
- Unique identifier that can’t be changed after creation
- IsRequired boolSecurity Zones In Subtree 
- SecurityRecipe stringId 
- State string
- The current lifecycle state of the security zone
- compartmentId String
- The OCID of the compartment for the security zone
- securityZone List<GetCollections Security Zones Security Zone Collection> 
- The list of security_zone_collection.
- displayName String
- The security zone's display name
- filters
List<GetSecurity Zones Filter> 
- id String
- Unique identifier that can’t be changed after creation
- isRequired BooleanSecurity Zones In Subtree 
- securityRecipe StringId 
- state String
- The current lifecycle state of the security zone
- compartmentId string
- The OCID of the compartment for the security zone
- securityZone GetCollections Security Zones Security Zone Collection[] 
- The list of security_zone_collection.
- displayName string
- The security zone's display name
- filters
GetSecurity Zones Filter[] 
- id string
- Unique identifier that can’t be changed after creation
- isRequired booleanSecurity Zones In Subtree 
- securityRecipe stringId 
- state string
- The current lifecycle state of the security zone
- compartment_id str
- The OCID of the compartment for the security zone
- security_zone_ Sequence[Getcollections Security Zones Security Zone Collection] 
- The list of security_zone_collection.
- display_name str
- The security zone's display name
- filters
Sequence[GetSecurity Zones Filter] 
- id str
- Unique identifier that can’t be changed after creation
- is_required_ boolsecurity_ zones_ in_ subtree 
- security_recipe_ strid 
- state str
- The current lifecycle state of the security zone
- compartmentId String
- The OCID of the compartment for the security zone
- securityZone List<Property Map>Collections 
- The list of security_zone_collection.
- displayName String
- The security zone's display name
- filters List<Property Map>
- id String
- Unique identifier that can’t be changed after creation
- isRequired BooleanSecurity Zones In Subtree 
- securityRecipe StringId 
- state String
- The current lifecycle state of the security zone
Supporting Types
GetSecurityZonesFilter   
GetSecurityZonesSecurityZoneCollection     
GetSecurityZonesSecurityZoneCollectionItem      
- CompartmentId string
- The OCID of the compartment in which to list resources.
- Dictionary<string, string>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
- Description string
- The security zone's description
- DisplayName string
- A filter to return only resources that match the entire display name given.
- Dictionary<string, string>
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- Id string
- The unique identifier of the security zone (SecurityZoneresource).
- InheritedBy List<string>Compartments 
- List of inherited compartments
- LifecycleDetails string
- A message describing the current state in more detail. For example, this can be used to provide actionable information for a zone in the Failedstate.
- SecurityZone stringRecipe Id 
- The OCID of the recipe (SecurityReciperesource) for the security zone
- SecurityZone stringTarget Id 
- The OCID of the target associated with the security zone
- State string
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- TimeCreated string
- The time the security zone was created. An RFC3339 formatted datetime string.
- TimeUpdated string
- The time the security zone was last updated. An RFC3339 formatted datetime string.
- CompartmentId string
- The OCID of the compartment in which to list resources.
- map[string]string
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
- Description string
- The security zone's description
- DisplayName string
- A filter to return only resources that match the entire display name given.
- map[string]string
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- Id string
- The unique identifier of the security zone (SecurityZoneresource).
- InheritedBy []stringCompartments 
- List of inherited compartments
- LifecycleDetails string
- A message describing the current state in more detail. For example, this can be used to provide actionable information for a zone in the Failedstate.
- SecurityZone stringRecipe Id 
- The OCID of the recipe (SecurityReciperesource) for the security zone
- SecurityZone stringTarget Id 
- The OCID of the target associated with the security zone
- State string
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- TimeCreated string
- The time the security zone was created. An RFC3339 formatted datetime string.
- TimeUpdated string
- The time the security zone was last updated. An RFC3339 formatted datetime string.
- compartmentId String
- The OCID of the compartment in which to list resources.
- Map<String,String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
- description String
- The security zone's description
- displayName String
- A filter to return only resources that match the entire display name given.
- Map<String,String>
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- id String
- The unique identifier of the security zone (SecurityZoneresource).
- inheritedBy List<String>Compartments 
- List of inherited compartments
- lifecycleDetails String
- A message describing the current state in more detail. For example, this can be used to provide actionable information for a zone in the Failedstate.
- securityZone StringRecipe Id 
- The OCID of the recipe (SecurityReciperesource) for the security zone
- securityZone StringTarget Id 
- The OCID of the target associated with the security zone
- state String
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- timeCreated String
- The time the security zone was created. An RFC3339 formatted datetime string.
- timeUpdated String
- The time the security zone was last updated. An RFC3339 formatted datetime string.
- compartmentId string
- The OCID of the compartment in which to list resources.
- {[key: string]: string}
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
- description string
- The security zone's description
- displayName string
- A filter to return only resources that match the entire display name given.
- {[key: string]: string}
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- id string
- The unique identifier of the security zone (SecurityZoneresource).
- inheritedBy string[]Compartments 
- List of inherited compartments
- lifecycleDetails string
- A message describing the current state in more detail. For example, this can be used to provide actionable information for a zone in the Failedstate.
- securityZone stringRecipe Id 
- The OCID of the recipe (SecurityReciperesource) for the security zone
- securityZone stringTarget Id 
- The OCID of the target associated with the security zone
- state string
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- timeCreated string
- The time the security zone was created. An RFC3339 formatted datetime string.
- timeUpdated string
- The time the security zone was last updated. An RFC3339 formatted datetime string.
- compartment_id str
- The OCID of the compartment in which to list resources.
- Mapping[str, str]
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
- description str
- The security zone's description
- display_name str
- A filter to return only resources that match the entire display name given.
- Mapping[str, str]
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- id str
- The unique identifier of the security zone (SecurityZoneresource).
- inherited_by_ Sequence[str]compartments 
- List of inherited compartments
- lifecycle_details str
- A message describing the current state in more detail. For example, this can be used to provide actionable information for a zone in the Failedstate.
- security_zone_ strrecipe_ id 
- The OCID of the recipe (SecurityReciperesource) for the security zone
- security_zone_ strtarget_ id 
- The OCID of the target associated with the security zone
- state str
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- time_created str
- The time the security zone was created. An RFC3339 formatted datetime string.
- time_updated str
- The time the security zone was last updated. An RFC3339 formatted datetime string.
- compartmentId String
- The OCID of the compartment in which to list resources.
- Map<String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
- description String
- The security zone's description
- displayName String
- A filter to return only resources that match the entire display name given.
- Map<String>
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- id String
- The unique identifier of the security zone (SecurityZoneresource).
- inheritedBy List<String>Compartments 
- List of inherited compartments
- lifecycleDetails String
- A message describing the current state in more detail. For example, this can be used to provide actionable information for a zone in the Failedstate.
- securityZone StringRecipe Id 
- The OCID of the recipe (SecurityReciperesource) for the security zone
- securityZone StringTarget Id 
- The OCID of the target associated with the security zone
- state String
- The field lifecycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.
- timeCreated String
- The time the security zone was created. An RFC3339 formatted datetime string.
- timeUpdated String
- The time the security zone was last updated. An RFC3339 formatted datetime string.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.