oci.CloudGuard.getSecurityPolicy
Explore with Pulumi AI
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)
public static Output<GetSecurityPolicyResult> getSecurityPolicy(GetSecurityPolicyArgs args, InvokeOptions options)
fn::invoke:
  function: oci:CloudGuard/getSecurityPolicy:getSecurityPolicy
  arguments:
    # arguments dictionaryThe following arguments are supported:
- SecurityPolicy stringId 
- The unique identifier of the security zone policy. (SecurityPolicy)
- SecurityPolicy stringId 
- The unique identifier of the security zone policy. (SecurityPolicy)
- securityPolicy StringId 
- The unique identifier of the security zone policy. (SecurityPolicy)
- securityPolicy stringId 
- The unique identifier of the security zone policy. (SecurityPolicy)
- security_policy_ strid 
- The unique identifier of the security zone policy. (SecurityPolicy)
- securityPolicy StringId 
- 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
- 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
- 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 Failedstate.
- Owner string
- The owner of the security policy
- SecurityPolicy stringId 
- 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
- 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
- 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 Failedstate.
- Owner string
- The owner of the security policy
- SecurityPolicy stringId 
- 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
- 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
- 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 Failedstate.
- owner String
- The owner of the security policy
- securityPolicy StringId 
- 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
- {[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
- {[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 Failedstate.
- owner string
- The owner of the security policy
- securityPolicy stringId 
- 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
- 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
- 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 Failedstate.
- owner str
- The owner of the security policy
- security_policy_ strid 
- 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
- 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
- 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 Failedstate.
- owner String
- The owner of the security policy
- securityPolicy StringId 
- 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 ociTerraform Provider.