Protected Optional Internal_The service connect configuration for this service.
Protected OptionalcloudmapThe details of the AWS Cloud Map service.
ReadonlyclusterThe cluster that hosts the service.
ReadonlyconnectionsThe security groups which manage the allowed network traffic for the service.
Protected OptionaldeploymentThe deployment alarms property - this will be rendered directly and lazily as the CfnService.alarms property.
ReadonlyenvThe environment this resource belongs to. For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
ProtectedloadA list of Elastic Load Balancing load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer.
Protected OptionalnetworkA list of Elastic Load Balancing load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer.
ReadonlynodeThe tree node.
Protected ReadonlyphysicalReturns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
This value will resolve to one of the following:
"my-awesome-bucket")undefined, when a name should be generated by CloudFormationReadonlyserviceThe Amazon Resource Name (ARN) of the service.
ReadonlyserviceThe name of the service.
ProtectedserviceThe details of the service discovery registries to assign to this service. For more information, see Service Discovery.
ReadonlystackThe stack in which this resource is defined.
ReadonlytaskThe task definition to use for tasks in the service.
Static ReadonlyPROPERTY_Uniquely identifies this class.
The CloudMap service created for this service, if any.
InternalCalled when this resource is referenced across environments (account/region) to order to request that a physical name will be generated for this resource during synthesis, so the resource can be referenced through its absolute name/arn.
Add a deployment lifecycle hook target
The lifecycle hook target to add
Adds a volume to the Service.
Apply the given removal policy to this resource
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
Associates this service with a CloudMap service
This method is called to attach this service to an Application Load Balancer.
Don't call this function directly. Instead, call listener.addTargets()
to add this service to a load balancer.
Registers the service as a target of a Classic Load Balancer (CLB).
Don't call this. Call loadBalancer.addTarget() instead.
This method is called to attach this service to a Network Load Balancer.
Don't call this function directly. Instead, call listener.addTargets()
to add this service to a load balancer.
An attribute representing the minimum and maximum task count for an AutoScalingGroup.
ProtectedconfigureThis method is called to create a networkConfiguration.
OptionalassignPublicIp: booleanOptionalvpcSubnets: SubnetSelectionOptionalsecurityGroups: ISecurityGroup[]Enable CloudMap service discovery for the service
The created CloudMap service
Enable Deployment Alarms which take advantage of arbitrary alarms and configure them after service initialization. If you have already enabled deployment alarms, this function can be used to tell ECS about additional alarms that should interrupt a deployment.
New alarms specified in subsequent calls of this function will be appended to the existing list of alarms.
The same Alarm Behavior must be used on all deployment alarms. If you specify different AlarmBehavior values in multiple calls to this function, or the Alarm Behavior used here doesn't match the one used in the service constructor, an error will be thrown.
If the alarm's metric references the service, you cannot pass Alarm.alarmName here. That will cause a circular
dependency between the service and its deployment alarm. See this package's README for options to alarm on service
metrics, and avoid this circular dependency.
Optionaloptions: DeploymentAlarmOptionsEnable Service Connect on this service.
Optionalconfig: ServiceConnectPropsProtectedgenerateProtectedgetReturns an environment-sensitive token that should be used for the
resource's "ARN" attribute (e.g. bucket.bucketArn).
Normally, this token will resolve to arnAttr, but if the resource is
referenced across environments, arnComponents will be used to synthesize
a concrete ARN with the resource's physical name. Make sure to reference
this.physicalName in arnComponents.
The CFN attribute which resolves to the ARN of the resource.
Commonly it will be called "Arn" (e.g. resource.attrArn), but sometimes
it's the CFN resource's ref.
The format of the ARN of this resource. You must
reference this.physicalName somewhere within the ARN in order for
cross-environment references to work.
ProtectedgetReturns an environment-sensitive token that should be used for the
resource's "name" attribute (e.g. bucket.bucketName).
Normally, this token will resolve to nameAttr, but if the resource is
referenced across environments, it will be resolved to this.physicalName,
which will be a concrete name.
The CFN attribute which resolves to the resource's name.
Commonly this is the resource's ref.
Checks if the service is using the ECS deployment controller.
true if the service is using the ECS deployment controller or if no deployment controller is specified (defaults to ECS)
Return a load balancing target for a specific container and port.
Use this function to create a load balancer target if you want to load balance to another container than the first essential container or the first mapped port on the container.
Use the return value of this function where you would normally use a load balancer
target, instead of the Service object itself.
This method returns the specified CloudWatch metric name for this service.
Optionalprops: MetricOptionsUse this function to create all load balancer targets to be registered in this service, add them to target groups, and attach target groups to listeners accordingly.
Alternatively, you can use listener.addTargets() to create targets and add them to target groups.
declare const listener: elbv2.ApplicationListener;
declare const service: ecs.BaseService;
service.registerLoadBalancerTargets(
{
containerName: 'web',
containerPort: 80,
newTargetGroupId: 'ECS',
listener: ecs.ListenerConfig.applicationListener(listener, {
protocol: elbv2.ApplicationProtocol.HTTPS
}),
},
)
Returns a string representation of this construct.
StaticfromImports from the specified service ARN.
StaticfromStaticfromImport an existing ECS/Fargate Service using the service cluster format. The format is the "new" format "arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name".
StaticisChecks if x is a construct.
Use this method instead of instanceof to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct in each copy of the constructs library
is seen as a different class, and an instance of one class will not test as
instanceof the other class. npm install will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof will behave
unpredictably. It is safest to avoid using instanceof, and using
this type-testing method instead.
Any object
true if x is an object created from a class which extends Construct.
StaticisReturns true if the construct was created by CDK, and false otherwise
StaticisCheck whether the given construct is a Resource
A construct for creating a compliant ECS fargateservice resource.