Skip to content
v2.277.0

HttpPostLifecycleHookOptions Struct Added in v2.277.0 ​

Options for an HTTP POST lifecycle hook.

Example ​

ts
const repository = new ecr.Repository(this, 'TestRepository', {
  repositoryName: 'test-agent-runtime',
});

const agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, 'v1.0.0');

new agentcore.Runtime(this, 'test-runtime', {
  runtimeName: 'test_runtime',
  agentRuntimeArtifact: agentRuntimeArtifact,
  platformVersion: agentcore.PlatformVersion.V2,
  buildHooks: {
    warmup: agentcore.LifecycleHook.httpPost({ path: '/warmup', port: 8080 }),
  },
});
python
repository = ecr.Repository(self, "TestRepository",
    repository_name="test-agent-runtime"
)

agent_runtime_artifact = agentcore.AgentRuntimeArtifact.from_ecr_repository(repository, "v1.0.0")

agentcore.Runtime(self, "test-runtime",
    runtime_name="test_runtime",
    agent_runtime_artifact=agent_runtime_artifact,
    platform_version=agentcore.PlatformVersion.V2,
    build_hooks=agentcore.BuildLifecycleHooks(
        warmup=agentcore.LifecycleHook.http_post(path="/warmup", port=8080)
    )
)
java
Repository repository = Repository.Builder.create(this, "TestRepository")
        .repositoryName("test-agent-runtime")
        .build();

AgentRuntimeArtifact agentRuntimeArtifact = AgentRuntimeArtifact.fromEcrRepository(repository, "v1.0.0");

Runtime.Builder.create(this, "test-runtime")
        .runtimeName("test_runtime")
        .agentRuntimeArtifact(agentRuntimeArtifact)
        .platformVersion(PlatformVersion.V2)
        .buildHooks(BuildLifecycleHooks.builder()
                .warmup(LifecycleHook.httpPost(HttpPostLifecycleHookOptions.builder().path("/warmup").port(8080).build()))
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
var repository = new Repository(this, "TestRepository", new RepositoryProps {
    RepositoryName = "test-agent-runtime"
});

var agentRuntimeArtifact = AgentRuntimeArtifact.FromEcrRepository(repository, "v1.0.0");

new Runtime(this, "test-runtime", new RuntimeProps {
    RuntimeName = "test_runtime",
    AgentRuntimeArtifact = agentRuntimeArtifact,
    PlatformVersion = PlatformVersion.V2,
    BuildHooks = new BuildLifecycleHooks {
        Warmup = LifecycleHook.HttpPost(new HttpPostLifecycleHookOptions { Path = "/warmup", Port = 8080 })
    }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
repository := ecr.NewRepository(this, jsii.String("TestRepository"), &RepositoryProps{
	RepositoryName: jsii.String("test-agent-runtime"),
})

agentRuntimeArtifact := agentcore.AgentRuntimeArtifact_FromEcrRepository(repository, jsii.String("v1.0.0"))

agentcore.NewRuntime(this, jsii.String("test-runtime"), &RuntimeProps{
	RuntimeName: jsii.String("test_runtime"),
	AgentRuntimeArtifact: agentRuntimeArtifact,
	PlatformVersion: agentcore.PlatformVersion_V2(),
	BuildHooks: &BuildLifecycleHooks{
		Warmup: agentcore.LifecycleHook_HttpPost(&HttpPostLifecycleHookOptions{
			Path: jsii.String("/warmup"),
			Port: jsii.Number(8080),
		}),
	},
})

Properties ​

pathstringpathstrpathStringPathstringPath*string required #
The path in the agent's container that the service calls, for example `/warmup`.

Must be 1-32 characters, start with /, and must not be a route the service already calls on the container, such as the invocation path or the default health check.

portoptionalnumberportoptionalint | floatportoptionalNumberPortoptionaldoublePortoptional*float64 #
The port in the agent's container that the service calls.

Default: the runtime's server port

Must be between 8000 and 12000.