Skip to content
v2.274.0

Experimental

@aws-cdk/aws-bedrock-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

Function Class ​

Represents a function in a function schema.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as bedrock_alpha from '@aws-cdk/aws-bedrock-alpha';
const function_ = new bedrock_alpha.Function({
  description: 'description',
  name: 'name',

  // the properties below are optional
  parameters: {
    parametersKey: {
      type: bedrock_alpha.ParameterType.STRING,

      // the properties below are optional
      description: 'description',
      required: false,
    },
  },
  requireConfirmation: bedrock_alpha.RequireConfirmation.ENABLED,
});
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_bedrock_alpha as bedrock_alpha

function_ = bedrock_alpha.Function(
    description="description",
    name="name",

    # the properties below are optional
    parameters={
        "parameters_key": bedrock_alpha.FunctionParameterProps(
            type=bedrock_alpha.ParameterType.STRING,

            # the properties below are optional
            description="description",
            required=False
        )
    },
    require_confirmation=bedrock_alpha.RequireConfirmation.ENABLED
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.alpha.*;

Function function_ = Function.Builder.create()
        .description("description")
        .name("name")

        // the properties below are optional
        .parameters(Map.of(
                "parametersKey", FunctionParameterProps.builder()
                        .type(ParameterType.STRING)

                        // the properties below are optional
                        .description("description")
                        .required(false)
                        .build()))
        .requireConfirmation(RequireConfirmation.ENABLED)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Bedrock.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock.Alpha;

var function_ = new Function(new FunctionProps {
    Description = "description",
    Name = "name",

    // the properties below are optional
    Parameters = new Dictionary<string, FunctionParameterProps> {
        { "parametersKey", new FunctionParameterProps {
            Type = ParameterType.STRING,

            // the properties below are optional
            Description = "description",
            Required = false
        } }
    },
    RequireConfirmation = RequireConfirmation.ENABLED
});
go
// Install: go get github.com/aws/aws-cdk-go/awsbedrockalpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awsbedrockalpha"

function_ := bedrock_alpha.NewFunction(&FunctionProps{
	Description: jsii.String("description"),
	Name: jsii.String("name"),

	// the properties below are optional
	Parameters: map[string]FunctionParameterProps{
		"parametersKey": &FunctionParameterProps{
			"type": bedrock_alpha.ParameterType_STRING,

			// the properties below are optional
			"description": jsii.String("description"),
			"required": jsii.Boolean(false),
		},
	},
	RequireConfirmation: bedrock_alpha.RequireConfirmation_ENABLED,
})

Initializer ​

ts
new Function(props: FunctionProps)
python
Function(props: FunctionProps)
java
new Function(FunctionProps props)
csharp
new Function(FunctionProps props)
go
NewFunction(Props FunctionProps)

Properties ​

descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*stringrequired#
Description of the function.
namestringnamestrnameStringNamestringName*stringrequired#
The name of the function.
parameters{ [key: string]: FunctionParameter }parameterstyping.Mapping[str, FunctionParameter]parametersMap<String, FunctionParameter>ParametersIDictionary<string, FunctionParameter>Parameters*map[string]FunctionParameterrequired#
Parameters for the function.
requireConfirmationRequireConfirmationrequire_confirmationRequireConfirmationrequireConfirmationRequireConfirmationRequireConfirmationRequireConfirmationRequireConfirmationRequireConfirmationrequired#
Whether to require confirmation before executing the function.