Hi, there.
I would like to set my custom security group to ECS tasks, so I add network configuration to manifest.yml as documented here.
name: rails
type: Load Balanced Web Service
...
network:
vpc:
security_groups: ['sg-09ce2df3852b84be9']
And deploy these commands.
$ copilot version
version: v1.7.0, built for darwin
$ copilot svc deploy -e dev -n rails
In AWS Management Console, sg-09ce2df3852b84be9 is not set to ECS tasks. Only the security group set with Copilot by default is configured for the ECS tasks.

It seemed that the security group set in manifest.yml was not set in the CloudFormation template as well.
$ copilot svc package -e dev -n rails
...
Service:
Metadata:
'aws:copilot:description': 'An ECS service to run and maintain your tasks in the environment cluster'
Type: AWS::ECS::Service
DependsOn: WaitUntilListenerRuleIsCreated
Properties:
Cluster:
Fn::ImportValue:
!Sub '${AppName}-${EnvName}-ClusterId'
TaskDefinition: !Ref TaskDefinition
DesiredCount: !Ref TaskCount
DeploymentConfiguration:
DeploymentCircuitBreaker:
Enable: true
Rollback: true
MinimumHealthyPercent: 100
MaximumPercent: 200
PropagateTags: SERVICE
EnableExecuteCommand: true
LaunchType: FARGATE
NetworkConfiguration:
AwsvpcConfiguration:
AssignPublicIp: ENABLED
Subnets:
- Fn::Select:
- 0
- Fn::Split:
- ','
- Fn::ImportValue: !Sub '${AppName}-${EnvName}-PublicSubnets'
- Fn::Select:
- 1
- Fn::Split:
- ','
- Fn::ImportValue: !Sub '${AppName}-${EnvName}-PublicSubnets'
SecurityGroups:
- Fn::ImportValue: !Sub '${AppName}-${EnvName}-EnvironmentSecurityGroup'
- Fn::GetAtt: [AddonsStack, Outputs.railsclusterSecurityGroup]
...
Any suggestion would be appreciated.
Thanks in advance!
Hi, there.
I would like to set my custom security group to ECS tasks, so I add network configuration to
manifest.ymlas documented here.And deploy these commands.
$ copilot version version: v1.7.0, built for darwin $ copilot svc deploy -e dev -n railsIn AWS Management Console,
sg-09ce2df3852b84be9is not set to ECS tasks. Only the security group set with Copilot by default is configured for the ECS tasks.It seemed that the security group set in
manifest.ymlwas not set in the CloudFormation template as well.$ copilot svc package -e dev -n rails ... Service: Metadata: 'aws:copilot:description': 'An ECS service to run and maintain your tasks in the environment cluster' Type: AWS::ECS::Service DependsOn: WaitUntilListenerRuleIsCreated Properties: Cluster: Fn::ImportValue: !Sub '${AppName}-${EnvName}-ClusterId' TaskDefinition: !Ref TaskDefinition DesiredCount: !Ref TaskCount DeploymentConfiguration: DeploymentCircuitBreaker: Enable: true Rollback: true MinimumHealthyPercent: 100 MaximumPercent: 200 PropagateTags: SERVICE EnableExecuteCommand: true LaunchType: FARGATE NetworkConfiguration: AwsvpcConfiguration: AssignPublicIp: ENABLED Subnets: - Fn::Select: - 0 - Fn::Split: - ',' - Fn::ImportValue: !Sub '${AppName}-${EnvName}-PublicSubnets' - Fn::Select: - 1 - Fn::Split: - ',' - Fn::ImportValue: !Sub '${AppName}-${EnvName}-PublicSubnets' SecurityGroups: - Fn::ImportValue: !Sub '${AppName}-${EnvName}-EnvironmentSecurityGroup' - Fn::GetAtt: [AddonsStack, Outputs.railsclusterSecurityGroup] ...Any suggestion would be appreciated.
Thanks in advance!