Skip to content
v2.277.0

ServiceConnectService Struct ​

Interface for service connect Service props.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_ecs as ecs } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_kms as interfaces_kms } from 'aws-cdk-lib/interfaces';

declare const keyRef: interfaces_kms.IKeyRef;
declare const role: iam.Role;
const serviceConnectService: ecs.ServiceConnectService = {
  portMappingName: 'portMappingName',

  // the properties below are optional
  discoveryName: 'discoveryName',
  dnsName: 'dnsName',
  idleTimeout: cdk.Duration.minutes(30),
  ingressPortOverride: 123,
  perRequestTimeout: cdk.Duration.minutes(30),
  port: 123,
  tls: {
    awsPcaAuthorityArn: 'awsPcaAuthorityArn',
    kmsKey: keyRef,
    role: role,
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_ecs as ecs
from aws_cdk import aws_iam as iam
from aws_cdk.interfaces import aws_kms as interfaces_kms

# key_ref: interfaces_kms.IKeyRef
# role: iam.Role

service_connect_service = ecs.ServiceConnectService(
    port_mapping_name="portMappingName",

    # the properties below are optional
    discovery_name="discoveryName",
    dns_name="dnsName",
    idle_timeout=cdk.Duration.minutes(30),
    ingress_port_override=123,
    per_request_timeout=cdk.Duration.minutes(30),
    port=123,
    tls=ecs.ServiceConnectTlsConfiguration(
        aws_pca_authority_arn="awsPcaAuthorityArn",
        kms_key=key_ref,
        role=role
    )
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.ecs.*;
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.interfaces.kms.*;

IKeyRef keyRef;
Role role;

ServiceConnectService serviceConnectService = ServiceConnectService.builder()
        .portMappingName("portMappingName")

        // the properties below are optional
        .discoveryName("discoveryName")
        .dnsName("dnsName")
        .idleTimeout(Duration.minutes(30))
        .ingressPortOverride(123)
        .perRequestTimeout(Duration.minutes(30))
        .port(123)
        .tls(ServiceConnectTlsConfiguration.builder()
                .awsPcaAuthorityArn("awsPcaAuthorityArn")
                .kmsKey(keyRef)
                .role(role)
                .build())
        .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;
using Amazon.CDK.AWS.ECS;
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.Interfaces.KMS;

IKeyRef keyRef;
Role role;

var serviceConnectService = new ServiceConnectService {
    PortMappingName = "portMappingName",

    // the properties below are optional
    DiscoveryName = "discoveryName",
    DnsName = "dnsName",
    IdleTimeout = Duration.Minutes(30),
    IngressPortOverride = 123,
    PerRequestTimeout = Duration.Minutes(30),
    Port = 123,
    Tls = new ServiceConnectTlsConfiguration {
        AwsPcaAuthorityArn = "awsPcaAuthorityArn",
        KmsKey = keyRef,
        Role = role
    }
};
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"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var keyRef IKeyRef
var role Role

serviceConnectService := &ServiceConnectService{
	PortMappingName: jsii.String("portMappingName"),

	// the properties below are optional
	DiscoveryName: jsii.String("discoveryName"),
	DnsName: jsii.String("dnsName"),
	IdleTimeout: cdk.Duration_Minutes(jsii.Number(30)),
	IngressPortOverride: jsii.Number(123),
	PerRequestTimeout: cdk.Duration_*Minutes(jsii.Number(30)),
	Port: jsii.Number(123),
	Tls: &ServiceConnectTlsConfiguration{
		AwsPcaAuthorityArn: jsii.String("awsPcaAuthorityArn"),
		KmsKey: keyRef,
		Role: role,
	},
}

Properties ​

discoveryNameoptionalstringdiscovery_nameoptionalstrdiscoveryNameoptionalStringDiscoveryNameoptionalstringDiscoveryNameoptional*string #
Optionally specifies an intermediate dns name to register in the CloudMap namespace.

Default: port mapping name

This is required if you wish to use the same port mapping name in more than one service.

dnsNameoptionalstringdns_nameoptionalstrdnsNameoptionalStringDnsNameoptionalstringDnsNameoptional*string #
The terse DNS alias to use for this port mapping in the service connect mesh.

Default: No alias is created. The service is reachable at portMappingName.namespace:port.

Service Connect-enabled clients will be able to reach this service at http://dnsName:port.

idleTimeoutoptionalDurationidle_timeoutoptionalDurationidleTimeoutoptionalDurationIdleTimeoutoptionalDurationIdleTimeoutoptionalDuration #
The amount of time in seconds a connection for Service Connect will stay active while idle.

Default: Duration.minutes(5) for HTTP/HTTP2/GRPC, Duration.hours(1) for TCP.

A value of 0 can be set to disable idleTimeout.

If idleTimeout is set to a time that is less than perRequestTimeout, the connection will close when the idleTimeout is reached and not the perRequestTimeout.

ingressPortOverrideoptionalnumberingress_port_overrideoptionalint | floatingressPortOverrideoptionalNumberIngressPortOverrideoptionaldoubleIngressPortOverrideoptional*float64 = none #
Optional.

The port on the Service Connect agent container to use for traffic ingress to this service.

perRequestTimeoutoptionalDurationper_request_timeoutoptionalDurationperRequestTimeoutoptionalDurationPerRequestTimeoutoptionalDurationPerRequestTimeoutoptionalDuration = Duration.seconds(15) #
The amount of time waiting for the upstream to respond with a complete response per request for Service Connect.
notes

A value of 0 can be set to disable perRequestTimeout. Can only be set when the appProtocol for the application container is HTTP/HTTP2/GRPC.

If idleTimeout is set to a time that is less than perRequestTimeout, the connection will close when the idleTimeout is reached and not the perRequestTimeout.

portoptionalnumberportoptionalint | floatportoptionalNumberPortoptionaldoublePortoptional*float64 #
The port for clients to use to communicate with this service via Service Connect.

Default: the container port specified by the port mapping in portMappingName.

portMappingNamestringport_mapping_namestrportMappingNameStringPortMappingNamestringPortMappingName*string required #
portMappingName specifies which port and protocol combination should be used for this service connect service.
A reference to an object that represents a Transport Layer Security (TLS) configuration.