Interface IFixedResponseOptions
Options for ListenerAction.fixedResponse()
.
Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IFixedResponseOptions
Syntax (vb)
Public Interface IFixedResponseOptions
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.CertificateManager;
Certificate certificate;
ApplicationLoadBalancer lb;
Bucket bucket;
var trustStore = new TrustStore(this, "Store", new TrustStoreProps {
Bucket = bucket,
Key = "rootCA_cert.pem"
});
lb.AddListener("Listener", new BaseApplicationListenerProps {
Port = 443,
Protocol = ApplicationProtocol.HTTPS,
Certificates = new [] { certificate },
// mTLS settings
MutualAuthentication = new MutualAuthentication {
AdvertiseTrustStoreCaNames = true,
IgnoreClientCertificateExpiry = false,
MutualAuthenticationMode = MutualAuthenticationMode.VERIFY,
TrustStore = trustStore
},
DefaultAction = ListenerAction.FixedResponse(200, new FixedResponseOptions { ContentType = "text/plain", MessageBody = "Success mTLS" })
});
Synopsis
Properties
Content |
Content Type of the response. |
Message |
The response body. |
Properties
ContentType
Content Type of the response.
virtual string ContentType { get; }
Property Value
System.
Remarks
Valid Values: text/plain | text/css | text/html | application/javascript | application/json
Default: - Automatically determined
MessageBody
The response body.
virtual string MessageBody { get; }
Property Value
System.
Remarks
Default: - No body