oci.DataSafe.getSecurityPolicyReports
Explore with Pulumi AI
This data source provides the list of Security Policy Reports in Oracle Cloud Infrastructure Data Safe service.
Retrieves a list of all security policy reports in Data Safe.
The ListSecurityPolicyReports operation returns only the security policy reports in the specified compartmentId.
The parameter accessLevel specifies whether to return only those compartments for which the
requestor has INSPECT permissions on at least one resource directly
or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if
Principal doesn’t have access to even one of the child compartments. This is valid only when
compartmentIdInSubtree is set to true.
The parameter compartmentIdInSubtree applies when you perform ListSecurityPolicyReports on the
compartmentId passed and when it is set to true, the entire hierarchy of compartments can be returned.
To get a full list of all compartments and subcompartments in the tenancy (root compartment),
set the parameter compartmentIdInSubtree to true and accessLevel to ACCESSIBLE.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testSecurityPolicyReports = oci.DataSafe.getSecurityPolicyReports({
    compartmentId: compartmentId,
    accessLevel: securityPolicyReportAccessLevel,
    compartmentIdInSubtree: securityPolicyReportCompartmentIdInSubtree,
    displayName: securityPolicyReportDisplayName,
    securityPolicyReportId: testSecurityPolicyReport.id,
    state: securityPolicyReportState,
    targetId: testTarget.id,
});
import pulumi
import pulumi_oci as oci
test_security_policy_reports = oci.DataSafe.get_security_policy_reports(compartment_id=compartment_id,
    access_level=security_policy_report_access_level,
    compartment_id_in_subtree=security_policy_report_compartment_id_in_subtree,
    display_name=security_policy_report_display_name,
    security_policy_report_id=test_security_policy_report["id"],
    state=security_policy_report_state,
    target_id=test_target["id"])
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/datasafe"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := datasafe.GetSecurityPolicyReports(ctx, &datasafe.GetSecurityPolicyReportsArgs{
			CompartmentId:          compartmentId,
			AccessLevel:            pulumi.StringRef(securityPolicyReportAccessLevel),
			CompartmentIdInSubtree: pulumi.BoolRef(securityPolicyReportCompartmentIdInSubtree),
			DisplayName:            pulumi.StringRef(securityPolicyReportDisplayName),
			SecurityPolicyReportId: pulumi.StringRef(testSecurityPolicyReport.Id),
			State:                  pulumi.StringRef(securityPolicyReportState),
			TargetId:               pulumi.StringRef(testTarget.Id),
		}, 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 testSecurityPolicyReports = Oci.DataSafe.GetSecurityPolicyReports.Invoke(new()
    {
        CompartmentId = compartmentId,
        AccessLevel = securityPolicyReportAccessLevel,
        CompartmentIdInSubtree = securityPolicyReportCompartmentIdInSubtree,
        DisplayName = securityPolicyReportDisplayName,
        SecurityPolicyReportId = testSecurityPolicyReport.Id,
        State = securityPolicyReportState,
        TargetId = testTarget.Id,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.DataSafe.DataSafeFunctions;
import com.pulumi.oci.DataSafe.inputs.GetSecurityPolicyReportsArgs;
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 testSecurityPolicyReports = DataSafeFunctions.getSecurityPolicyReports(GetSecurityPolicyReportsArgs.builder()
            .compartmentId(compartmentId)
            .accessLevel(securityPolicyReportAccessLevel)
            .compartmentIdInSubtree(securityPolicyReportCompartmentIdInSubtree)
            .displayName(securityPolicyReportDisplayName)
            .securityPolicyReportId(testSecurityPolicyReport.id())
            .state(securityPolicyReportState)
            .targetId(testTarget.id())
            .build());
    }
}
variables:
  testSecurityPolicyReports:
    fn::invoke:
      function: oci:DataSafe:getSecurityPolicyReports
      arguments:
        compartmentId: ${compartmentId}
        accessLevel: ${securityPolicyReportAccessLevel}
        compartmentIdInSubtree: ${securityPolicyReportCompartmentIdInSubtree}
        displayName: ${securityPolicyReportDisplayName}
        securityPolicyReportId: ${testSecurityPolicyReport.id}
        state: ${securityPolicyReportState}
        targetId: ${testTarget.id}
