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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: oci:CloudGuard/getSecurityPolicy:getSecurityPolicy
arguments:
# arguments dictionary
The following arguments are supported:
- Security
Policy stringId - The unique identifier of the security zone policy. (
SecurityPolicy
)
- Security
Policy stringId - The unique identifier of the security zone policy. (
SecurityPolicy
)
- security
Policy StringId - The unique identifier of the security zone policy. (
SecurityPolicy
)
- security
Policy stringId - The unique identifier of the security zone policy. (
SecurityPolicy
)
- security_
policy_ strid - The unique identifier of the security zone policy. (
SecurityPolicy
)
- security
Policy 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
- Compartment
Id 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
- Display
Name 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"}
- Friendly
Name string - A shorter version of the security policy's name
- Id string
- The provider-assigned unique ID for this managed resource.
- Lifecycle
Details 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
- Security
Policy stringId - Services List<string>
- The list of services that the security policy protects
- State string
- The current lifecycle state of the security policy
- Time
Created string - The time the security policy was created. An RFC3339 formatted datetime string.
- Time
Updated string - The time the security policy was last updated. An RFC3339 formatted datetime string.
- Category string
- The category of the security policy
- Compartment
Id 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
- Display
Name 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"}
- Friendly
Name string - A shorter version of the security policy's name
- Id string
- The provider-assigned unique ID for this managed resource.
- Lifecycle
Details 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
- Security
Policy stringId - Services []string
- The list of services that the security policy protects
- State string
- The current lifecycle state of the security policy
- Time
Created string - The time the security policy was created. An RFC3339 formatted datetime string.
- Time
Updated string - The time the security policy was last updated. An RFC3339 formatted datetime string.
- category String
- The category of the security policy
- compartment
Id 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
- display
Name 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"}
- friendly
Name String - A shorter version of the security policy's name
- id String
- The provider-assigned unique ID for this managed resource.
- lifecycle
Details 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
- security
Policy StringId - services List<String>
- The list of services that the security policy protects
- state String
- The current lifecycle state of the security policy
- time
Created String - The time the security policy was created. An RFC3339 formatted datetime string.
- time
Updated String - The time the security policy was last updated. An RFC3339 formatted datetime string.
- category string
- The category of the security policy
- compartment
Id 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
- display
Name 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"}
- friendly
Name string - A shorter version of the security policy's name
- id string
- The provider-assigned unique ID for this managed resource.
- lifecycle
Details 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
- security
Policy stringId - services string[]
- The list of services that the security policy protects
- state string
- The current lifecycle state of the security policy
- time
Created string - The time the security policy was created. An RFC3339 formatted datetime string.
- time
Updated 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
Failed
state. - 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
- compartment
Id 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
- display
Name 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"}
- friendly
Name String - A shorter version of the security policy's name
- id String
- The provider-assigned unique ID for this managed resource.
- lifecycle
Details 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
- security
Policy StringId - services List<String>
- The list of services that the security policy protects
- state String
- The current lifecycle state of the security policy
- time
Created String - The time the security policy was created. An RFC3339 formatted datetime string.
- time
Updated 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.