1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. CloudGuard
  5. getSecurityPolicy
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.CloudGuard.getSecurityPolicy

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides details about a specific Security Policy resource in Oracle Cloud Infrastructure Cloud Guard service.

    Returns a security zone policy (SecurityPolicy resource), identified by its unique ID (securityPolicyId). When a policy is enabled in a security zone, then any action in the zone that attempts to violate that policy is blocked.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testSecurityPolicy = oci.CloudGuard.getSecurityPolicy({
        securityPolicyId: testSecurityPolicyOciCloudGuardSecurityPolicy.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_security_policy = oci.CloudGuard.get_security_policy(security_policy_id=test_security_policy_oci_cloud_guard_security_policy["id"])
    
    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.GetSecurityPolicy(ctx, &cloudguard.GetSecurityPolicyArgs{
    			SecurityPolicyId: testSecurityPolicyOciCloudGuardSecurityPolicy.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 testSecurityPolicy = Oci.CloudGuard.GetSecurityPolicy.Invoke(new()
        {
            SecurityPolicyId = testSecurityPolicyOciCloudGuardSecurityPolicy.Id,
        });
    
    });
    
    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.GetSecurityPolicyArgs;
    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 testSecurityPolicy = CloudGuardFunctions.getSecurityPolicy(GetSecurityPolicyArgs.builder()
                .securityPolicyId(testSecurityPolicyOciCloudGuardSecurityPolicy.id())
                .build());
    
        }
    }
    
    variables:
      testSecurityPolicy:
        fn::invoke:
          Function: oci:CloudGuard:getSecurityPolicy
          Arguments:
            securityPolicyId: ${testSecurityPolicyOciCloudGuardSecurityPolicy.id}
    

    Using getSecurityPolicy

    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 getSecurityPolicy(args: GetSecurityPolicyArgs, opts?: InvokeOptions): Promise<GetSecurityPolicyResult>
    function getSecurityPolicyOutput(args: GetSecurityPolicyOutputArgs, opts?: InvokeOptions): Output<GetSecurityPolicyResult>
    def get_security_policy(security_policy_id: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetSecurityPolicyResult
    def get_security_policy_output(security_policy_id: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetSecurityPolicyResult]
    func GetSecurityPolicy(ctx *Context, args *GetSecurityPolicyArgs, opts ...InvokeOption) (*GetSecurityPolicyResult, error)
    func GetSecurityPolicyOutput(ctx *Context, args *GetSecurityPolicyOutputArgs, opts ...InvokeOption) GetSecurityPolicyResultOutput

    > Note: This function is named GetSecurityPolicy in the Go SDK.

    public static class GetSecurityPolicy 
    {
        public static Task<GetSecurityPolicyResult> InvokeAsync(GetSecurityPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetSecurityPolicyResult> Invoke(GetSecurityPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSecurityPolicyResult> getSecurityPolicy(GetSecurityPolicyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:CloudGuard/getSecurityPolicy:getSecurityPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    SecurityPolicyId string
    The unique identifier of the security zone policy. (SecurityPolicy)
    SecurityPolicyId string
    The unique identifier of the security zone policy. (SecurityPolicy)
    securityPolicyId String
    The unique identifier of the security zone policy. (SecurityPolicy)
    securityPolicyId string
    The unique identifier of the security zone policy. (SecurityPolicy)
    security_policy_id str
    The unique identifier of the security zone policy. (SecurityPolicy)
    securityPolicyId String
    The unique identifier of the security zone policy. (SecurityPolicy)

    getSecurityPolicy Result

    The following output properties are available:

    Category string
    The category of the security policy
    CompartmentId string
    The OCID of the security policy's compartment
    DefinedTags 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
    The security policy's display name
    FreeformTags 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 provider-assigned unique ID for this managed resource.
    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 Failed state.
    Owner string
    The owner of the security policy
    SecurityPolicyId string
    Services List<string>
    The list of services that the security policy protects
    State string
    The current lifecycle state of the security policy
    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 security policy's compartment
    DefinedTags 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
    The security policy's display name
    FreeformTags 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 provider-assigned unique ID for this managed resource.
    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 Failed state.
    Owner string
    The owner of the security policy
    SecurityPolicyId string
    Services []string
    The list of services that the security policy protects
    State string
    The current lifecycle state of the security policy
    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 security policy's compartment
    definedTags 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
    The security policy's display name
    freeformTags 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 provider-assigned unique ID for this managed resource.
    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 Failed state.
    owner String
    The owner of the security policy
    securityPolicyId String
    services List<String>
    The list of services that the security policy protects
    state String
    The current lifecycle state of the security policy
    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 security policy's compartment
    definedTags {[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
    The security policy's display name
    freeformTags {[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 provider-assigned unique ID for this managed resource.
    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 Failed state.
    owner string
    The owner of the security policy
    securityPolicyId string
    services string[]
    The list of services that the security policy protects
    state string
    The current lifecycle state of the security policy
    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 security policy's compartment
    defined_tags 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
    The security policy's display name
    freeform_tags 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 provider-assigned unique ID for this managed resource.
    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 Failed state.
    owner str
    The owner of the security policy
    security_policy_id str
    services Sequence[str]
    The list of services that the security policy protects
    state str
    The current lifecycle state of the security policy
    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 security policy's compartment
    definedTags 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
    The security policy's display name
    freeformTags 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 provider-assigned unique ID for this managed resource.
    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 Failed state.
    owner String
    The owner of the security policy
    securityPolicyId String
    services List<String>
    The list of services that the security policy protects
    state String
    The current lifecycle state of the security policy
    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 oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi