FixedResponseConfigProperty Struct
Specifies information required when returning a custom HTTP response.
| Source | |
|---|---|
| Type last changed |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_elasticloadbalancingv2 as elbv2 } from 'aws-cdk-lib';
const fixedResponseConfigProperty: elbv2.CfnListenerRule.FixedResponseConfigProperty = {
statusCode: 'statusCode',
// the properties below are optional
contentType: 'contentType',
messageBody: 'messageBody',
};
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_elasticloadbalancingv2 as elbv2
fixed_response_config_property = elbv2.CfnListenerRule.FixedResponseConfigProperty(
status_code="statusCode",
# the properties below are optional
content_type="contentType",
message_body="messageBody"
)
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.elasticloadbalancingv2.*;
FixedResponseConfigProperty fixedResponseConfigProperty = FixedResponseConfigProperty.builder()
.statusCode("statusCode")
// the properties below are optional
.contentType("contentType")
.messageBody("messageBody")
.build();
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.ElasticLoadBalancingV2;
var fixedResponseConfigProperty = new FixedResponseConfigProperty {
StatusCode = "statusCode",
// the properties below are optional
ContentType = "contentType",
MessageBody = "messageBody"
};
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"
fixedResponseConfigProperty := &FixedResponseConfigProperty{
StatusCode: jsii.String("statusCode"),
// the properties below are optional
ContentType: jsii.String("contentType"),
MessageBody: jsii.String("messageBody"),
}
Properties
contentTypeoptionalstringcontent_typeoptionalstrcontentTypeoptionalStringContentTypeoptionalstringContentTypeoptional*string #The content type.
Valid Values: text/plain | text/css | text/html | application/javascript | application/json
messageBodyoptionalstringmessage_bodyoptionalstrmessageBodyoptionalStringMessageBodyoptionalstringMessageBodyoptional*string #The message.
The HTTP response code (2XX, 4XX, or 5XX).