114 lines
4.8 KiB
TypeScript
114 lines
4.8 KiB
TypeScript
import type { Construct } from 'constructs';
|
|
import type * as appscaling from '../../../aws-applicationautoscaling';
|
|
import type * as ec2 from '../../../aws-ec2';
|
|
import type * as elbv2 from '../../../aws-elasticloadbalancingv2';
|
|
import type * as cloudmap from '../../../aws-servicediscovery';
|
|
import type { AssociateCloudMapServiceOptions, BaseServiceOptions, CloudMapOptions, EcsTarget, IBaseService, IEcsLoadBalancerTarget, IService } from '../base/base-service';
|
|
import { BaseService } from '../base/base-service';
|
|
import type { ScalableTaskCount } from '../base/scalable-task-count';
|
|
import type { LoadBalancerTargetOptions, TaskDefinition } from '../base/task-definition';
|
|
import type { ICluster } from '../cluster';
|
|
/**
|
|
* The properties for defining a service using the External launch type.
|
|
*/
|
|
export interface ExternalServiceProps extends BaseServiceOptions {
|
|
/**
|
|
* The task definition to use for tasks in the service.
|
|
*
|
|
* [disable-awslint:ref-via-interface]
|
|
*/
|
|
readonly taskDefinition: TaskDefinition;
|
|
/**
|
|
* The security groups to associate with the service. If you do not specify a security group, a new security group is created.
|
|
*
|
|
*
|
|
* @default - A new security group is created.
|
|
*/
|
|
readonly securityGroups?: ec2.ISecurityGroup[];
|
|
/**
|
|
* By default, service use REPLICA scheduling strategy, this parameter enable DAEMON scheduling strategy.
|
|
* If true, the service scheduler deploys exactly one task on each container instance in your cluster.
|
|
*
|
|
* When you are using this strategy, do not specify a desired number of tasks or any task placement strategies.
|
|
* Tasks using the Fargate launch type or the CODE_DEPLOY or EXTERNAL deployment controller types don't support the DAEMON scheduling strategy.
|
|
*
|
|
* @default false
|
|
*/
|
|
readonly daemon?: boolean;
|
|
}
|
|
/**
|
|
* The interface for a service using the External launch type on an ECS cluster.
|
|
*/
|
|
export interface IExternalService extends IService {
|
|
}
|
|
/**
|
|
* The properties to import from the service using the External launch type.
|
|
*/
|
|
export interface ExternalServiceAttributes {
|
|
/**
|
|
* The cluster that hosts the service.
|
|
*/
|
|
readonly cluster: ICluster;
|
|
/**
|
|
* The service ARN.
|
|
*
|
|
* @default - either this, or `serviceName`, is required
|
|
*/
|
|
readonly serviceArn?: string;
|
|
/**
|
|
* The name of the service.
|
|
*
|
|
* @default - either this, or `serviceArn`, is required
|
|
*/
|
|
readonly serviceName?: string;
|
|
}
|
|
/**
|
|
* This creates a service using the External launch type on an ECS cluster.
|
|
*
|
|
* @resource AWS::ECS::Service
|
|
*/
|
|
export declare class ExternalService extends BaseService implements IExternalService {
|
|
/** Uniquely identifies this class. */
|
|
static readonly PROPERTY_INJECTION_ID: string;
|
|
/**
|
|
* Imports from the specified service ARN.
|
|
*/
|
|
static fromExternalServiceArn(scope: Construct, id: string, externalServiceArn: string): IExternalService;
|
|
/**
|
|
* Imports from the specified service attributes.
|
|
*/
|
|
static fromExternalServiceAttributes(scope: Construct, id: string, attrs: ExternalServiceAttributes): IBaseService;
|
|
/**
|
|
* Constructs a new instance of the ExternalService class.
|
|
*/
|
|
constructor(scope: Construct, id: string, props: ExternalServiceProps);
|
|
/**
|
|
* Overridden method to throw error as `attachToApplicationTargetGroup` is not supported for external service
|
|
*/
|
|
attachToApplicationTargetGroup(_targetGroup: elbv2.IApplicationTargetGroup): elbv2.LoadBalancerTargetProps;
|
|
/**
|
|
* Overridden method to throw error as `loadBalancerTarget` is not supported for external service
|
|
*/
|
|
loadBalancerTarget(_options: LoadBalancerTargetOptions): IEcsLoadBalancerTarget;
|
|
/**
|
|
* Overridden method to throw error as `registerLoadBalancerTargets` is not supported for external service
|
|
*/
|
|
registerLoadBalancerTargets(..._targets: EcsTarget[]): void;
|
|
/**
|
|
* Overridden method to throw error as `configureAwsVpcNetworkingWithSecurityGroups` is not supported for external service
|
|
*/
|
|
protected configureAwsVpcNetworkingWithSecurityGroups(_vpc: ec2.IVpc, _assignPublicIp?: boolean, _vpcSubnets?: ec2.SubnetSelection, _securityGroups?: ec2.ISecurityGroup[]): void;
|
|
/**
|
|
* Overridden method to throw error as `autoScaleTaskCount` is not supported for external service
|
|
*/
|
|
autoScaleTaskCount(_props: appscaling.EnableScalingProps): ScalableTaskCount;
|
|
/**
|
|
* Overridden method to throw error as `enableCloudMap` is not supported for external service
|
|
*/
|
|
enableCloudMap(_options: CloudMapOptions): cloudmap.Service;
|
|
/**
|
|
* Overridden method to throw error as `associateCloudMapService` is not supported for external service
|
|
*/
|
|
associateCloudMapService(_options: AssociateCloudMapServiceOptions): void;
|
|
}
|