ServiceConnectTlsConfiguration Struct
TLS configuration for Service Connect service.
| Source | aws-ecs/lib/base/base-service.ts |
|---|---|
| Type last changed |
Example
ts
declare const cluster: ecs.Cluster;
declare const taskDefinition: ecs.TaskDefinition;
declare const kmsKey: kms.IKey;
declare const role: iam.IRole;
const service = new ecs.FargateService(this, 'FargateService', {
cluster,
taskDefinition,
serviceConnectConfiguration: {
services: [
{
tls: {
role,
kmsKey,
awsPcaAuthorityArn: 'arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/123456789012',
},
portMappingName: 'api',
},
],
namespace: 'sample namespace',
},
});
python
# cluster: ecs.Cluster
# task_definition: ecs.TaskDefinition
# kms_key: kms.IKey
# role: iam.IRole
service = ecs.FargateService(self, "FargateService",
cluster=cluster,
task_definition=task_definition,
service_connect_configuration=ecs.ServiceConnectProps(
services=[ecs.ServiceConnectService(
tls=ecs.ServiceConnectTlsConfiguration(
role=role,
kms_key=kms_key,
aws_pca_authority_arn="arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/123456789012"
),
port_mapping_name="api"
)
],
namespace="sample namespace"
)
)
java
Cluster cluster;
TaskDefinition taskDefinition;
IKey kmsKey;
IRole role;
FargateService service = FargateService.Builder.create(this, "FargateService")
.cluster(cluster)
.taskDefinition(taskDefinition)
.serviceConnectConfiguration(ServiceConnectProps.builder()
.services(List.of(ServiceConnectService.builder()
.tls(ServiceConnectTlsConfiguration.builder()
.role(role)
.kmsKey(kmsKey)
.awsPcaAuthorityArn("arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/123456789012")
.build())
.portMappingName("api")
.build()))
.namespace("sample namespace")
.build())
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
Cluster cluster;
TaskDefinition taskDefinition;
IKey kmsKey;
IRole role;
var service = new FargateService(this, "FargateService", new FargateServiceProps {
Cluster = cluster,
TaskDefinition = taskDefinition,
ServiceConnectConfiguration = new ServiceConnectProps {
Services = new [] { new ServiceConnectService {
Tls = new ServiceConnectTlsConfiguration {
Role = role,
KmsKey = kmsKey,
AwsPcaAuthorityArn = "arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/123456789012"
},
PortMappingName = "api"
} },
Namespace = "sample namespace"
}
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var cluster Cluster
var taskDefinition TaskDefinition
var kmsKey IKey
var role IRole
service := ecs.NewFargateService(this, jsii.String("FargateService"), &FargateServiceProps{
Cluster: Cluster,
TaskDefinition: TaskDefinition,
ServiceConnectConfiguration: &ServiceConnectProps{
Services: []ServiceConnectService{
&ServiceConnectService{
Tls: &ServiceConnectTlsConfiguration{
Role: *Role,
KmsKey: *KmsKey,
AwsPcaAuthorityArn: jsii.String("arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/123456789012"),
},
PortMappingName: jsii.String("api"),
},
},
Namespace: jsii.String("sample namespace"),
},
})
Properties
awsPcaAuthorityArnoptionalstringaws_pca_authority_arnoptionalstrawsPcaAuthorityArnoptionalStringAwsPcaAuthorityArnoptionalstringAwsPcaAuthorityArnoptional*string = none #The ARN of the certificate root authority that secures your service.