oci logo
Oracle Cloud Infrastructure v0.6.0, Jan 23 23

oci.CloudGuard.getSecurityZones

This data source provides the list of Security Zones in Oracle Cloud Infrastructure Cloud Guard service.

Gets a list of all security zones in a compartment.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testSecurityZones = Oci.CloudGuard.GetSecurityZones.Invoke(new()
    {
        CompartmentId = @var.Compartment_id,
        DisplayName = @var.Security_zone_display_name,
        Id = @var.Security_zone_id,
        IsRequiredSecurityZonesInSubtree = @var.Security_zone_is_required_security_zones_in_subtree,
        SecurityRecipeId = oci_cloud_guard_security_recipe.Test_security_recipe.Id,
        State = @var.Security_zone_state,
    });

});
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/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:                    _var.Compartment_id,
			DisplayName:                      pulumi.StringRef(_var.Security_zone_display_name),
			Id:                               pulumi.StringRef(_var.Security_zone_id),
			IsRequiredSecurityZonesInSubtree: pulumi.BoolRef(_var.Security_zone_is_required_security_zones_in_subtree),
			SecurityRecipeId:                 pulumi.StringRef(oci_cloud_guard_security_recipe.Test_security_recipe.Id),
			State:                            pulumi.StringRef(_var.Security_zone_state),
		}, 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.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(var_.compartment_id())
            .displayName(var_.security_zone_display_name())
            .id(var_.security_zone_id())
            .isRequiredSecurityZonesInSubtree(var_.security_zone_is_required_security_zones_in_subtree())
            .securityRecipeId(oci_cloud_guard_security_recipe.test_security_recipe().id())
            .state(var_.security_zone_state())
            .build());

    }
}
import pulumi
import pulumi_oci as oci

test_security_zones = oci.CloudGuard.get_security_zones(compartment_id=var["compartment_id"],
    display_name=var["security_zone_display_name"],
    id=var["security_zone_id"],
    is_required_security_zones_in_subtree=var["security_zone_is_required_security_zones_in_subtree"],
    security_recipe_id=oci_cloud_guard_security_recipe["test_security_recipe"]["id"],
    state=var["security_zone_state"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testSecurityZones = oci.CloudGuard.getSecurityZones({
    compartmentId: _var.compartment_id,
    displayName: _var.security_zone_display_name,
    id: _var.security_zone_id,
    isRequiredSecurityZonesInSubtree: _var.security_zone_is_required_security_zones_in_subtree,
    securityRecipeId: oci_cloud_guard_security_recipe.test_security_recipe.id,
    state: _var.security_zone_state,
});
variables:
  testSecurityZones:
    fn::invoke:
      Function: oci:CloudGuard:getSecurityZones
      Arguments:
        compartmentId: ${var.compartment_id}
        displayName: ${var.security_zone_display_name}
        id: ${var.security_zone_id}
        isRequiredSecurityZonesInSubtree: ${var.security_zone_is_required_security_zones_in_subtree}
        securityRecipeId: ${oci_cloud_guard_security_recipe.test_security_recipe.id}
        state: ${var.security_zone_state}

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 ID 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)

IsRequiredSecurityZonesInSubtree bool

security zones in the subtree

SecurityRecipeId string

The unique identifier of the security zone recipe (SecurityRecipe)

State string

The field life cycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.

CompartmentId string

The ID 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)

IsRequiredSecurityZonesInSubtree bool

security zones in the subtree

SecurityRecipeId string

The unique identifier of the security zone recipe (SecurityRecipe)

State string

The field life cycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.

compartmentId String

The ID 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)

isRequiredSecurityZonesInSubtree Boolean

security zones in the subtree

securityRecipeId String

The unique identifier of the security zone recipe (SecurityRecipe)

state String

The field life cycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.

compartmentId string

The ID 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)

isRequiredSecurityZonesInSubtree boolean

security zones in the subtree

securityRecipeId string

The unique identifier of the security zone recipe (SecurityRecipe)

state string

The field life cycle 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 ID 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 GetSecurityZonesFilter]
id str

The unique identifier of the security zone (SecurityZone)

is_required_security_zones_in_subtree bool

security zones in the subtree

security_recipe_id str

The unique identifier of the security zone recipe (SecurityRecipe)

state str

The field life cycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.

compartmentId String

The ID 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)

isRequiredSecurityZonesInSubtree Boolean

security zones in the subtree

securityRecipeId String

The unique identifier of the security zone recipe (SecurityRecipe)

state String

The field life cycle 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 name

Filters List<GetSecurityZonesFilter>
Id string

Unique identifier that is immutable on creation

IsRequiredSecurityZonesInSubtree bool
SecurityRecipeId string
State string

The current 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 name

Filters []GetSecurityZonesFilter
Id string

Unique identifier that is immutable on creation

IsRequiredSecurityZonesInSubtree bool
SecurityRecipeId string
State string

The current 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 name

filters List<GetSecurityZonesFilter>
id String

Unique identifier that is immutable on creation

isRequiredSecurityZonesInSubtree Boolean
securityRecipeId String
state String

The current 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 name

filters GetSecurityZonesFilter[]
id string

Unique identifier that is immutable on creation

isRequiredSecurityZonesInSubtree boolean
securityRecipeId string
state string

The current state of the security zone

compartment_id str

The OCID of the compartment for the security zone

security_zone_collections GetSecurityZonesSecurityZoneCollection]

The list of security_zone_collection.

display_name str

The security zone's name

filters GetSecurityZonesFilter]
id str

Unique identifier that is immutable on creation

is_required_security_zones_in_subtree bool
security_recipe_id str
state str

The current 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 name

filters List<Property Map>
id String

Unique identifier that is immutable on creation

isRequiredSecurityZonesInSubtree Boolean
securityRecipeId String
state String

The current 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 ID of the compartment in which to list resources.

DefinedTags Dictionary<string, object>

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, object>

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)

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) for the security zone

SecurityZoneTargetId string

The OCID of the target associated with the security zone

State string

The field life cycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.

SystemTags Dictionary<string, object>

System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}

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 ID of the compartment in which to list resources.

DefinedTags map[string]interface{}

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]interface{}

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)

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) for the security zone

SecurityZoneTargetId string

The OCID of the target associated with the security zone

State string

The field life cycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.

SystemTags map[string]interface{}

System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}

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 ID of the compartment in which to list resources.

definedTags Map<String,Object>

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,Object>

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)

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) for the security zone

securityZoneTargetId String

The OCID of the target associated with the security zone

state String

The field life cycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.

systemTags Map<String,Object>

System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}

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 ID of the compartment in which to list resources.

definedTags {[key: string]: any}

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]: any}

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)

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) for the security zone

securityZoneTargetId string

The OCID of the target associated with the security zone

state string

The field life cycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.

systemTags {[key: string]: any}

System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}

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 ID of the compartment in which to list resources.

defined_tags Mapping[str, Any]

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, Any]

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)

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) for the security zone

security_zone_target_id str

The OCID of the target associated with the security zone

state str

The field life cycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.

system_tags Mapping[str, Any]

System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}

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 ID of the compartment in which to list resources.

definedTags Map<Any>

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<Any>

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)

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) for the security zone

securityZoneTargetId String

The OCID of the target associated with the security zone

state String

The field life cycle state. Only one state can be provided. Default value for state is active. If no value is specified state is active.

systemTags Map<Any>

System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}

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.