interface FixedResponseOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ElasticLoadBalancingV2.FixedResponseOptions |
Java | software.amazon.awscdk.services.elasticloadbalancingv2.FixedResponseOptions |
Python | aws_cdk.aws_elasticloadbalancingv2.FixedResponseOptions |
TypeScript (source) | @aws-cdk/aws-elasticloadbalancingv2 » FixedResponseOptions |
Options for ListenerAction.fixedResponse()
.
Example
declare const listener: elbv2.ApplicationListener;
listener.addAction('Fixed', {
priority: 10,
conditions: [
elbv2.ListenerCondition.pathPatterns(['/ok']),
],
action: elbv2.ListenerAction.fixedResponse(200, {
contentType: elbv2.ContentType.TEXT_PLAIN,
messageBody: 'OK',
})
});
Properties
Name | Type | Description |
---|---|---|
content | string | Content Type of the response. |
message | string | The response body. |
contentType?
Type:
string
(optional, default: Automatically determined)
Content Type of the response.
Valid Values: text/plain | text/css | text/html | application/javascript | application/json
messageBody?
Type:
string
(optional, default: No body)
The response body.