Using getSecurityPolicyReports
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 getSecurityPolicyReports(args: GetSecurityPolicyReportsArgs, opts?: InvokeOptions): Promise<GetSecurityPolicyReportsResult>
function getSecurityPolicyReportsOutput(args: GetSecurityPolicyReportsOutputArgs, opts?: InvokeOptions): Output<GetSecurityPolicyReportsResult>def get_security_policy_reports(access_level: Optional[str] = None,
                                compartment_id: Optional[str] = None,
                                compartment_id_in_subtree: Optional[bool] = None,
                                display_name: Optional[str] = None,
                                filters: Optional[Sequence[GetSecurityPolicyReportsFilter]] = None,
                                security_policy_report_id: Optional[str] = None,
                                state: Optional[str] = None,
                                target_id: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetSecurityPolicyReportsResult
def get_security_policy_reports_output(access_level: Optional[pulumi.Input[str]] = None,
                                compartment_id: Optional[pulumi.Input[str]] = None,
                                compartment_id_in_subtree: Optional[pulumi.Input[bool]] = None,
                                display_name: Optional[pulumi.Input[str]] = None,
                                filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetSecurityPolicyReportsFilterArgs]]]] = None,
                                security_policy_report_id: Optional[pulumi.Input[str]] = None,
                                state: Optional[pulumi.Input[str]] = None,
                                target_id: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetSecurityPolicyReportsResult]func GetSecurityPolicyReports(ctx *Context, args *GetSecurityPolicyReportsArgs, opts ...InvokeOption) (*GetSecurityPolicyReportsResult, error)
