UNPKG

4.16 kBTypeScriptView Raw
1import * as appscaling from '@aws-cdk/aws-applicationautoscaling';
2import * as ec2 from '@aws-cdk/aws-ec2';
3import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2';
4import * as cloudmap from '@aws-cdk/aws-servicediscovery';
5import { Construct } from 'constructs';
6import { AssociateCloudMapServiceOptions, BaseService, BaseServiceOptions, CloudMapOptions, EcsTarget, IBaseService, IEcsLoadBalancerTarget, IService } from '../base/base-service';
7import { ScalableTaskCount } from '../base/scalable-task-count';
8import { LoadBalancerTargetOptions, TaskDefinition } from '../base/task-definition';
9import { ICluster } from '../cluster';
10/**
11 * The properties for defining a service using the External launch type.
12 */
13export interface ExternalServiceProps extends BaseServiceOptions {
14 /**
15 * The task definition to use for tasks in the service.
16 *
17 * [disable-awslint:ref-via-interface]
18 */
19 readonly taskDefinition: TaskDefinition;
20 /**
21 * The security groups to associate with the service. If you do not specify a security group, a new security group is created.
22 *
23 *
24 * @default - A new security group is created.
25 */
26 readonly securityGroups?: ec2.ISecurityGroup[];
27}
28/**
29 * The interface for a service using the External launch type on an ECS cluster.
30 */
31export interface IExternalService extends IService {
32}
33/**
34 * The properties to import from the service using the External launch type.
35 */
36export interface ExternalServiceAttributes {
37 /**
38 * The cluster that hosts the service.
39 */
40 readonly cluster: ICluster;
41 /**
42 * The service ARN.
43 *
44 * @default - either this, or {@link serviceName}, is required
45 */
46 readonly serviceArn?: string;
47 /**
48 * The name of the service.
49 *
50 * @default - either this, or {@link serviceArn}, is required
51 */
52 readonly serviceName?: string;
53}
54/**
55 * This creates a service using the External launch type on an ECS cluster.
56 *
57 * @resource AWS::ECS::Service
58 */
59export declare class ExternalService extends BaseService implements IExternalService {
60 /**
61 * Imports from the specified service ARN.
62 */
63 static fromExternalServiceArn(scope: Construct, id: string, externalServiceArn: string): IExternalService;
64 /**
65 * Imports from the specified service attributes.
66 */
67 static fromExternalServiceAttributes(scope: Construct, id: string, attrs: ExternalServiceAttributes): IBaseService;
68 /**
69 * Constructs a new instance of the ExternalService class.
70 */
71 constructor(scope: Construct, id: string, props: ExternalServiceProps);
72 /**
73 * Overriden method to throw error as `attachToApplicationTargetGroup` is not supported for external service
74 */
75 attachToApplicationTargetGroup(_targetGroup: elbv2.IApplicationTargetGroup): elbv2.LoadBalancerTargetProps;
76 /**
77 * Overriden method to throw error as `loadBalancerTarget` is not supported for external service
78 */
79 loadBalancerTarget(_options: LoadBalancerTargetOptions): IEcsLoadBalancerTarget;
80 /**
81 * Overriden method to throw error as `registerLoadBalancerTargets` is not supported for external service
82 */
83 registerLoadBalancerTargets(..._targets: EcsTarget[]): void;
84 /**
85 * Overriden method to throw error as `configureAwsVpcNetworkingWithSecurityGroups` is not supported for external service
86 */
87 protected configureAwsVpcNetworkingWithSecurityGroups(_vpc: ec2.IVpc, _assignPublicIp?: boolean, _vpcSubnets?: ec2.SubnetSelection, _securityGroups?: ec2.ISecurityGroup[]): void;
88 /**
89 * Overriden method to throw error as `autoScaleTaskCount` is not supported for external service
90 */
91 autoScaleTaskCount(_props: appscaling.EnableScalingProps): ScalableTaskCount;
92 /**
93 * Overriden method to throw error as `enableCloudMap` is not supported for external service
94 */
95 enableCloudMap(_options: CloudMapOptions): cloudmap.Service;
96 /**
97 * Overriden method to throw error as `associateCloudMapService` is not supported for external service
98 */
99 associateCloudMapService(_options: AssociateCloudMapServiceOptions): void;
100}