oci logo
Oracle Cloud Infrastructure v0.20.0, May 31 23

oci.CloudGuard.SecurityZone

Explore with Pulumi AI

This resource provides the Security Zone resource in Oracle Cloud Infrastructure Cloud Guard service.

Creates a security zone for a compartment. A security zone enforces all security zone policies in a given security zone recipe. Any actions that violate a policy are denied. By default, any subcompartments are also in the same security zone.

Example Usage

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

return await Deployment.RunAsync(() => 
{
    var testSecurityZone = new Oci.CloudGuard.SecurityZone("testSecurityZone", new()
    {
        CompartmentId = @var.Compartment_id,
        DisplayName = @var.Security_zone_display_name,
        SecurityZoneRecipeId = oci_cloud_guard_security_zone_recipe.Test_security_zone_recipe.Id,
        DefinedTags = 
        {
            { "foo-namespace.bar-key", "value" },
        },
        Description = @var.Security_zone_description,
        FreeformTags = 
        {
            { "bar-key", "value" },
        },
    });

});
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.NewSecurityZone(ctx, "testSecurityZone", &CloudGuard.SecurityZoneArgs{
			CompartmentId:        pulumi.Any(_var.Compartment_id),
			DisplayName:          pulumi.Any(_var.Security_zone_display_name),
			SecurityZoneRecipeId: pulumi.Any(oci_cloud_guard_security_zone_recipe.Test_security_zone_recipe.Id),
			DefinedTags: pulumi.AnyMap{
				"foo-namespace.bar-key": pulumi.Any("value"),
			},
			Description: pulumi.Any(_var.Security_zone_description),
			FreeformTags: pulumi.AnyMap{
				"bar-key": pulumi.Any("value"),
			},
		})
		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.SecurityZone;
import com.pulumi.oci.CloudGuard.SecurityZoneArgs;
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) {
        var testSecurityZone = new SecurityZone("testSecurityZone", SecurityZoneArgs.builder()        
            .compartmentId(var_.compartment_id())
            .displayName(var_.security_zone_display_name())
            .securityZoneRecipeId(oci_cloud_guard_security_zone_recipe.test_security_zone_recipe().id())
            .definedTags(Map.of("foo-namespace.bar-key", "value"))
            .description(var_.security_zone_description())
            .freeformTags(Map.of("bar-key", "value"))
            .build());

    }
}
import pulumi
import pulumi_oci as oci

test_security_zone = oci.cloud_guard.SecurityZone("testSecurityZone",
    compartment_id=var["compartment_id"],
    display_name=var["security_zone_display_name"],
    security_zone_recipe_id=oci_cloud_guard_security_zone_recipe["test_security_zone_recipe"]["id"],
    defined_tags={
        "foo-namespace.bar-key": "value",
    },
    description=var["security_zone_description"],
    freeform_tags={
        "bar-key": "value",
    })
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testSecurityZone = new oci.cloudguard.SecurityZone("testSecurityZone", {
    compartmentId: _var.compartment_id,
    displayName: _var.security_zone_display_name,
    securityZoneRecipeId: oci_cloud_guard_security_zone_recipe.test_security_zone_recipe.id,
    definedTags: {
        "foo-namespace.bar-key": "value",
    },
    description: _var.security_zone_description,
    freeformTags: {
        "bar-key": "value",
    },
});
resources:
  testSecurityZone:
    type: oci:CloudGuard:SecurityZone
    properties:
      #Required
      compartmentId: ${var.compartment_id}
      displayName: ${var.security_zone_display_name}
      securityZoneRecipeId: ${oci_cloud_guard_security_zone_recipe.test_security_zone_recipe.id}
      #Optional
      definedTags:
        foo-namespace.bar-key: value
      description: ${var.security_zone_description}
      freeformTags:
        bar-key: value

Create SecurityZone Resource

new SecurityZone(name: string, args: SecurityZoneArgs, opts?: CustomResourceOptions);
@overload
def SecurityZone(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 compartment_id: Optional[str] = None,
                 defined_tags: Optional[Mapping[str, Any]] = None,
                 description: Optional[str] = None,
                 display_name: Optional[str] = None,
                 freeform_tags: Optional[Mapping[str, Any]] = None,
                 security_zone_recipe_id: Optional[str] = None)
