oci.DataSafe.getSecurityPolicies
Explore with Pulumi AI
This data source provides the list of Security Policies in Oracle Cloud Infrastructure Data Safe service.
Retrieves a list of all security policies in Data Safe.
The ListSecurityPolicies operation returns only the security policies 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 ListSecurityPolicies 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 testSecurityPolicies = oci.DataSafe.getSecurityPolicies({
compartmentId: compartmentId,
accessLevel: securityPolicyAccessLevel,
compartmentIdInSubtree: securityPolicyCompartmentIdInSubtree,
displayName: securityPolicyDisplayName,
securityPolicyId: testSecurityPolicy.id,
state: securityPolicyState,
});
import pulumi
import pulumi_oci as oci
test_security_policies = oci.DataSafe.get_security_policies(compartment_id=compartment_id,
access_level=security_policy_access_level,
compartment_id_in_subtree=security_policy_compartment_id_in_subtree,
display_name=security_policy_display_name,
security_policy_id=test_security_policy["id"],
state=security_policy_state)
package main
import (
"github.com/pulumi/pulumi-oci/sdk/go/oci/DataSafe"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := DataSafe.GetSecurityPolicies(ctx, &datasafe.GetSecurityPoliciesArgs{
CompartmentId: compartmentId,
AccessLevel: pulumi.StringRef(securityPolicyAccessLevel),
CompartmentIdInSubtree: pulumi.BoolRef(securityPolicyCompartmentIdInSubtree),
DisplayName: pulumi.StringRef(securityPolicyDisplayName),
SecurityPolicyId: pulumi.StringRef(testSecurityPolicy.Id),
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.DataSafe.GetSecurityPolicies.Invoke(new()
{
CompartmentId = compartmentId,
AccessLevel = securityPolicyAccessLevel,
CompartmentIdInSubtree = securityPolicyCompartmentIdInSubtree,
DisplayName = securityPolicyDisplayName,
SecurityPolicyId = testSecurityPolicy.Id,
State = securityPolicyState,
});
});
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.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 = DataSafeFunctions.getSecurityPolicies(GetSecurityPoliciesArgs.builder()
.compartmentId(compartmentId)
.accessLevel(securityPolicyAccessLevel)
.compartmentIdInSubtree(securityPolicyCompartmentIdInSubtree)
.displayName(securityPolicyDisplayName)
.securityPolicyId(testSecurityPolicy.id())
.state(securityPolicyState)
.build());
}
}
variables:
testSecurityPolicies:
fn::invoke:
Function: oci:DataSafe:getSecurityPolicies
Arguments:
compartmentId: ${compartmentId}
accessLevel: ${securityPolicyAccessLevel}
compartmentIdInSubtree: ${securityPolicyCompartmentIdInSubtree}
displayName: ${securityPolicyDisplayName}
securityPolicyId: ${testSecurityPolicy.id}
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(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[_datasafe.GetSecurityPoliciesFilter]] = None,
security_policy_id: Optional[str] = None,
state: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetSecurityPoliciesResult
def get_security_policies_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[_datasafe.GetSecurityPoliciesFilterArgs]]]] = None,
security_policy_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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: oci:DataSafe/getSecurityPolicies:getSecurityPolicies
arguments:
# arguments dictionary
The following arguments are supported:
- Compartment
Id string - A filter to return only resources that match the specified compartment OCID.
- Access
Level 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.
- 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 string - A filter to return only resources that match the specified display name.
- Filters
List<Get
Security Policies Filter> - Security
Policy stringId - An optional filter to return only resources that match the specified OCID of the security policy resource.
- State string
- The current state of the security policy.
- Compartment
Id string - A filter to return only resources that match the specified compartment OCID.
- Access
Level 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.
- 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 string - A filter to return only resources that match the specified display name.
- Filters
[]Get
Security Policies Filter - Security
Policy stringId - An optional filter to return only resources that match the specified OCID of the security policy resource.
- State string
- The current state of the security policy.
- compartment
Id String - A filter to return only resources that match the specified compartment OCID.
- access
Level 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.
- compartment
Id 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.
- display
Name String - A filter to return only resources that match the specified display name.
- filters
List<Get
Security Policies Filter> - security
Policy StringId - An optional filter to return only resources that match the specified OCID of the security policy resource.
- state String
- The current state of the security policy.
- compartment
Id string - A filter to return only resources that match the specified compartment OCID.
- access
Level 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.
- compartment
Id 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.
- display
Name string - A filter to return only resources that match the specified display name.
- filters
Get
Security Policies Filter[] - security
Policy stringId - An optional filter to return only resources that match the specified OCID of the security policy resource.
- state string
- The current state of the security policy.
- 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[datasafe.
Get Security Policies Filter] - security_
policy_ strid - An optional filter to return only resources that match the specified OCID of the security policy resource.
- state str
- The current state of the security policy.
- compartment
Id String - A filter to return only resources that match the specified compartment OCID.
- access
Level 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.
- compartment
Id 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.
- display
Name String - A filter to return only resources that match the specified display name.
- filters List<Property Map>
- security
Policy StringId - An optional filter to return only resources that match the specified OCID of the security policy resource.
- state String
- The current state of the security policy.
getSecurityPolicies Result
The following output properties are available:
- Compartment
Id string - The OCID of the compartment containing the security policy.
- Id string
- The provider-assigned unique ID for this managed resource.
- Security
Policy List<GetCollections Security Policies Security Policy Collection> - The list of security_policy_collection.
- Access
Level string - Compartment
Id boolIn Subtree - Display
Name string - The display name of the security policy.
- Filters
List<Get
Security Policies Filter> - Security
Policy stringId - State string
- The current state of the security policy.
- Compartment
Id string - The OCID of the compartment containing the security policy.
- Id string
- The provider-assigned unique ID for this managed resource.
- Security
Policy []GetCollections Security Policies Security Policy Collection - The list of security_policy_collection.
- Access
Level string - Compartment
Id boolIn Subtree - Display
Name string - The display name of the security policy.
- Filters
[]Get
Security Policies Filter - Security
Policy stringId - State string
- The current state of the security policy.
- compartment
Id String - The OCID of the compartment containing the security policy.
- id String
- The provider-assigned unique ID for this managed resource.
- security
Policy List<GetCollections Security Policies Security Policy Collection> - The list of security_policy_collection.
- access
Level String - compartment
Id BooleanIn Subtree - display
Name String - The display name of the security policy.
- filters
List<Get
Security Policies Filter> - security
Policy StringId - state String
- The current state of the security policy.
- compartment
Id string - The OCID of the compartment containing the security policy.
- id string
- The provider-assigned unique ID for this managed resource.
- security
Policy GetCollections Security Policies Security Policy Collection[] - The list of security_policy_collection.
- access
Level string - compartment
Id booleanIn Subtree - display
Name string - The display name of the security policy.
- filters
Get
Security Policies Filter[] - security
Policy stringId - state string
- The current state of the security policy.
- compartment_
id str - The OCID of the compartment containing the security policy.
- id str
- The provider-assigned unique ID for this managed resource.
- security_
policy_ Sequence[datasafe.collections Get Security Policies Security Policy Collection] - The list of security_policy_collection.
- access_
level str - compartment_
id_ boolin_ subtree - display_
name str - The display name of the security policy.
- filters
Sequence[datasafe.
Get Security Policies Filter] - security_
policy_ strid - state str
- The current state of the security policy.
- compartment
Id String - The OCID of the compartment containing the security policy.
- id String
- The provider-assigned unique ID for this managed resource.
- security
Policy List<Property Map>Collections - The list of security_policy_collection.
- access
Level String - compartment
Id BooleanIn Subtree - display
Name String - The display name of the security policy.
- filters List<Property Map>
- security
Policy StringId - state String
- The current state of the security policy.
Supporting Types
GetSecurityPoliciesFilter
GetSecurityPoliciesSecurityPolicyCollection
GetSecurityPoliciesSecurityPolicyCollectionItem
- Compartment
Id string - A filter to return only resources that match the specified compartment OCID.
- Dictionary<string, object>
- 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.
- Display
Name string - A filter to return only resources that match the specified display name.
- Dictionary<string, object>
- 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.
- Lifecycle
Details string - Details about the current state of the security policy in Data Safe.
- Security
Policy stringId - An optional filter to return only resources that match the specified OCID of the security policy resource.
- State string
- The current state of the security policy.
- Dictionary<string, object>
- 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"}
- Time
Created string - The time that the security policy was created, in the format defined by RFC3339.
- Time
Updated string - The last date and time the security policy was updated, in the format defined by RFC3339.
- Compartment
Id string - A filter to return only resources that match the specified compartment OCID.
- map[string]interface{}
- 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.
- Display
Name string - A filter to return only resources that match the specified display name.
- map[string]interface{}
- 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.
- Lifecycle
Details string - Details about the current state of the security policy in Data Safe.
- Security
Policy stringId - An optional filter to return only resources that match the specified OCID of the security policy resource.
- State string
- The current state of the security policy.
- map[string]interface{}
- 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"}
- Time
Created string - The time that the security policy was created, in the format defined by RFC3339.
- Time
Updated string - The last date and time the security policy was updated, in the format defined by RFC3339.
- compartment
Id String - A filter to return only resources that match the specified compartment OCID.
- Map<String,Object>
- 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.
- display
Name String - A filter to return only resources that match the specified display name.
- Map<String,Object>
- 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.
- lifecycle
Details String - Details about the current state of the security policy in Data Safe.
- security
Policy StringId - An optional filter to return only resources that match the specified OCID of the security policy resource.
- state String
- The current state of the security policy.
- Map<String,Object>
- 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"}
- time
Created String - The time that the security policy was created, in the format defined by RFC3339.
- time
Updated String - The last date and time the security policy was updated, in the format defined by RFC3339.
- compartment
Id string - A filter to return only resources that match the specified compartment OCID.
- {[key: string]: any}
- 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.
- display
Name string - A filter to return only resources that match the specified display name.
- {[key: string]: any}
- 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.
- lifecycle
Details string - Details about the current state of the security policy in Data Safe.
- security
Policy stringId - An optional filter to return only resources that match the specified OCID of the security policy resource.
- state string
- The current state of the security policy.
- {[key: string]: any}
- 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"}
- time
Created string - The time that the security policy was created, in the format defined by RFC3339.
- time
Updated string - The last date and time the security policy was updated, in the format defined by RFC3339.
- compartment_
id str - A filter to return only resources that match the specified compartment OCID.
- Mapping[str, Any]
- 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.
- display_
name str - A filter to return only resources that match the specified display name.
- Mapping[str, Any]
- 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.
- lifecycle_
details str - Details about the current state of the security policy in Data Safe.
- security_
policy_ strid - An optional filter to return only resources that match the specified OCID of the security policy resource.
- state str
- The current state of the security policy.
- Mapping[str, Any]
- 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"}
- time_
created str - The time that the security policy was created, in the format defined by RFC3339.
- time_
updated str - The last date and time the security policy was updated, in the format defined by RFC3339.
- compartment
Id String - A filter to return only resources that match the specified compartment OCID.
- Map<Any>
- 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.
- display
Name String - A filter to return only resources that match the specified display name.
- Map<Any>
- 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.
- lifecycle
Details String - Details about the current state of the security policy in Data Safe.
- security
Policy StringId - An optional filter to return only resources that match the specified OCID of the security policy resource.
- state String
- The current state of the security policy.
- Map<Any>
- 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"}
- time
Created String - The time that the security policy was created, in the format defined by RFC3339.
- time
Updated String - The last date and time the security policy was 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
oci
Terraform Provider.