The aws:sagemaker/appImageConfig:AppImageConfig resource, part of the Pulumi AWS provider, defines configuration for custom container images used in SageMaker Studio applications. This guide focuses on three capabilities: KernelGateway kernel specifications, Code Editor setup, and file system configuration.
App Image Configs connect custom container images to SageMaker Studio environments. You must specify exactly one application type: KernelGateway, Code Editor, or JupyterLab. The examples are intentionally small. Combine them with your own SageMaker Domain and container images.
Configure a KernelGateway image with kernel specs
SageMaker Studio notebooks require kernel specifications that define which programming environments users can access.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.sagemaker.AppImageConfig("test", {
appImageConfigName: "example",
kernelGatewayImageConfig: {
kernelSpecs: [{
name: "example",
}],
},
});
import pulumi
import pulumi_aws as aws
test = aws.sagemaker.AppImageConfig("test",
app_image_config_name="example",
kernel_gateway_image_config={
"kernel_specs": [{
"name": "example",
}],
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/sagemaker"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sagemaker.NewAppImageConfig(ctx, "test", &sagemaker.AppImageConfigArgs{
AppImageConfigName: pulumi.String("example"),
KernelGatewayImageConfig: &sagemaker.AppImageConfigKernelGatewayImageConfigArgs{
KernelSpecs: sagemaker.AppImageConfigKernelGatewayImageConfigKernelSpecArray{
&sagemaker.AppImageConfigKernelGatewayImageConfigKernelSpecArgs{
Name: pulumi.String("example"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = new Aws.Sagemaker.AppImageConfig("test", new()
{
AppImageConfigName = "example",
KernelGatewayImageConfig = new Aws.Sagemaker.Inputs.AppImageConfigKernelGatewayImageConfigArgs
{
KernelSpecs = new[]
{
new Aws.Sagemaker.Inputs.AppImageConfigKernelGatewayImageConfigKernelSpecArgs
{
Name = "example",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sagemaker.AppImageConfig;
import com.pulumi.aws.sagemaker.AppImageConfigArgs;
import com.pulumi.aws.sagemaker.inputs.AppImageConfigKernelGatewayImageConfigArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var test = new AppImageConfig("test", AppImageConfigArgs.builder()
.appImageConfigName("example")
.kernelGatewayImageConfig(AppImageConfigKernelGatewayImageConfigArgs.builder()
.kernelSpecs(AppImageConfigKernelGatewayImageConfigKernelSpecArgs.builder()
.name("example")
.build())
.build())
.build());
}
}
resources:
test:
type: aws:sagemaker:AppImageConfig
properties:
appImageConfigName: example
kernelGatewayImageConfig:
kernelSpecs:
- name: example
The kernelGatewayImageConfig property configures images that run as KernelGateway apps. The kernelSpecs array defines available kernels; each kernel needs a name that identifies the programming environment. This minimal configuration uses default settings for file system and other options.
Enable Code Editor with default settings
SageMaker Code Editor provides an IDE-like development experience with minimal configuration required.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.sagemaker.AppImageConfig("test", {
appImageConfigName: "example",
codeEditorAppImageConfig: {},
});
import pulumi
import pulumi_aws as aws
test = aws.sagemaker.AppImageConfig("test",
app_image_config_name="example",
code_editor_app_image_config={})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/sagemaker"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sagemaker.NewAppImageConfig(ctx, "test", &sagemaker.AppImageConfigArgs{
AppImageConfigName: pulumi.String("example"),
CodeEditorAppImageConfig: &sagemaker.AppImageConfigCodeEditorAppImageConfigArgs{},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = new Aws.Sagemaker.AppImageConfig("test", new()
{
AppImageConfigName = "example",
CodeEditorAppImageConfig = null,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sagemaker.AppImageConfig;
import com.pulumi.aws.sagemaker.AppImageConfigArgs;
import com.pulumi.aws.sagemaker.inputs.AppImageConfigCodeEditorAppImageConfigArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var test = new AppImageConfig("test", AppImageConfigArgs.builder()
.appImageConfigName("example")
.codeEditorAppImageConfig(AppImageConfigCodeEditorAppImageConfigArgs.builder()
.build())
.build());
}
}
resources:
test:
type: aws:sagemaker:AppImageConfig
properties:
appImageConfigName: example
codeEditorAppImageConfig: {}
The codeEditorAppImageConfig property enables Code Editor functionality. An empty block ({}) is valid and uses all default settings. You must configure exactly one of codeEditorAppImageConfig, jupyterLabImageConfig, or kernelGatewayImageConfig per App Image Config.
Add file system configuration to KernelGateway
KernelGateway images can include file system settings to control storage behavior.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.sagemaker.AppImageConfig("test", {
appImageConfigName: "example",
kernelGatewayImageConfig: {
kernelSpecs: [{
name: "example",
}],
fileSystemConfig: {},
},
});
import pulumi
import pulumi_aws as aws
test = aws.sagemaker.AppImageConfig("test",
app_image_config_name="example",
kernel_gateway_image_config={
"kernel_specs": [{
"name": "example",
}],
"file_system_config": {},
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/sagemaker"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sagemaker.NewAppImageConfig(ctx, "test", &sagemaker.AppImageConfigArgs{
AppImageConfigName: pulumi.String("example"),
KernelGatewayImageConfig: &sagemaker.AppImageConfigKernelGatewayImageConfigArgs{
KernelSpecs: sagemaker.AppImageConfigKernelGatewayImageConfigKernelSpecArray{
&sagemaker.AppImageConfigKernelGatewayImageConfigKernelSpecArgs{
Name: pulumi.String("example"),
},
},
FileSystemConfig: &sagemaker.AppImageConfigKernelGatewayImageConfigFileSystemConfigArgs{},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = new Aws.Sagemaker.AppImageConfig("test", new()
{
AppImageConfigName = "example",
KernelGatewayImageConfig = new Aws.Sagemaker.Inputs.AppImageConfigKernelGatewayImageConfigArgs
{
KernelSpecs = new[]
{
new Aws.Sagemaker.Inputs.AppImageConfigKernelGatewayImageConfigKernelSpecArgs
{
Name = "example",
},
},
FileSystemConfig = null,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sagemaker.AppImageConfig;
import com.pulumi.aws.sagemaker.AppImageConfigArgs;
import com.pulumi.aws.sagemaker.inputs.AppImageConfigKernelGatewayImageConfigArgs;
import com.pulumi.aws.sagemaker.inputs.AppImageConfigKernelGatewayImageConfigFileSystemConfigArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var test = new AppImageConfig("test", AppImageConfigArgs.builder()
.appImageConfigName("example")
.kernelGatewayImageConfig(AppImageConfigKernelGatewayImageConfigArgs.builder()
.kernelSpecs(AppImageConfigKernelGatewayImageConfigKernelSpecArgs.builder()
.name("example")
.build())
.fileSystemConfig(AppImageConfigKernelGatewayImageConfigFileSystemConfigArgs.builder()
.build())
.build())
.build());
}
}
resources:
test:
type: aws:sagemaker:AppImageConfig
properties:
appImageConfigName: example
kernelGatewayImageConfig:
kernelSpecs:
- name: example
fileSystemConfig: {}
This extends the basic KernelGateway configuration by adding a fileSystemConfig block. Like the Code Editor example, an empty fileSystemConfig block is valid and applies default storage settings. The kernelSpecs array still defines available kernels.
Beyond these examples
These snippets focus on specific App Image Config features: KernelGateway kernel specifications, Code Editor configuration, and file system settings. They’re intentionally minimal rather than full Studio environment deployments.
The examples assume pre-existing infrastructure such as a SageMaker Domain or Studio environment, and container images registered in ECR. They focus on image configuration rather than provisioning the surrounding infrastructure.
To keep things focused, common App Image Config patterns are omitted, including:
- JupyterLab image configuration (jupyterLabImageConfig)
- Resource tagging (tags)
- Detailed file system mount options
- Container registry authentication
These omissions are intentional: the goal is to illustrate how each App Image Config feature is wired, not provide drop-in Studio modules. See the SageMaker AppImageConfig resource reference for all available configuration options.
Let's configure AWS SageMaker App Image Configs
Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.
Try Pulumi Cloud for FREEFrequently Asked Questions
Configuration Requirements
codeEditorAppImageConfig, jupyterLabImageConfig, or kernelGatewayImageConfig. You cannot specify multiple config types simultaneously.codeEditorAppImageConfig: {} are valid configurations, as shown in the Code Editor example.Resource Properties
appImageConfigName is immutable and changing it will force resource replacement.Using a different cloud?
Explore analytics guides for other cloud providers: