-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Description
The tagging in your current fargate-v2
component works like next:
- first appearance:
Name: help-site
(fromfargate-v2
, assigned toAWS::ECS::Service
) - second appearance:
{Fn::Sub: "Name", Fn::Sub: "help-site"}
(fromecs-task
, assigned toAWS::ECS::TaskDefinition
, but there is already defined{ Key: "Name", Value: external_parameters[:component_name] }
)
All these lead to failure (duplicated tags):
Task:
Type: AWS::ECS::TaskDefinition
Properties:
...
Tags:
- Key: Name
Value: helpsiteTask
- Key: Environment
Value:
Ref: EnvironmentName
- Key: EnvironmentType
Value:
Ref: EnvironmentType
- Key:
Fn::Sub: Name
Value:
Fn::Sub: help-site
EcsFargateService:
Type: AWS::ECS::Service
Properties:
LaunchType: FARGATE
Tags:
- Key: Environment
Value:
Ref: EnvironmentName
- Key: EnvironmentType
Value:
Ref: EnvironmentType
- Key:
Fn::Sub: Name
Value:
Fn::Sub: help-site
We can remove the tag to avoid tag duplication in AWS::ECS::TaskDefinition
, but in this case the AWS::ECS::Service
loses the Name
tag:
EcsFargateService:
Type: AWS::ECS::Service
Properties:
LaunchType: FARGATE
Tags:
- Key: Environment
Value:
Ref: EnvironmentName
- Key: EnvironmentType
Value:
Ref: EnvironmentType
And we cannot use the @aws-sdk/client-resource-groups-tagging-api
to find out the needed ECS task by tag Name
in this case (when no needs on targetGroup
).
Metadata
Metadata
Assignees
Labels
No labels