@overload
def SecurityZone(resource_name: str,
                 args: SecurityZoneArgs,
                 opts: Optional[ResourceOptions] = None)
func NewSecurityZone(ctx *Context, name string, args SecurityZoneArgs, opts ...ResourceOption) (*SecurityZone, error)
public SecurityZone(string name, SecurityZoneArgs args, CustomResourceOptions? opts = null)
public SecurityZone(String name, SecurityZoneArgs args)
public SecurityZone(String name, SecurityZoneArgs args, CustomResourceOptions options)
type: oci:CloudGuard:SecurityZone
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args SecurityZoneArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args SecurityZoneArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SecurityZoneArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SecurityZoneArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args SecurityZoneArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

SecurityZone Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The SecurityZone resource accepts the following input properties:

CompartmentId string

(Updatable) The OCID of the compartment for the security zone

DisplayName string

(Updatable) The security zone's name

SecurityZoneRecipeId string

(Updatable) The OCID of the recipe (SecurityRecipe) for the security zone

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

DefinedTags Dictionary<string, object>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

Description string

(Updatable) The security zone's description

FreeformTags Dictionary<string, object>

(Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

Avoid entering confidential information.

CompartmentId string

(Updatable) The OCID of the compartment for the security zone

DisplayName string

(Updatable) The security zone's name

SecurityZoneRecipeId string

(Updatable) The OCID of the recipe (SecurityRecipe) for the security zone

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

DefinedTags map[string]interface{}

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

Description string

(Updatable) The security zone's description

FreeformTags map[string]interface{}

(Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

Avoid entering confidential information.

compartmentId String

(Updatable) The OCID of the compartment for the security zone

displayName String

(Updatable) The security zone's name

securityZoneRecipeId String

(Updatable) The OCID of the recipe (SecurityRecipe) for the security zone

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

definedTags Map<String,Object>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

description String

(Updatable) The security zone's description

freeformTags Map<String,Object>

(Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

Avoid entering confidential information.

compartmentId string

(Updatable) The OCID of the compartment for the security zone

displayName string

(Updatable) The security zone's name

securityZoneRecipeId string

(Updatable) The OCID of the recipe (SecurityRecipe) for the security zone

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

definedTags {[key: string]: any}

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

description string

(Updatable) The security zone's description

freeformTags {[key: string]: any}

(Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

Avoid entering confidential information.

compartment_id str

(Updatable) The OCID of the compartment for the security zone

display_name str

(Updatable) The security zone's name

security_zone_recipe_id str

(Updatable) The OCID of the recipe (SecurityRecipe) for the security zone

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

defined_tags Mapping[str, Any]

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

description str

(Updatable) The security zone's description

freeform_tags Mapping[str, Any]

(Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

Avoid entering confidential information.

compartmentId String

(Updatable) The OCID of the compartment for the security zone

displayName String

(Updatable) The security zone's name

securityZoneRecipeId String

(Updatable) The OCID of the recipe (SecurityRecipe) for the security zone

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

definedTags Map<Any>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

description String

(Updatable) The security zone's description

freeformTags Map<Any>

(Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

Avoid entering confidential information.

Outputs

All input properties are implicitly available as output properties. Additionally, the SecurityZone resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed 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.

SecurityZoneTargetId string

The OCID of the target associated with the security zone

State string

The current state of the security zone

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.

Id string

The provider-assigned unique ID for this managed 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.

SecurityZoneTargetId string

The OCID of the target associated with the security zone

State string

The current state of the security zone

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.

id String

The provider-assigned unique ID for this managed 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.

securityZoneTargetId String

The OCID of the target associated with the security zone

state String

The current state of the security zone

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.

id string

The provider-assigned unique ID for this managed 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.

securityZoneTargetId string

The OCID of the target associated with the security zone

state string

The current state of the security zone

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.

id str

The provider-assigned unique ID for this managed 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_target_id str

The OCID of the target associated with the security zone

state str

The current state of the security zone

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.

id String

The provider-assigned unique ID for this managed 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.

securityZoneTargetId String

The OCID of the target associated with the security zone

state String

The current state of the security zone

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.

Look up Existing SecurityZone Resource

Get an existing SecurityZone resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: SecurityZoneState, opts?: CustomResourceOptions): SecurityZone
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        compartment_id: Optional[str] = None,
        defined_tags: Optional[Mapping[str, Any]] = None,
        description: Optional[str] = None,
        display_name: Optional[str] = None,
        freeform_tags: Optional[Mapping[str, Any]] = None,
        inherited_by_compartments: Optional[Sequence[str]] = None,
        lifecycle_details: Optional[str] = None,
        security_zone_recipe_id: Optional[str] = None,
        security_zone_target_id: Optional[str] = None,
        state: Optional[str] = None,
        time_created: Optional[str] = None,
        time_updated: Optional[str] = None) -> SecurityZone
func GetSecurityZone(ctx *Context, name string, id IDInput, state *SecurityZoneState, opts ...ResourceOption) (*SecurityZone, error)
public static SecurityZone Get(string name, Input<string> id, SecurityZoneState? state, CustomResourceOptions? opts = null)
public static SecurityZone get(String name, Output<String> id, SecurityZoneState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CompartmentId string

(Updatable) The OCID of the compartment for the security zone

DefinedTags Dictionary<string, object>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

Description string

(Updatable) The security zone's description

DisplayName string

(Updatable) The security zone's name

FreeformTags Dictionary<string, object>

(Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

Avoid entering confidential information.

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

(Updatable) The OCID of the recipe (SecurityRecipe) for the security zone

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

SecurityZoneTargetId string

The OCID of the target associated with the security zone

State string

The current state of the security zone

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

(Updatable) The OCID of the compartment for the security zone

DefinedTags map[string]interface{}

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

Description string

(Updatable) The security zone's description

DisplayName string

(Updatable) The security zone's name

FreeformTags map[string]interface{}

(Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

Avoid entering confidential information.

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

(Updatable) The OCID of the recipe (SecurityRecipe) for the security zone

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

SecurityZoneTargetId string

The OCID of the target associated with the security zone

State string

The current state of the security zone

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

(Updatable) The OCID of the compartment for the security zone

definedTags Map<String,Object>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

description String

(Updatable) The security zone's description

displayName String

(Updatable) The security zone's name

freeformTags Map<String,Object>

(Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

Avoid entering confidential information.

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

(Updatable) The OCID of the recipe (SecurityRecipe) for the security zone

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

securityZoneTargetId String

The OCID of the target associated with the security zone

state String

The current state of the security zone

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

(Updatable) The OCID of the compartment for the security zone

definedTags {[key: string]: any}

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

description string

(Updatable) The security zone's description

displayName string

(Updatable) The security zone's name

freeformTags {[key: string]: any}

(Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

Avoid entering confidential information.

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

(Updatable) The OCID of the recipe (SecurityRecipe) for the security zone

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

securityZoneTargetId string

The OCID of the target associated with the security zone

state string

The current state of the security zone

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

(Updatable) The OCID of the compartment for the security zone

defined_tags Mapping[str, Any]

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

description str

(Updatable) The security zone's description

display_name str

(Updatable) The security zone's name

freeform_tags Mapping[str, Any]

(Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

Avoid entering confidential information.

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

(Updatable) The OCID of the recipe (SecurityRecipe) for the security zone

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

security_zone_target_id str

The OCID of the target associated with the security zone

state str

The current state of the security zone

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

(Updatable) The OCID of the compartment for the security zone

definedTags Map<Any>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

description String

(Updatable) The security zone's description

displayName String

(Updatable) The security zone's name

freeformTags Map<Any>

(Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

Avoid entering confidential information.

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

(Updatable) The OCID of the recipe (SecurityRecipe) for the security zone

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

securityZoneTargetId String

The OCID of the target associated with the security zone

state String

The current state of the security zone

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.

Import

SecurityZones can be imported using the id, e.g.

 $ pulumi import oci:CloudGuard/securityZone:SecurityZone test_security_zone "id"

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes

This Pulumi package is based on the oci Terraform Provider.