Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.CloudGuard.getSecurityPolicies
Explore with Pulumi AI
This data source provides the list of Security Policies in Oracle Cloud Infrastructure Cloud Guard service.
Returns a list of security zone policies (SecurityPolicySummary resources), identified by compartmentId.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testSecurityPolicies = oci.CloudGuard.getSecurityPolicies({
    compartmentId: compartmentId,
    displayName: securityPolicyDisplayName,
    id: securityPolicyId,
    state: securityPolicyState,
});
import pulumi
import pulumi_oci as oci
test_security_policies = oci.CloudGuard.get_security_policies(compartment_id=compartment_id,
    display_name=security_policy_display_name,
    id=security_policy_id,
    state=security_policy_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.GetSecurityPolicies(ctx, &cloudguard.GetSecurityPoliciesArgs{
			CompartmentId: compartmentId,
			DisplayName:   pulumi.StringRef(securityPolicyDisplayName),
			Id:            pulumi.StringRef(securityPolicyId),
			State:         pulumi.StringRef(securityPolicyState),
		}, 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 testSecurityPolicies = Oci.CloudGuard.GetSecurityPolicies.Invoke(new()
    {
        CompartmentId = compartmentId,
        DisplayName = securityPolicyDisplayName,
        Id = securityPolicyId,
        State = securityPolicyState,
    });
});
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.GetSecurityPoliciesArgs;
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 testSecurityPolicies = CloudGuardFunctions.getSecurityPolicies(GetSecurityPoliciesArgs.builder()
            .compartmentId(compartmentId)
            .displayName(securityPolicyDisplayName)
            .id(securityPolicyId)
            .state(securityPolicyState)
            .build());
    }
}
variables:
  testSecurityPolicies:
    fn::invoke:
      function: oci:CloudGuard:getSecurityPolicies
      arguments:
        compartmentId: ${compartmentId}
        displayName: ${securityPolicyDisplayName}
        id: ${securityPolicyId}
        state: ${securityPolicyState}
Using getSecurityPolicies
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 getSecurityPolicies(args: GetSecurityPoliciesArgs, opts?: InvokeOptions): Promise<GetSecurityPoliciesResult>
function getSecurityPoliciesOutput(args: GetSecurityPoliciesOutputArgs, opts?: InvokeOptions): Output<GetSecurityPoliciesResult>def get_security_policies(compartment_id: Optional[str] = None,
                          display_name: Optional[str] = None,
                          filters: Optional[Sequence[GetSecurityPoliciesFilter]] = None,
                          id: Optional[str] = None,
                          state: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetSecurityPoliciesResult
def get_security_policies_output(compartment_id: Optional[pulumi.Input[str]] = None,
                          display_name: Optional[pulumi.Input[str]] = None,
                          filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetSecurityPoliciesFilterArgs]]]] = None,
                          id: Optional[pulumi.Input[str]] = None,
                          state: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetSecurityPoliciesResult]func GetSecurityPolicies(ctx *Context, args *GetSecurityPoliciesArgs, opts ...InvokeOption) (*GetSecurityPoliciesResult, error)
