class GuardrailBase
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Bedrock.Alpha.GuardrailBase |
![]() | github.com/aws/aws-cdk-go/awsbedrockalpha/v2#GuardrailBase |
![]() | software.amazon.awscdk.services.bedrock.alpha.GuardrailBase |
![]() | aws_cdk.aws_bedrock_alpha.GuardrailBase |
![]() | @aws-cdk/aws-bedrock-alpha ยป GuardrailBase |
Implements
IConstruct
, IDependable
, IResource
, IGuardrail
Extends
Resource
Implemented by
Guardrail
Abstract base class for a Guardrail.
Contains methods and attributes valid for Guardrails either created with CDK or imported.
Initializer
new GuardrailBase(scope: Construct, id: string, props?: ResourceProps)
Parameters
- scope
Construct
- id
string
- props
Resource
Props
Properties
Name | Type | Description |
---|---|---|
env | Resource | The environment this resource belongs to. |
guardrail | string | The ARN of the guardrail. |
guardrail | string | The ID of the guardrail. |
guardrail | string | The version of the guardrail. |
node | Node | The tree node. |
stack | Stack | The stack in which this resource is defined. |
kms | IKey | Optional KMS encryption key associated with this guardrail. |
last | string | When this guardrail was last updated. |
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
guardrailArn
Type:
string
The ARN of the guardrail.
guardrailId
Type:
string
The ID of the guardrail.
guardrailVersion
Type:
string
The version of the guardrail.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
kmsKey?
Type:
IKey
(optional)
Optional KMS encryption key associated with this guardrail.
lastUpdated?
Type:
string
(optional)
When this guardrail was last updated.
Methods
Name | Description |
---|---|
apply | Apply the given removal policy to this resource. |
grant(grantee, ...actions) | Grant the given principal identity permissions to perform actions on this guardrail. |
grant | Grant the given identity permissions to apply the guardrail. |
metric(metricName, props?) | Return the given named metric for this guardrail. |
metric | Return the invocation client errors metric for this guardrail. |
metric | Return the invocation latency metric for this guardrail. |
metric | Return the invocation server errors metric for this guardrail. |
metric | Return the invocation throttles metric for this guardrail. |
metric | Return the invocations metric for this guardrail. |
metric | Return the invocations intervened metric for this guardrail. |
metric | Return the text unit count metric for this guardrail. |
to | Returns a string representation of this construct. |
protected update | |
static metric | Return the given named metric for all guardrails. |
static metric | Return the invocation latency metric for all guardrails. |
static metric | Return the invocations metric for all guardrails. |
static metric | Return the invocations intervened metric for all guardrails. |
static metric | Return the text unit count metric for all guardrails. |
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
grant(grantee, ...actions)
public grant(grantee: IGrantable, ...actions: string[]): Grant
Parameters
- grantee
IGrantable
- actions
string
Returns
Grant the given principal identity permissions to perform actions on this guardrail.
grantApply(grantee)
public grantApply(grantee: IGrantable): Grant
Parameters
- grantee
IGrantable
Returns
Grant the given identity permissions to apply the guardrail.
metric(metricName, props?)
public metric(metricName: string, props?: MetricOptions): Metric
Parameters
- metricName
string
- props
Metric
Options
Returns
Return the given named metric for this guardrail.
By default, the metric will be calculated as a sum over a period of 5 minutes.
You can customize this by using the statistic
and period
properties.
metricInvocationClientErrors(props?)
public metricInvocationClientErrors(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Return the invocation client errors metric for this guardrail.
metricInvocationLatency(props?)
public metricInvocationLatency(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Return the invocation latency metric for this guardrail.
metricInvocationServerErrors(props?)
public metricInvocationServerErrors(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Return the invocation server errors metric for this guardrail.
metricInvocationThrottles(props?)
public metricInvocationThrottles(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Return the invocation throttles metric for this guardrail.
metricInvocations(props?)
public metricInvocations(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Return the invocations metric for this guardrail.
metricInvocationsIntervened(props?)
public metricInvocationsIntervened(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Return the invocations intervened metric for this guardrail.
metricTextUnitCount(props?)
public metricTextUnitCount(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Return the text unit count metric for this guardrail.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
protected updateVersion(version)
protected updateVersion(version: string): void
Parameters
- version
string
static metricAll(metricName, props?)
public static metricAll(metricName: string, props?: MetricOptions): Metric
Parameters
- metricName
string
- props
Metric
Options
Returns
Return the given named metric for all guardrails.
By default, the metric will be calculated as a sum over a period of 5 minutes.
You can customize this by using the statistic
and period
properties.
static metricAllInvocationLatency(props?)
public static metricAllInvocationLatency(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Return the invocation latency metric for all guardrails.
static metricAllInvocations(props?)
public static metricAllInvocations(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Return the invocations metric for all guardrails.
static metricAllInvocationsIntervened(props?)
public static metricAllInvocationsIntervened(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Return the invocations intervened metric for all guardrails.
static metricAllTextUnitCount(props?)
public static metricAllTextUnitCount(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Return the text unit count metric for all guardrails.