Interface Ec2ServiceAttributes
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
Ec2ServiceAttributes.Jsii$Proxy
@Generated(value="jsii-pacmak/1.139.0 (build 26a6b54)",
date="2026-08-27T15:24:24.537Z")
@Stability(Stable)
public interface Ec2ServiceAttributes
extends software.amazon.jsii.JsiiSerializable
The properties to import from the service using the EC2 launch type.
Example:
Cluster cluster;
// Import service from EC2 service attributes
IBaseService ec2ServiceFromAttributes = Ec2Service.fromEc2ServiceAttributes(this, "Ec2ServiceFromAttributes", Ec2ServiceAttributes.builder()
.serviceArn("arn:aws:ecs:us-west-2:123456789012:service/my-http-service")
.cluster(cluster)
.build());
// Import service from EC2 service ARN
IEc2Service ec2ServiceFromArn = Ec2Service.fromEc2ServiceArn(this, "Ec2ServiceFromArn", "arn:aws:ecs:us-west-2:123456789012:service/my-http-service");
// Import service from Fargate service attributes
IBaseService fargateServiceFromAttributes = FargateService.fromFargateServiceAttributes(this, "FargateServiceFromAttributes", FargateServiceAttributes.builder()
.serviceArn("arn:aws:ecs:us-west-2:123456789012:service/my-http-service")
.cluster(cluster)
.build());
// Import service from Fargate service ARN
IFargateService fargateServiceFromArn = FargateService.fromFargateServiceArn(this, "FargateServiceFromArn", "arn:aws:ecs:us-west-2:123456789012:service/my-http-service");
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forEc2ServiceAttributesstatic final classAn implementation forEc2ServiceAttributes -
Method Summary
Modifier and TypeMethodDescriptionstatic Ec2ServiceAttributes.Builderbuilder()The cluster that hosts the service.default StringThe service ARN.default StringThe name of the service.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getCluster
The cluster that hosts the service. -
getServiceArn
The service ARN.Default: - either this, or `serviceName`, is required
-
getServiceName
The name of the service.Default: - either this, or `serviceArn`, is required
-
builder
- Returns:
- a
Ec2ServiceAttributes.BuilderofEc2ServiceAttributes
-