func GetSecurityPolicyReportsOutput(ctx *Context, args *GetSecurityPolicyReportsOutputArgs, opts ...InvokeOption) GetSecurityPolicyReportsResultOutput> Note: This function is named GetSecurityPolicyReports in the Go SDK.
public static class GetSecurityPolicyReports 
{
    public static Task<GetSecurityPolicyReportsResult> InvokeAsync(GetSecurityPolicyReportsArgs args, InvokeOptions? opts = null)
    public static Output<GetSecurityPolicyReportsResult> Invoke(GetSecurityPolicyReportsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSecurityPolicyReportsResult> getSecurityPolicyReports(GetSecurityPolicyReportsArgs args, InvokeOptions options)
public static Output<GetSecurityPolicyReportsResult> getSecurityPolicyReports(GetSecurityPolicyReportsArgs args, InvokeOptions options)
fn::invoke:
  function: oci:DataSafe/getSecurityPolicyReports:getSecurityPolicyReports
  arguments:
    # arguments dictionaryThe following arguments are supported:
- CompartmentId string
- A filter to return only resources that match the specified compartment OCID.
- AccessLevel string
- Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.
- CompartmentId boolIn Subtree 
- Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.
- DisplayName string
- A filter to return only resources that match the specified display name.
- Filters
List<GetSecurity Policy Reports Filter> 
- SecurityPolicy stringReport Id 
- An optional filter to return only resources that match the specified OCID of the security policy report resource.
- State string
- The current state of the security policy report.
- TargetId string
- A filter to return only items related to a specific target OCID.
- CompartmentId string
- A filter to return only resources that match the specified compartment OCID.
- AccessLevel string
- Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.
- CompartmentId boolIn Subtree 
- Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.
- DisplayName string
- A filter to return only resources that match the specified display name.
- Filters
[]GetSecurity Policy Reports Filter 
- SecurityPolicy stringReport Id 
- An optional filter to return only resources that match the specified OCID of the security policy report resource.
- State string
- The current state of the security policy report.
- TargetId string
- A filter to return only items related to a specific target OCID.
- compartmentId String
- A filter to return only resources that match the specified compartment OCID.
- accessLevel String
- Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.
- compartmentId BooleanIn Subtree 
- Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.
- displayName String
- A filter to return only resources that match the specified display name.
- filters
List<GetSecurity Policy Reports Filter> 
- securityPolicy StringReport Id 
- An optional filter to return only resources that match the specified OCID of the security policy report resource.
- state String
- The current state of the security policy report.
- targetId String
- A filter to return only items related to a specific target OCID.
- compartmentId string
- A filter to return only resources that match the specified compartment OCID.
- accessLevel string
- Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.
- compartmentId booleanIn Subtree 
- Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.
- displayName string
- A filter to return only resources that match the specified display name.
- filters
GetSecurity Policy Reports Filter[] 
- securityPolicy stringReport Id 
- An optional filter to return only resources that match the specified OCID of the security policy report resource.
- state string
- The current state of the security policy report.
- targetId string
- A filter to return only items related to a specific target OCID.
- compartment_id str
- A filter to return only resources that match the specified compartment OCID.
- access_level str
- Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.
- compartment_id_ boolin_ subtree 
- Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.
- display_name str
- A filter to return only resources that match the specified display name.
- filters
Sequence[GetSecurity Policy Reports Filter] 
- security_policy_ strreport_ id 
- An optional filter to return only resources that match the specified OCID of the security policy report resource.
- state str
- The current state of the security policy report.
- target_id str
- A filter to return only items related to a specific target OCID.
- compartmentId String
- A filter to return only resources that match the specified compartment OCID.
- accessLevel String
- Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.
- compartmentId BooleanIn Subtree 
- Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.
- displayName String
- A filter to return only resources that match the specified display name.
- filters List<Property Map>
- securityPolicy StringReport Id 
- An optional filter to return only resources that match the specified OCID of the security policy report resource.
- state String
- The current state of the security policy report.
- targetId String
- A filter to return only items related to a specific target OCID.
getSecurityPolicyReports Result
The following output properties are available:
- CompartmentId string
- The OCID of the compartment that contains the security policy report.
- Id string
- The provider-assigned unique ID for this managed resource.
- SecurityPolicy List<GetReport Collections Security Policy Reports Security Policy Report Collection> 
- The list of security_policy_report_collection.
- AccessLevel string
- CompartmentId boolIn Subtree 
- DisplayName string
- The display name of the security policy report.
- Filters
List<GetSecurity Policy Reports Filter> 
- SecurityPolicy stringReport Id 
- State string
- The current state of the security policy report.
- TargetId string
- The OCID of the of the target database.
- CompartmentId string
- The OCID of the compartment that contains the security policy report.
- Id string
- The provider-assigned unique ID for this managed resource.
- SecurityPolicy []GetReport Collections Security Policy Reports Security Policy Report Collection 
- The list of security_policy_report_collection.
- AccessLevel string
- CompartmentId boolIn Subtree 
- DisplayName string
- The display name of the security policy report.
- Filters
[]GetSecurity Policy Reports Filter 
- SecurityPolicy stringReport Id 
- State string
- The current state of the security policy report.
- TargetId string
- The OCID of the of the target database.
- compartmentId String
- The OCID of the compartment that contains the security policy report.
- id String
- The provider-assigned unique ID for this managed resource.
- securityPolicy List<GetReport Collections Security Policy Reports Security Policy Report Collection> 
- The list of security_policy_report_collection.
- accessLevel String
- compartmentId BooleanIn Subtree 
- displayName String
- The display name of the security policy report.
- filters
List<GetSecurity Policy Reports Filter> 
- securityPolicy StringReport Id 
- state String
- The current state of the security policy report.
- targetId String
- The OCID of the of the target database.
- compartmentId string
- The OCID of the compartment that contains the security policy report.
- id string
- The provider-assigned unique ID for this managed resource.
- securityPolicy GetReport Collections Security Policy Reports Security Policy Report Collection[] 
- The list of security_policy_report_collection.
- accessLevel string
- compartmentId booleanIn Subtree 
- displayName string
- The display name of the security policy report.
- filters
GetSecurity Policy Reports Filter[] 
- securityPolicy stringReport Id 
- state string
- The current state of the security policy report.
- targetId string
- The OCID of the of the target database.
- compartment_id str
- The OCID of the compartment that contains the security policy report.
- id str
- The provider-assigned unique ID for this managed resource.
- security_policy_ Sequence[Getreport_ collections Security Policy Reports Security Policy Report Collection] 
- The list of security_policy_report_collection.
- access_level str
- compartment_id_ boolin_ subtree 
- display_name str
- The display name of the security policy report.
- filters
Sequence[GetSecurity Policy Reports Filter] 
- security_policy_ strreport_ id 
- state str
- The current state of the security policy report.
- target_id str
- The OCID of the of the target database.
- compartmentId String
- The OCID of the compartment that contains the security policy report.
- id String
- The provider-assigned unique ID for this managed resource.
- securityPolicy List<Property Map>Report Collections 
- The list of security_policy_report_collection.
- accessLevel String
- compartmentId BooleanIn Subtree 
- displayName String
- The display name of the security policy report.
- filters List<Property Map>
- securityPolicy StringReport Id 
- state String
- The current state of the security policy report.
- targetId String
- The OCID of the of the target database.
Supporting Types
GetSecurityPolicyReportsFilter    
GetSecurityPolicyReportsSecurityPolicyReportCollection       
GetSecurityPolicyReportsSecurityPolicyReportCollectionItem        
- CompartmentId string
- A filter to return only resources that match the specified compartment OCID.
- Dictionary<string, string>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags Example: {"Operations.CostCenter": "42"}
- Description string
- The description of the security policy report.
- DisplayName string
- A filter to return only resources that match the specified display name.
- Dictionary<string, string>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags Example: {"Department": "Finance"}
- Id string
- The OCID of the security policy report.
- LifecycleDetails string
- Details about the current state of the security policy report.
- State string
- The current state of the security policy report.
- Dictionary<string, string>
- System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}
- TargetId string
- A filter to return only items related to a specific target OCID.
- TimeCreated string
- The date and time the security policy report was created, in the format defined by RFC3339.
- TimeUpdated string
- The date and time the security policy report was last updated, in the format defined by RFC3339.
- CompartmentId string
- A filter to return only resources that match the specified compartment OCID.
- map[string]string
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags Example: {"Operations.CostCenter": "42"}
- Description string
- The description of the security policy report.
- DisplayName string
- A filter to return only resources that match the specified display name.
- map[string]string
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags Example: {"Department": "Finance"}
- Id string
- The OCID of the security policy report.
- LifecycleDetails string
- Details about the current state of the security policy report.
- State string
- The current state of the security policy report.
- map[string]string
- System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}
- TargetId string
- A filter to return only items related to a specific target OCID.
- TimeCreated string
- The date and time the security policy report was created, in the format defined by RFC3339.
- TimeUpdated string
- The date and time the security policy report was last updated, in the format defined by RFC3339.
- compartmentId String
- A filter to return only resources that match the specified compartment OCID.
- Map<String,String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags Example: {"Operations.CostCenter": "42"}
- description String
- The description of the security policy report.
- displayName String
- A filter to return only resources that match the specified display name.
- Map<String,String>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags Example: {"Department": "Finance"}
- id String
- The OCID of the security policy report.
- lifecycleDetails String
- Details about the current state of the security policy report.
- state String
- The current state of the security policy report.
- Map<String,String>
- System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}
- targetId String
- A filter to return only items related to a specific target OCID.
- timeCreated String
- The date and time the security policy report was created, in the format defined by RFC3339.
- timeUpdated String
- The date and time the security policy report was last updated, in the format defined by RFC3339.
- compartmentId string
- A filter to return only resources that match the specified compartment OCID.
- {[key: string]: string}
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags Example: {"Operations.CostCenter": "42"}
- description string
- The description of the security policy report.
- displayName string
- A filter to return only resources that match the specified display name.
- {[key: string]: string}
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags Example: {"Department": "Finance"}
- id string
- The OCID of the security policy report.
- lifecycleDetails string
- Details about the current state of the security policy report.
- state string
- The current state of the security policy report.
- {[key: string]: string}
- System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}
- targetId string
- A filter to return only items related to a specific target OCID.
- timeCreated string
- The date and time the security policy report was created, in the format defined by RFC3339.
- timeUpdated string
- The date and time the security policy report was last updated, in the format defined by RFC3339.
- compartment_id str
- A filter to return only resources that match the specified compartment OCID.
- Mapping[str, str]
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags Example: {"Operations.CostCenter": "42"}
- description str
- The description of the security policy report.
- display_name str
- A filter to return only resources that match the specified display name.
- Mapping[str, str]
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags Example: {"Department": "Finance"}
- id str
- The OCID of the security policy report.
- lifecycle_details str
- Details about the current state of the security policy report.
- state str
- The current state of the security policy report.
- Mapping[str, str]
- System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}
- target_id str
- A filter to return only items related to a specific target OCID.
- time_created str
- The date and time the security policy report was created, in the format defined by RFC3339.
- time_updated str
- The date and time the security policy report was last updated, in the format defined by RFC3339.
- compartmentId String
- A filter to return only resources that match the specified compartment OCID.
- Map<String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags Example: {"Operations.CostCenter": "42"}
- description String
- The description of the security policy report.
- displayName String
- A filter to return only resources that match the specified display name.
- Map<String>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags Example: {"Department": "Finance"}
- id String
- The OCID of the security policy report.
- lifecycleDetails String
- Details about the current state of the security policy report.
- state String
- The current state of the security policy report.
- Map<String>
- System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}
- targetId String
- A filter to return only items related to a specific target OCID.
- timeCreated String
- The date and time the security policy report was created, in the format defined by RFC3339.
- timeUpdated String
- The date and time the security policy report was last updated, in the format defined by RFC3339.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.