Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Update ECS plugin to not assign public ip on ec2_cluster
Browse files Browse the repository at this point in the history
When using `ec2_cluster = true` there is an error `InvalidParameterException: Assign public IP is not supported for this launch type`. This wraps the `AssignPublicIp` network configuration so that on ec2_clusters this is not set to enabled.
  • Loading branch information
dlundgren committed Oct 29, 2020
1 parent 46f9b85 commit 0895c6b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion builtin/aws/ecs/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,9 @@ func (p *Platform) Launch(
SecurityGroups: []*string{sgecsport},
}

netCfg.AssignPublicIp = aws.String("ENABLED")
if p.config.EC2Cluster == false {
netCfg.AssignPublicIp = aws.String("ENABLED")
}

s.Status("Creating ECS Service (%s, cluster-name: %s)", serviceName, clusterName)
servOut, err := ecsSvc.CreateService(&ecs.CreateServiceInput{
Expand Down

0 comments on commit 0895c6b

Please sign in to comment.