# CfnApplicationInferenceProfileProps

Properties for defining a `CfnApplicationInferenceProfile`.

Used as props by: [CfnApplicationInferenceProfile](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrock.CfnApplicationInferenceProfile.html)

- Source: Generated at build time
- Type last changed: v2.166.0 · 7 Nov 2024

## Example

TypeScript:

```ts
// Create or reference an existing L1 CfnApplicationInferenceProfile
const cfnProfile = new aws_bedrock_cfn.CfnApplicationInferenceProfile(this, 'CfnProfile', {
  inferenceProfileName: 'my-cfn-profile',
  modelSource: {
    copyFrom: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0.invokableArn,
  },
  description: 'Profile created via L1 construct',
});

// Import the L1 construct as an L2 ApplicationInferenceProfile
const importedFromCfn = bedrock.ApplicationInferenceProfile.fromCfnApplicationInferenceProfile(cfnProfile);

// Grant permissions to use the imported profile
const lambdaFunction = new lambda.Function(this, 'MyFunction', {
  runtime: lambda.Runtime.PYTHON_3_11,
  handler: 'index.handler',
  code: lambda.Code.fromInline('def handler(event, context): return "Hello"'),
});

importedFromCfn.grantProfileUsage(lambdaFunction);
```

Python:

```python
# Create or reference an existing L1 CfnApplicationInferenceProfile
cfn_profile = aws_bedrock_cfn.CfnApplicationInferenceProfile(self, "CfnProfile",
    inference_profile_name="my-cfn-profile",
    model_source=aws_bedrock_cfn.CfnApplicationInferenceProfile.InferenceProfileModelSourceProperty(
        copy_from=bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0.invokable_arn
    ),
    description="Profile created via L1 construct"
)

# Import the L1 construct as an L2 ApplicationInferenceProfile
imported_from_cfn = bedrock.ApplicationInferenceProfile.from_cfn_application_inference_profile(cfn_profile)

# Grant permissions to use the imported profile
lambda_function = lambda_.Function(self, "MyFunction",
    runtime=lambda_.Runtime.PYTHON_3_11,
    handler="index.handler",
    code=lambda_.Code.from_inline("def handler(event, context): return \"Hello\"")
)

imported_from_cfn.grant_profile_usage(lambda_function)
```

Java:

```java
// Create or reference an existing L1 CfnApplicationInferenceProfile
CfnApplicationInferenceProfile cfnProfile = CfnApplicationInferenceProfile.Builder.create(this, "CfnProfile")
        .inferenceProfileName("my-cfn-profile")
        .modelSource(InferenceProfileModelSourceProperty.builder()
                .copyFrom(BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0.getInvokableArn())
                .build())
        .description("Profile created via L1 construct")
        .build();

// Import the L1 construct as an L2 ApplicationInferenceProfile
IInferenceProfile importedFromCfn = ApplicationInferenceProfile.fromCfnApplicationInferenceProfile(cfnProfile);

// Grant permissions to use the imported profile
Function lambdaFunction = Function.Builder.create(this, "MyFunction")
        .runtime(Runtime.PYTHON_3_11)
        .handler("index.handler")
        .code(Code.fromInline("def handler(event, context): return \"Hello\""))
        .build();

importedFromCfn.grantProfileUsage(lambdaFunction);
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// Create or reference an existing L1 CfnApplicationInferenceProfile
var cfnProfile = new CfnApplicationInferenceProfile(this, "CfnProfile", new CfnApplicationInferenceProfileProps {
    InferenceProfileName = "my-cfn-profile",
    ModelSource = new InferenceProfileModelSourceProperty {
        CopyFrom = BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0.InvokableArn
    },
    Description = "Profile created via L1 construct"
});

// Import the L1 construct as an L2 ApplicationInferenceProfile
var importedFromCfn = ApplicationInferenceProfile.FromCfnApplicationInferenceProfile(cfnProfile);

// Grant permissions to use the imported profile
var lambdaFunction = new Function(this, "MyFunction", new FunctionProps {
    Runtime = Runtime.PYTHON_3_11,
    Handler = "index.handler",
    Code = Code.FromInline("def handler(event, context): return \"Hello\"")
});

importedFromCfn.GrantProfileUsage(lambdaFunction);
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// Create or reference an existing L1 CfnApplicationInferenceProfile
cfnProfile := awscdk.Aws_bedrock.NewCfnApplicationInferenceProfile(this, jsii.String("CfnProfile"), &CfnApplicationInferenceProfileProps{
	InferenceProfileName: jsii.String("my-cfn-profile"),
	ModelSource: &InferenceProfileModelSourceProperty{
		CopyFrom: bedrock.BedrockFoundationModel_ANTHROPIC_CLAUDE_3_5_SONNET_V1_0().InvokableArn,
	},
	Description: jsii.String("Profile created via L1 construct"),
})

// Import the L1 construct as an L2 ApplicationInferenceProfile
importedFromCfn := bedrock.ApplicationInferenceProfile_FromCfnApplicationInferenceProfile(cfnProfile)

// Grant permissions to use the imported profile
lambdaFunction := lambda.NewFunction(this, jsii.String("MyFunction"), &FunctionProps{
	Runtime: lambda.Runtime_PYTHON_3_11(),
	Handler: jsii.String("index.handler"),
	Code: lambda.Code_FromInline(jsii.String("def handler(event, context): return \"Hello\"")),
})

importedFromCfn.GrantProfileUsage(lambdaFunction)
```

## Properties

- `description`: string — The description of the inference profile.

- `inferenceProfileName`: string (required) — The name of the inference profile.

- `modelSource`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnApplicationInferenceProfile.InferenceProfileModelSourceProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrock.CfnApplicationInferenceProfile.InferenceProfileModelSourceProperty.html) — Contains configurations for the inference profile to copy as the resource.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — A list of tags associated with the inference profile.