func GetSecurityPoliciesOutput(ctx *Context, args *GetSecurityPoliciesOutputArgs, opts ...InvokeOption) GetSecurityPoliciesResultOutput> Note: This function is named GetSecurityPolicies in the Go SDK.
public static class GetSecurityPolicies 
{
    public static Task<GetSecurityPoliciesResult> InvokeAsync(GetSecurityPoliciesArgs args, InvokeOptions? opts = null)
    public static Output<GetSecurityPoliciesResult> Invoke(GetSecurityPoliciesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSecurityPoliciesResult> getSecurityPolicies(GetSecurityPoliciesArgs args, InvokeOptions options)
public static Output<GetSecurityPoliciesResult> getSecurityPolicies(GetSecurityPoliciesArgs args, InvokeOptions options)
fn::invoke:
  function: oci:CloudGuard/getSecurityPolicies:getSecurityPolicies
  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 Policies Filter> 
- Id string
- The unique identifier of the security zone policy. (SecurityPolicy)
- 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 Policies Filter 
- Id string
- The unique identifier of the security zone policy. (SecurityPolicy)
- 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 Policies Filter> 
- id String
- The unique identifier of the security zone policy. (SecurityPolicy)
- 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 Policies Filter[] 
- id string
- The unique identifier of the security zone policy. (SecurityPolicy)
- 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 Policies Filter] 
- id str
- The unique identifier of the security zone policy. (SecurityPolicy)
- 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 policy. (SecurityPolicy)
- 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.
getSecurityPolicies Result
The following output properties are available:
- CompartmentId string
- The OCID of the security policy's compartment
- SecurityPolicy List<GetCollections Security Policies Security Policy Collection> 
- The list of security_policy_collection.
- DisplayName string
- The security policy's display name
- Filters
List<GetSecurity Policies Filter> 
- Id string
- Unique identifier that can’t be changed after creation
- State string
- The current lifecycle state of the security policy
- CompartmentId string
- The OCID of the security policy's compartment
- SecurityPolicy []GetCollections Security Policies Security Policy Collection 
- The list of security_policy_collection.
- DisplayName string
- The security policy's display name
- Filters
[]GetSecurity Policies Filter 
- Id string
- Unique identifier that can’t be changed after creation
- State string
- The current lifecycle state of the security policy
- compartmentId String
- The OCID of the security policy's compartment
- securityPolicy List<GetCollections Security Policies Security Policy Collection> 
- The list of security_policy_collection.
- displayName String
- The security policy's display name
- filters
List<GetSecurity Policies Filter> 
- id String
- Unique identifier that can’t be changed after creation
- state String
- The current lifecycle state of the security policy
- compartmentId string
- The OCID of the security policy's compartment
- securityPolicy GetCollections Security Policies Security Policy Collection[] 
- The list of security_policy_collection.
- displayName string
- The security policy's display name
- filters
GetSecurity Policies Filter[] 
- id string
- Unique identifier that can’t be changed after creation
- state string
- The current lifecycle state of the security policy
- compartment_id str
- The OCID of the security policy's compartment
- security_policy_ Sequence[Getcollections Security Policies Security Policy Collection] 
- The list of security_policy_collection.
- display_name str
- The security policy's display name
- filters
Sequence[GetSecurity Policies Filter] 
- id str
- Unique identifier that can’t be changed after creation
- state str
- The current lifecycle state of the security policy
- compartmentId String
- The OCID of the security policy's compartment
- securityPolicy List<Property Map>Collections 
- The list of security_policy_collection.
- displayName String
- The security policy's display name
- filters List<Property Map>
- id String
- Unique identifier that can’t be changed after creation
- state String
- The current lifecycle state of the security policy
Supporting Types
GetSecurityPoliciesFilter   
GetSecurityPoliciesSecurityPolicyCollection     
GetSecurityPoliciesSecurityPolicyCollectionItem      
- Category string
- The category of the security policy
- 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 policy'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"}
- FriendlyName string
- A shorter version of the security policy's name
- Id string
- The unique identifier of the security zone policy. (SecurityPolicy)
- LifecycleDetails string
- A message describing the current state in more detail. For example, this can be used to provide actionable information for a resource in a Failedstate.
- Owner string
- The owner of the security policy
- Services List<string>
- The list of services that the security policy protects
- 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 policy was created. An RFC3339 formatted datetime string.
- TimeUpdated string
- The time the security policy was last updated. An RFC3339 formatted datetime string.
- Category string
- The category of the security policy
- 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 policy'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"}
- FriendlyName string
- A shorter version of the security policy's name
- Id string
- The unique identifier of the security zone policy. (SecurityPolicy)
- LifecycleDetails string
- A message describing the current state in more detail. For example, this can be used to provide actionable information for a resource in a Failedstate.
- Owner string
- The owner of the security policy
- Services []string
- The list of services that the security policy protects
- 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 policy was created. An RFC3339 formatted datetime string.
- TimeUpdated string
- The time the security policy was last updated. An RFC3339 formatted datetime string.
- category String
- The category of the security policy
- 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 policy'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"}
- friendlyName String
- A shorter version of the security policy's name
- id String
- The unique identifier of the security zone policy. (SecurityPolicy)
- lifecycleDetails String
- A message describing the current state in more detail. For example, this can be used to provide actionable information for a resource in a Failedstate.
- owner String
- The owner of the security policy
- services List<String>
- The list of services that the security policy protects
- 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 policy was created. An RFC3339 formatted datetime string.
- timeUpdated String
- The time the security policy was last updated. An RFC3339 formatted datetime string.
- category string
- The category of the security policy
- 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 policy'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"}
- friendlyName string
- A shorter version of the security policy's name
- id string
- The unique identifier of the security zone policy. (SecurityPolicy)
- lifecycleDetails string
- A message describing the current state in more detail. For example, this can be used to provide actionable information for a resource in a Failedstate.
- owner string
- The owner of the security policy
- services string[]
- The list of services that the security policy protects
- 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 policy was created. An RFC3339 formatted datetime string.
- timeUpdated string
- The time the security policy was last updated. An RFC3339 formatted datetime string.
- category str
- The category of the security policy
- 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 policy'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"}
- friendly_name str
- A shorter version of the security policy's name
- id str
- The unique identifier of the security zone policy. (SecurityPolicy)
- lifecycle_details str
- A message describing the current state in more detail. For example, this can be used to provide actionable information for a resource in a Failedstate.
- owner str
- The owner of the security policy
- services Sequence[str]
- The list of services that the security policy protects
- 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 policy was created. An RFC3339 formatted datetime string.
- time_updated str
- The time the security policy was last updated. An RFC3339 formatted datetime string.
- category String
- The category of the security policy
- 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 policy'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"}
- friendlyName String
- A shorter version of the security policy's name
- id String
- The unique identifier of the security zone policy. (SecurityPolicy)
- lifecycleDetails String
- A message describing the current state in more detail. For example, this can be used to provide actionable information for a resource in a Failedstate.
- owner String
- The owner of the security policy
- services List<String>
- The list of services that the security policy protects
- 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 policy was created. An RFC3339 formatted datetime string.
- timeUpdated String
- The time the security policy 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.