createAgentRuntime method

Future<CreateAgentRuntimeResponse> createAgentRuntime({
  1. required AgentRuntimeArtifact agentRuntimeArtifact,
  2. required String agentRuntimeName,
  3. required NetworkConfiguration networkConfiguration,
  4. required String roleArn,
  5. AuthorizerConfiguration? authorizerConfiguration,
  6. String? clientToken,
  7. String? description,
  8. Map<String, String>? environmentVariables,
  9. List<FilesystemConfiguration>? filesystemConfigurations,
  10. LifecycleConfiguration? lifecycleConfiguration,
  11. ProtocolConfiguration? protocolConfiguration,
  12. RequestHeaderConfiguration? requestHeaderConfiguration,
  13. Map<String, String>? tags,
})

Creates an Amazon Bedrock AgentCore Runtime.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter agentRuntimeArtifact : The artifact of the AgentCore Runtime.

Parameter agentRuntimeName : The name of the AgentCore Runtime.

Parameter networkConfiguration : The network configuration for the AgentCore Runtime.

Parameter roleArn : The IAM role ARN that provides permissions for the AgentCore Runtime.

Parameter authorizerConfiguration : The authorizer configuration for the AgentCore Runtime.

Parameter clientToken : A unique, case-sensitive identifier to ensure idempotency of the request.

Parameter description : The description of the AgentCore Runtime.

Parameter environmentVariables : Environment variables to set in the AgentCore Runtime environment.

Parameter filesystemConfigurations : The filesystem configurations to mount into the AgentCore Runtime. Use filesystem configurations to provide persistent storage to your AgentCore Runtime sessions.

Parameter lifecycleConfiguration : The life cycle configuration for the AgentCore Runtime.

Parameter requestHeaderConfiguration : Configuration for HTTP request headers that will be passed through to the runtime.

Parameter tags : A map of tag keys and values to assign to the agent runtime. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment.

Implementation

Future<CreateAgentRuntimeResponse> createAgentRuntime({
  required AgentRuntimeArtifact agentRuntimeArtifact,
  required String agentRuntimeName,
  required NetworkConfiguration networkConfiguration,
  required String roleArn,
  AuthorizerConfiguration? authorizerConfiguration,
  String? clientToken,
  String? description,
  Map<String, String>? environmentVariables,
  List<FilesystemConfiguration>? filesystemConfigurations,
  LifecycleConfiguration? lifecycleConfiguration,
  ProtocolConfiguration? protocolConfiguration,
  RequestHeaderConfiguration? requestHeaderConfiguration,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'agentRuntimeArtifact': agentRuntimeArtifact,
    'agentRuntimeName': agentRuntimeName,
    'networkConfiguration': networkConfiguration,
    'roleArn': roleArn,
    if (authorizerConfiguration != null)
      'authorizerConfiguration': authorizerConfiguration,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
    if (environmentVariables != null)
      'environmentVariables': environmentVariables,
    if (filesystemConfigurations != null)
      'filesystemConfigurations': filesystemConfigurations,
    if (lifecycleConfiguration != null)
      'lifecycleConfiguration': lifecycleConfiguration,
    if (protocolConfiguration != null)
      'protocolConfiguration': protocolConfiguration,
    if (requestHeaderConfiguration != null)
      'requestHeaderConfiguration': requestHeaderConfiguration,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/runtimes/',
    exceptionFnMap: _exceptionFns,
  );
  return CreateAgentRuntimeResponse.fromJson(response);
}