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.
ReadonlynodeThe tree node.
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.
ProtecteddeploymentThe environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
A 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.
A 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.
ProtectednetworkProtectedphysicalReturns 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 CloudFormationA reference to this service.
ProtectedserviceThe details of the service discovery registries to assign to this service. For more information, see Service Discovery.
The details of the service discovery registries to assign to this service. For more information, see Service Discovery.
The stack in which this resource is defined.
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.
Override the cross-stack reference strength for this resource.
When set, any cross-stack reference to this resource will use the specified
mechanism instead of the global default determined by the
@aws-cdk/core:defaultCrossStackReferences context key. This is useful for
selectively weakening specific references to avoid the "deadly embrace" problem
without changing the app-wide default.
The reference strength to use for this resource.
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: ServiceConnectPropsForces a new deployment of the service.
This can be used to trigger a deployment without changing the task definition or desired count. ECS will start a new deployment even if there are no changes to the service configuration.
Important: When called without a nonce, a timestamp is generated automatically, which means
every cdk synth produces a different template and every cdk deploy triggers a new deployment
regardless of whether any code has changed. To avoid this, provide a stable nonce value that only
changes when you intentionally want to force a redeployment (e.g., an image digest or a version string).
Optionalnonce: stringA unique string (1-255 characters) that signals ECS to start a new deployment. If not provided, a timestamp-based nonce is generated.
ProtectedgenerateProtectedgetReturns 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.
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
The mixins to apply
This construct for chaining
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.