如何通过 .NET AWS SDK 在 ECS 集群下创建 ECS 服务时分配 VPC ID?

0

【以下的问题经过翻译处理】 我创建了一个ECS TaskDefinition,现在正在创建一个ECS集群。在集群内,我想通过.NET AWSSDK 2.3.55.2类创建一个服务。但我无法在NetworkConfiguration或AwsVpcConfiguration类下设置vpcid。我们的代码在创建ECS服务时自动分配第一个vpcid。请问我该如何分配/设置我们需要的vpcid,而不是从vpc列表中选择第一个条目?由于这个问题,我的网站在容器上无法启动,因为容器/服务没有分配正确的vpcid。

1 Answer
0

【以下的回答经过翻译处理】 您可以在AWS SDK文档中所示的Amazon.ECS.Model.AwsVpcConfiguration对象中指定您VPC中的子网ID列表。https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/ECS/TAwsVpcConfiguration.html

profile picture
EXPERT
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions