class BrowserCustom (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.BrowserCustom |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#BrowserCustom |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.BrowserCustom |
Python | aws_cdk.aws_bedrock_agentcore_alpha.BrowserCustom |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป BrowserCustom |
Implements
IConstruct, IDependable, IResource, IBrowser, IGrantable, IConnectable
Browser resource for AWS Bedrock Agent Core.
Provides a browser environment for web automation and interaction.
See also: https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/browser.html
Example
// Create a custom execution role
const executionRole = new iam.Role(this, "BrowserExecutionRole", {
assumedBy: new iam.ServicePrincipal("bedrock-agentcore.amazonaws.com"),
managedPolicies: [
iam.ManagedPolicy.fromAwsManagedPolicyName("AmazonBedrockAgentCoreBrowserExecutionRolePolicy"),
],
});
// Create browser with custom execution role
const browser = new agentcore.BrowserCustom(this, "MyBrowser", {
browserCustomName: "my_browser",
description: "Browser with custom execution role",
networkConfiguration: agentcore.BrowserNetworkConfiguration.usingPublicNetwork(),
executionRole: executionRole,
});
Initializer
new BrowserCustom(scope: Construct, id: string, props: BrowserCustomProps)
Parameters
- scope
Construct - id
string - props
BrowserCustom Props
Construct Props
| Name | Type | Description |
|---|---|---|
| browser | string | The name of the browser Valid characters are a-z, A-Z, 0-9, _ (underscore) The name must start with a letter and can be up to 48 characters long Pattern: [a-zA-Z][a-zA-Z0-9_]{0,47}. |
| description? | string | Optional description for the browser Valid characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and spaces The description can have up to 200 characters. |
| execution | IRole | The IAM role that provides permissions for the browser to access AWS services. |
| network | Browser | Network configuration for browser. |
| recording | Recording | Recording configuration for browser. |
| tags? | { [string]: string } | Tags (optional) A list of key:value pairs of tags to apply to this Browser resource. |
browserCustomName
Type:
string
The name of the browser Valid characters are a-z, A-Z, 0-9, _ (underscore) The name must start with a letter and can be up to 48 characters long Pattern: [a-zA-Z][a-zA-Z0-9_]{0,47}.
description?
Type:
string
(optional, default: No description)
Optional description for the browser Valid characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and spaces The description can have up to 200 characters.
executionRole?
Type:
IRole
(optional, default: A new role will be created)
The IAM role that provides permissions for the browser to access AWS services.
networkConfiguration?
Type:
Browser
(optional, default: PUBLIC network mode)
Network configuration for browser.
recordingConfig?
Type:
Recording
(optional, default: No recording configuration)
Recording configuration for browser.
tags?
Type:
{ [string]: string }
(optional, default: {} - no tags)
Tags (optional) A list of key:value pairs of tags to apply to this Browser resource.
Properties
| Name | Type | Description |
|---|---|---|
| browser | string | The ARN of the browser resource. |
| browser | string | The id of the browser. |
| connections | Connections | An accessor for the Connections object that will fail if this Browser does not have a VPC configured. |
| env | Resource | The environment this resource belongs to. |
| execution | IRole | The IAM role associated to the browser. |
| grant | IPrincipal | The principal to grant permissions to. |
| name | string | The name of the browser. |
| network | Browser | The network configuration of the browser. |
| node | Node | The tree node. |
| stack | Stack | The stack in which this resource is defined. |
| created | string | The created timestamp of the browser. |
| description? | string | The description of the browser. |
| failure | string | The failure reason of the browser. |
| last | string | The last updated timestamp of the browser. |
| recording | Recording | The recording configuration of the browser. |
| status? | string | The status of the browser. |
| tags? | { [string]: string } | Tags applied to this browser resource A map of key-value pairs for resource tagging. |
| static PROPERTY_INJECTION_ID | string | Uniquely identifies this class. |
browserArn
Type:
string
The ARN of the browser resource.
browserId
Type:
string
The id of the browser.
connections
Type:
Connections
An accessor for the Connections object that will fail if this Browser does not have a VPC configured.
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.
executionRole
Type:
IRole
The IAM role associated to the browser.
grantPrincipal
Type:
IPrincipal
The principal to grant permissions to.
name
Type:
string
The name of the browser.
networkConfiguration
Type:
Browser
The network configuration of the browser.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
createdAt?
Type:
string
(optional)
The created timestamp of the browser.
description?
Type:
string
(optional)
The description of the browser.
failureReason?
Type:
string
(optional)
The failure reason of the browser.
lastUpdatedAt?
Type:
string
(optional)
The last updated timestamp of the browser.
recordingConfig?
Type:
Recording
(optional)
The recording configuration of the browser.
status?
Type:
string
(optional)
The status of the browser.
tags?
Type:
{ [string]: string }
(optional, default: No tags applied)
Tags applied to this browser resource A map of key-value pairs for resource tagging.
static PROPERTY_INJECTION_ID
Type:
string
Uniquely identifies this class.
Methods
| Name | Description |
|---|---|
| apply | Apply the given removal policy to this resource. |
| grant(grantee, ...actions) | Grants IAM actions to the IAM Principal. |
| grant | Grant read permissions on this browser to an IAM principal. |
| grant | Grant invoke permissions on this browser to an IAM principal. |
| metric(metricName, dimensions, props?) | Return the given named metric for this browser. |
| metric | Creates a CloudWatch metric for tracking browser errors. |
| metric | Creates a CloudWatch metric for tracking browser api operations.. |
| metric | Creates a CloudWatch metric for tracking browser invocations. |
| metric | Creates a CloudWatch metric for tracking browser latencies. |
| metric | Creates a CloudWatch metric for tracking browser session duration. |
| metric | Creates a CloudWatch metric for tracking browser system errors. |
| metric | Creates a CloudWatch metric for tracking browser user takeovers. |
| metric | Creates a CloudWatch metric for tracking browser user takeovers duration. |
| metric | Creates a CloudWatch metric for tracking browser user takeovers released. |
| metric | Creates a CloudWatch metric for tracking browser throttles. |
| metric | Creates a CloudWatch metric for tracking browser user errors. |
| to | Returns a string representation of this construct. |
| static from | Creates an Browser Custom reference from an existing browser's attributes. |
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
RemovalPolicy
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โ - The IAM principal to grant permissions to. - actions
stringโ - The actions to grant.
Returns
Grants IAM actions to the IAM Principal.
grantRead(grantee)
public grantRead(grantee: IGrantable): Grant
Parameters
- grantee
IGrantableโ - The IAM principal to grant read permissions to.
Returns
Grant read permissions on this browser to an IAM principal.
This includes both read permissions on the specific browser and list permissions on all browsers.
grantUse(grantee)
public grantUse(grantee: IGrantable): Grant
Parameters
- grantee
IGrantableโ - The IAM principal to grant invoke permissions to.
Returns
Grant invoke permissions on this browser to an IAM principal.
metric(metricName, dimensions, props?)
public metric(metricName: string, dimensions: { [string]: string }, props?: MetricOptions): Metric
Parameters
- metricName
string - dimensions
{ [string]: string } - props
MetricOptions
Returns
Return the given named metric for this browser.
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.
metricErrorsForApiOperation(operation, props?)
public metricErrorsForApiOperation(operation: string, props?: MetricOptions): Metric
Parameters
- operation
string - props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking browser errors.
metricForApiOperation(metricName, operation, props?)
public metricForApiOperation(metricName: string, operation: string, props?: MetricOptions): Metric
Parameters
- metricName
string - operation
string - props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking browser api operations..
metricInvocationsForApiOperation(operation, props?)
public metricInvocationsForApiOperation(operation: string, props?: MetricOptions): Metric
Parameters
- operation
string - props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking browser invocations.
metricLatencyForApiOperation(operation, props?)
public metricLatencyForApiOperation(operation: string, props?: MetricOptions): Metric
Parameters
- operation
string - props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking browser latencies.
metricSessionDuration(props?)
public metricSessionDuration(props?: MetricOptions): Metric
Parameters
- props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking browser session duration.
metricSystemErrorsForApiOperation(operation, props?)
public metricSystemErrorsForApiOperation(operation: string, props?: MetricOptions): Metric
Parameters
- operation
string - props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking browser system errors.
metricTakeOverCount(props?)
public metricTakeOverCount(props?: MetricOptions): Metric
Parameters
- props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking browser user takeovers.
metricTakeOverDuration(props?)
public metricTakeOverDuration(props?: MetricOptions): Metric
Parameters
- props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking browser user takeovers duration.
metricTakeOverReleaseCount(props?)
public metricTakeOverReleaseCount(props?: MetricOptions): Metric
Parameters
- props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking browser user takeovers released.
metricThrottlesForApiOperation(operation, props?)
public metricThrottlesForApiOperation(operation: string, props?: MetricOptions): Metric
Parameters
- operation
string - props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking browser throttles.
metricUserErrorsForApiOperation(operation, props?)
public metricUserErrorsForApiOperation(operation: string, props?: MetricOptions): Metric
Parameters
- operation
string - props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking browser user errors.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
static fromBrowserCustomAttributes(scope, id, attrs)
public static fromBrowserCustomAttributes(scope: Construct, id: string, attrs: BrowserCustomAttributes): IBrowserCustom
Parameters
- scope
Constructโ - The construct scope. - id
stringโ - Identifier of the construct. - attrs
Browserโ - Attributes of the existing browser custom.Custom Attributes
Returns
Creates an Browser Custom reference from an existing browser's attributes.

.NET
Go
Java
Python
TypeScript (