Class: AWSCDK::BedrockAgentCore::CfnPolicyProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
bedrock_agent_core/cfn_policy_props.rb

Overview

Properties for defining a CfnPolicy.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(definition:, name:, policy_engine_id:, description: nil, enforcement_mode: nil, validation_mode: nil) ⇒ CfnPolicyProps

Returns a new instance of CfnPolicyProps.

Parameters:

  • definition (AWSCDK::IResolvable, AWSCDK::BedrockAgentCore::CfnPolicy::PolicyDefinitionProperty)

    The definition structure for policies.

  • name (String)

    The customer-assigned immutable name for the policy.

  • policy_engine_id (String)

    The identifier of the policy engine which contains this policy.

  • description (String, nil) (defaults to: nil)

    A human-readable description of the policy's purpose and functionality.

  • enforcement_mode (String, nil) (defaults to: nil)

    Whether the policy contributes to the enforce decision returned to Gateway.

  • validation_mode (String, nil) (defaults to: nil)

    The validation mode for the policy.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'bedrock_agent_core/cfn_policy_props.rb', line 15

def initialize(definition:, name:, policy_engine_id:, description: nil, enforcement_mode: nil, validation_mode: nil)
  @definition = definition.is_a?(Hash) ? ::AWSCDK::BedrockAgentCore::CfnPolicy::PolicyDefinitionProperty.new(**definition.transform_keys(&:to_sym)) : definition
  Jsii::Type.check_type(@definition, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrYWdlbnRjb3JlLkNmblBvbGljeS5Qb2xpY3lEZWZpbml0aW9uUHJvcGVydHkifV19fQ==")), "definition")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @policy_engine_id = policy_engine_id
  Jsii::Type.check_type(@policy_engine_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "policyEngineId")
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @enforcement_mode = enforcement_mode
  Jsii::Type.check_type(@enforcement_mode, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "enforcementMode") unless @enforcement_mode.nil?
  @validation_mode = validation_mode
  Jsii::Type.check_type(@validation_mode, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "validationMode") unless @validation_mode.nil?
end

Instance Attribute Details

#definitionAWSCDK::IResolvable, AWSCDK::BedrockAgentCore::CfnPolicy::PolicyDefinitionProperty (readonly)

The definition structure for policies.

Encapsulates different policy formats.



36
37
38
# File 'bedrock_agent_core/cfn_policy_props.rb', line 36

def definition
  @definition
end

#descriptionString? (readonly)

A human-readable description of the policy's purpose and functionality.



53
54
55
# File 'bedrock_agent_core/cfn_policy_props.rb', line 53

def description
  @description
end

#enforcement_modeString? (readonly)

Note:

Default: - "ACTIVE"

Whether the policy contributes to the enforce decision returned to Gateway.

LOG_ONLY policies are still evaluated but their decisions are observed only, allowing customers to validate a policy against real traffic before promoting it.



61
62
63
# File 'bedrock_agent_core/cfn_policy_props.rb', line 61

def enforcement_mode
  @enforcement_mode
end

#nameString (readonly)

The customer-assigned immutable name for the policy.

Must be unique within the policy engine.



43
44
45
# File 'bedrock_agent_core/cfn_policy_props.rb', line 43

def name
  @name
end

#policy_engine_idString (readonly)

The identifier of the policy engine which contains this policy.



48
49
50
# File 'bedrock_agent_core/cfn_policy_props.rb', line 48

def policy_engine_id
  @policy_engine_id
end

#validation_modeString? (readonly)

The validation mode for the policy.

Determines how Cedar analyzer validation results are handled.



68
69
70
# File 'bedrock_agent_core/cfn_policy_props.rb', line 68

def validation_mode
  @validation_mode
end

Class Method Details

.jsii_propertiesObject



70
71
72
73
74
75
76
77
78
79
# File 'bedrock_agent_core/cfn_policy_props.rb', line 70

def self.jsii_properties
  {
    :definition => "definition",
    :name => "name",
    :policy_engine_id => "policyEngineId",
    :description => "description",
    :enforcement_mode => "enforcementMode",
    :validation_mode => "validationMode",
  }
end

Instance Method Details

#to_jsiiObject



81
82
83
84
85
86
87
88
89
90
91
92
# File 'bedrock_agent_core/cfn_policy_props.rb', line 81

def to_jsii
  result = {}
  result.merge!({
    "definition" => @definition,
    "name" => @name,
    "policyEngineId" => @policy_engine_id,
    "description" => @description,
    "enforcementMode" => @enforcement_mode,
    "validationMode" => @validation_mode,
  })
  result.compact
end