RequestHeaderConfiguration Struct
Configuration for HTTP request headers that will be passed through to the runtime.
| Source | aws-bedrockagentcore/lib/runtime/types.ts |
|---|---|
| Type last changed |
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,
requestHeaderConfiguration: {
allowlistedHeaders: ['X-Amzn-Bedrock-AgentCore-Runtime-Custom-H1'],
},
});
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,
request_header_configuration=agentcore.RequestHeaderConfiguration(
allowlisted_headers=["X-Amzn-Bedrock-AgentCore-Runtime-Custom-H1"]
)
)
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)
.requestHeaderConfiguration(RequestHeaderConfiguration.builder()
.allowlistedHeaders(List.of("X-Amzn-Bedrock-AgentCore-Runtime-Custom-H1"))
.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,
RequestHeaderConfiguration = new RequestHeaderConfiguration {
AllowlistedHeaders = new [] { "X-Amzn-Bedrock-AgentCore-Runtime-Custom-H1" }
}
});
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,
RequestHeaderConfiguration: &RequestHeaderConfiguration{
AllowlistedHeaders: []*string{
jsii.String("X-Amzn-Bedrock-AgentCore-Runtime-Custom-H1"),
},
},
})
Properties
allowlistedHeadersoptionalstring[]allowlisted_headersoptionaltyping.List[str]allowlistedHeadersoptionalList<String>AllowlistedHeadersoptionalstring[]AllowlistedHeadersoptional*[]*string #A list of HTTP request headers that are allowed to be passed through to the runtime.
Default: No request headers allowed