Skip to content

Commit babd4a6

Browse files
committed
Allow using --no-cluster without --no-network when --launch-type=FARGATE is used
1 parent e883cdc commit babd4a6

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ If you don't want the template to include the ECS cluster, use the `--no-cluster
140140
```
141141

142142
> [!IMPORTANT]
143-
> Since the ECS cluster's default capacity provider may be configured to use existing networking resources such as VPC, subnetworks, and security groups, the `--no-cluster` option requires the `--no-network` option to be used as well.
143+
> Since the Fargate and EC2 launch types require ECS services to be configured differently, make sure to use the `--launch-type` option corresponding to your ECS cluster's default capacity provider launch type.
144+
145+
> [!IMPORTANT]
146+
> When the `--no-cluster` and `--launch-type=EC2` options are used together, the `--no-network` option is required.
144147
145148
See the script's help (`./template.py -h`) for more options.
146149

template.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353

5454
args = cli_parser.parse_args()
5555

56-
if args.no_cluster and not args.no_network:
57-
cli_parser.error("--no-cluster can be used only with --no-network")
56+
if args.no_cluster and args.launch_type == "EC2" and not args.no_network:
57+
cli_parser.error("--no-cluster combined with --launch-type EC2 requires --no-network")
5858

5959
template = Template()
6060
template.set_version("2010-09-09")

0 commit comments

Comments
 (0)