Class TlsCertificate
Represents a TLS certificate.
Namespace: Amazon.CDK.AWS.AppMesh
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class TlsCertificate : DeputyBase
Syntax (vb)
Public MustInherit Class TlsCertificate Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
// A Virtual Node with listener TLS from an ACM provided certificate
Certificate cert;
Mesh mesh;
var node = new VirtualNode(this, "node", new VirtualNodeProps {
Mesh = mesh,
ServiceDiscovery = ServiceDiscovery.Dns("node"),
Listeners = new [] { VirtualNodeListener.Grpc(new GrpcVirtualNodeListenerOptions {
Port = 80,
Tls = new ListenerTlsOptions {
Mode = TlsMode.STRICT,
Certificate = TlsCertificate.Acm(cert)
}
}) }
});
// A Virtual Gateway with listener TLS from a customer provided file certificate
var gateway = new VirtualGateway(this, "gateway", new VirtualGatewayProps {
Mesh = mesh,
Listeners = new [] { VirtualGatewayListener.Grpc(new GrpcGatewayListenerOptions {
Port = 8080,
Tls = new ListenerTlsOptions {
Mode = TlsMode.STRICT,
Certificate = TlsCertificate.File("path/to/certChain", "path/to/privateKey")
}
}) },
VirtualGatewayName = "gateway"
});
// A Virtual Gateway with listener TLS from a SDS provided certificate
var gateway2 = new VirtualGateway(this, "gateway2", new VirtualGatewayProps {
Mesh = mesh,
Listeners = new [] { VirtualGatewayListener.Http2(new Http2GatewayListenerOptions {
Port = 8080,
Tls = new ListenerTlsOptions {
Mode = TlsMode.STRICT,
Certificate = TlsCertificate.Sds("secrete_certificate")
}
}) },
VirtualGatewayName = "gateway2"
});
Synopsis
Constructors
TlsCertificate() | Represents a TLS certificate. |
Methods
Acm(ICertificate) | Returns an ACM TLS Certificate. |
Bind(Construct) | Returns TLS certificate based provider. |
File(string, string) | Returns an File TLS Certificate. |
Sds(string) | Returns an SDS TLS Certificate. |
Constructors
TlsCertificate()
Represents a TLS certificate.
protected TlsCertificate()
Remarks
ExampleMetadata: infused
Examples
// A Virtual Node with listener TLS from an ACM provided certificate
Certificate cert;
Mesh mesh;
var node = new VirtualNode(this, "node", new VirtualNodeProps {
Mesh = mesh,
ServiceDiscovery = ServiceDiscovery.Dns("node"),
Listeners = new [] { VirtualNodeListener.Grpc(new GrpcVirtualNodeListenerOptions {
Port = 80,
Tls = new ListenerTlsOptions {
Mode = TlsMode.STRICT,
Certificate = TlsCertificate.Acm(cert)
}
}) }
});
// A Virtual Gateway with listener TLS from a customer provided file certificate
var gateway = new VirtualGateway(this, "gateway", new VirtualGatewayProps {
Mesh = mesh,
Listeners = new [] { VirtualGatewayListener.Grpc(new GrpcGatewayListenerOptions {
Port = 8080,
Tls = new ListenerTlsOptions {
Mode = TlsMode.STRICT,
Certificate = TlsCertificate.File("path/to/certChain", "path/to/privateKey")
}
}) },
VirtualGatewayName = "gateway"
});
// A Virtual Gateway with listener TLS from a SDS provided certificate
var gateway2 = new VirtualGateway(this, "gateway2", new VirtualGatewayProps {
Mesh = mesh,
Listeners = new [] { VirtualGatewayListener.Http2(new Http2GatewayListenerOptions {
Port = 8080,
Tls = new ListenerTlsOptions {
Mode = TlsMode.STRICT,
Certificate = TlsCertificate.Sds("secrete_certificate")
}
}) },
VirtualGatewayName = "gateway2"
});
Methods
Acm(ICertificate)
Returns an ACM TLS Certificate.
public static TlsCertificate Acm(ICertificate certificate)
Parameters
- certificate ICertificate
Returns
Remarks
ExampleMetadata: infused
Bind(Construct)
Returns TLS certificate based provider.
public abstract ITlsCertificateConfig Bind(Construct scope)
Parameters
- scope Construct
Returns
Remarks
ExampleMetadata: infused
File(string, string)
Returns an File TLS Certificate.
public static MutualTlsCertificate File(string certificateChainPath, string privateKeyPath)
Parameters
Returns
Remarks
ExampleMetadata: infused
Sds(string)
Returns an SDS TLS Certificate.
public static MutualTlsCertificate Sds(string secretName)
Parameters
- secretName string
Returns
Remarks
ExampleMetadata: infused