1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. CloudGuard
  5. getSecurityZones
Oracle Cloud Infrastructure v2.12.0 published on Friday, Oct 11, 2024 by Pulumi

oci.CloudGuard.getSecurityZones

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.12.0 published on Friday, Oct 11, 2024 by Pulumi

    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[_cloudguard.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[_cloudguard.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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:CloudGuard/getSecurityZones:getSecurityZones
      arguments:
        # arguments dictionary

    The 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<GetSecurityZonesFilter>
    Id string
    The unique identifier of the security zone (SecurityZone resource).
    IsRequiredSecurityZonesInSubtree bool
    Is security zones in the subtree?
    SecurityRecipeId string
    The unique identifier of the security zone recipe. (SecurityRecipe resource).
    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 []GetSecurityZonesFilter
    Id string
    The unique identifier of the security zone (SecurityZone resource).
    IsRequiredSecurityZonesInSubtree bool
    Is security zones in the subtree?
    SecurityRecipeId string
    The unique identifier of the security zone recipe. (SecurityRecipe resource).
    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<GetSecurityZonesFilter>
    id String
    The unique identifier of the security zone (SecurityZone resource).
    isRequiredSecurityZonesInSubtree Boolean
    Is security zones in the subtree?
    securityRecipeId String
    The unique identifier of the security zone recipe. (SecurityRecipe resource).
    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 GetSecurityZonesFilter[]
    id string
    The unique identifier of the security zone (SecurityZone resource).
    isRequiredSecurityZonesInSubtree boolean
    Is security zones in the subtree?
    securityRecipeId string
    The unique identifier of the security zone recipe. (SecurityRecipe resource).
    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[cloudguard.GetSecurityZonesFilter]
    id str
    The unique identifier of the security zone (SecurityZone resource).
    is_required_security_zones_in_subtree bool
    Is security zones in the subtree?
    security_recipe_id str
    The unique identifier of the security zone recipe. (SecurityRecipe resource).
    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 (SecurityZone resource).
    isRequiredSecurityZonesInSubtree Boolean
    Is security zones in the subtree?
    securityRecipeId String
    The unique identifier of the security zone recipe. (SecurityRecipe resource).
    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
    SecurityZoneCollections List<GetSecurityZonesSecurityZoneCollection>
    The list of security_zone_collection.
    DisplayName string
    The security zone's display name
    Filters List<GetSecurityZonesFilter>
    Id string
    Unique identifier that can’t be changed after creation
    IsRequiredSecurityZonesInSubtree bool
    SecurityRecipeId string
    State string
    The current lifecycle state of the security zone
    CompartmentId string
    The OCID of the compartment for the security zone
    SecurityZoneCollections []GetSecurityZonesSecurityZoneCollection
    The list of security_zone_collection.
    DisplayName string
    The security zone's display name
    Filters []GetSecurityZonesFilter
    Id string
    Unique identifier that can’t be changed after creation
    IsRequiredSecurityZonesInSubtree bool
    SecurityRecipeId string
    State string
    The current lifecycle state of the security zone
    compartmentId String
    The OCID of the compartment for the security zone
    securityZoneCollections List<GetSecurityZonesSecurityZoneCollection>
    The list of security_zone_collection.
    displayName String
    The security zone's display name
    filters List<GetSecurityZonesFilter>
    id String
    Unique identifier that can’t be changed after creation
    isRequiredSecurityZonesInSubtree Boolean
    securityRecipeId String
    state String
    The current lifecycle state of the security zone
    compartmentId string
    The OCID of the compartment for the security zone
    securityZoneCollections GetSecurityZonesSecurityZoneCollection[]
    The list of security_zone_collection.
    displayName string
    The security zone's display name
    filters GetSecurityZonesFilter[]
    id string
    Unique identifier that can’t be changed after creation
    isRequiredSecurityZonesInSubtree boolean
    securityRecipeId string
    state string
    The current lifecycle state of the security zone
    compartment_id str
    The OCID of the compartment for the security zone
    security_zone_collections Sequence[cloudguard.GetSecurityZonesSecurityZoneCollection]
    The list of security_zone_collection.
    display_name str
    The security zone's display name
    filters Sequence[cloudguard.GetSecurityZonesFilter]
    id str
    Unique identifier that can’t be changed after creation
    is_required_security_zones_in_subtree bool
    security_recipe_id str
    state str
    The current lifecycle state of the security zone
    compartmentId String
    The OCID of the compartment for the security zone
    securityZoneCollections List<Property Map>
    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
    isRequiredSecurityZonesInSubtree Boolean
    securityRecipeId String
    state String
    The current lifecycle state of the security zone

    Supporting Types

    GetSecurityZonesFilter

    Name string
    Values List<string>
    Regex bool
    Name string
    Values []string
    Regex bool
    name String
    values List<String>
    regex Boolean
    name string
    values string[]
    regex boolean
    name str
    values Sequence[str]
    regex bool
    name String
    values List<String>
    regex Boolean

    GetSecurityZonesSecurityZoneCollection

    GetSecurityZonesSecurityZoneCollectionItem

    CompartmentId string
    The OCID of the compartment in which to list resources.
    DefinedTags 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.
    FreeformTags 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 (SecurityZone resource).
    InheritedByCompartments List<string>
    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 Failed state.
    SecurityZoneRecipeId string
    The OCID of the recipe (SecurityRecipe resource) for the security zone
    SecurityZoneTargetId string
    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.
    DefinedTags 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.
    FreeformTags 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 (SecurityZone resource).
    InheritedByCompartments []string
    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 Failed state.
    SecurityZoneRecipeId string
    The OCID of the recipe (SecurityRecipe resource) for the security zone
    SecurityZoneTargetId string
    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.
    definedTags 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.
    freeformTags 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 (SecurityZone resource).
    inheritedByCompartments List<String>
    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 Failed state.
    securityZoneRecipeId String
    The OCID of the recipe (SecurityRecipe resource) for the security zone
    securityZoneTargetId String
    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.
    definedTags {[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.
    freeformTags {[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 (SecurityZone resource).
    inheritedByCompartments string[]
    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 Failed state.
    securityZoneRecipeId string
    The OCID of the recipe (SecurityRecipe resource) for the security zone
    securityZoneTargetId string
    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.
    defined_tags 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.
    freeform_tags 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 (SecurityZone resource).
    inherited_by_compartments Sequence[str]
    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 Failed state.
    security_zone_recipe_id str
    The OCID of the recipe (SecurityRecipe resource) for the security zone
    security_zone_target_id str
    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.
    definedTags 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.
    freeformTags 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 (SecurityZone resource).
    inheritedByCompartments List<String>
    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 Failed state.
    securityZoneRecipeId String
    The OCID of the recipe (SecurityRecipe resource) for the security zone
    securityZoneTargetId String
    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 oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.12.0 published on Friday, Oct 11, 2024 by Pulumi