# CfnContextProps

Properties for defining a `CfnContext`.

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

- Source: Generated at build time
- Type last changed: v2.264.0 · 10 Aug 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_sagemaker as sagemaker } from 'aws-cdk-lib';
const cfnContextProps: sagemaker.CfnContextProps = {
  contextName: 'contextName',
  contextType: 'contextType',
  source: {
    sourceUri: 'sourceUri',

    // the properties below are optional
    sourceId: 'sourceId',
    sourceType: 'sourceType',
  },

  // the properties below are optional
  description: 'description',
  properties: {
    propertiesKey: 'properties',
  },
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_sagemaker as sagemaker

cfn_context_props = sagemaker.CfnContextProps(
    context_name="contextName",
    context_type="contextType",
    source=sagemaker.CfnContext.SourceProperty(
        source_uri="sourceUri",

        # the properties below are optional
        source_id="sourceId",
        source_type="sourceType"
    ),

    # the properties below are optional
    description="description",
    properties={
        "properties_key": "properties"
    },
    tags=[sagemaker.CfnContext.TagsItemsProperty(
        key="key",
        value="value"
    )]
)
```

Java:

```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.sagemaker.*;

CfnContextProps cfnContextProps = CfnContextProps.builder()
        .contextName("contextName")
        .contextType("contextType")
        .source(SourceProperty.builder()
                .sourceUri("sourceUri")

                // the properties below are optional
                .sourceId("sourceId")
                .sourceType("sourceType")
                .build())

        // the properties below are optional
        .description("description")
        .properties(Map.of(
                "propertiesKey", "properties"))
        .tags(List.of(TagsItemsProperty.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Sagemaker;

var cfnContextProps = new CfnContextProps {
    ContextName = "contextName",
    ContextType = "contextType",
    Source = new SourceProperty {
        SourceUri = "sourceUri",

        // the properties below are optional
        SourceId = "sourceId",
        SourceType = "sourceType"
    },

    // the properties below are optional
    Description = "description",
    Properties = new Dictionary<string, string> {
        { "propertiesKey", "properties" }
    },
    Tags = new [] { new TagsItemsProperty {
        Key = "key",
        Value = "value"
    } }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/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/awscdk"

cfnContextProps := &CfnContextProps{
	ContextName: jsii.String("contextName"),
	ContextType: jsii.String("contextType"),
	Source: &SourceProperty{
		SourceUri: jsii.String("sourceUri"),

		// the properties below are optional
		SourceId: jsii.String("sourceId"),
		SourceType: jsii.String("sourceType"),
	},

	// the properties below are optional
	Description: jsii.String("description"),
	Properties: map[string]*string{
		"propertiesKey": jsii.String("properties"),
	},
	Tags: []TagsItemsProperty{
		&TagsItemsProperty{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}
```

## Properties

- `contextName`: string (required) — The name of the context.

  Must be unique to your account in an AWS Region.

- `contextType`: string (required) — The context type.

- `description`: string — The description of the context.

- `properties`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | { [key: string]: string } — A list of properties to add to the context.

- `source`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnContext.SourceProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnContext.SourceProperty.html) (required) — The source type, ID, and URI.

- `tags`: [CfnContext.TagsItemsProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnContext.TagsItemsProperty.html)[] — A list of tags to apply to the context.
