Unable to create nitro enclaves using aws cli

0

I am trying to create an AWS nitro enclave as per the documentation

aws ec2 run-instances --image-id ami_id --count 1 --instancetype supported_instance_type --key-name your_key_pair --enclave-options 'Enabled=true'

The command throws the following error

aws ec2 run-instances --image-id ami-<id> --count 1 --instance-type c5.2xlarge --key-name dev_nitro.pem --region us-east-1 --enclave-options 'Enabled=true'

An error occurred (VPCIdNotSpecified) when calling the RunInstances operation: No default VPC for this user. GroupName is only supported for EC2-Classic and default VPC

What will be the solution for this? Cannot see any solutions to the AWS nitro documentation. How to solve this issue?

c02f2e
已提問 2 年前檢視次數 717 次
1 個回答
1

Hi - Please try specifying the subnet id while creating the instance.

EC2 Run-instances cli - https://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html

Launches the specified number of instances using an AMI for which you have permissions.

You can specify a number of options, or leave the default options. The following rules apply:

EC2-VPC = If you don't specify a subnet ID, we choose a default subnet from your default VPC for you. If you don't have a default VPC, you must specify a subnet ID in the request.

So try this instead:

aws ec2 run-instances --image-id ami-<id> --count 1 --instance-type c5.2xlarge --key-name dev_nitro.pem --region us-east-1 --enclave-options 'Enabled=true' --subnet-id <subnet-id>
AWS
專家
Gokul
已回答 2 年前
  • It throws this error after I assigned a subnet-it An error occurred (InvalidSubnetID.NotFound) when calling the RunInstances operation: The subnet ID 'vpc-<created-vpc-id>' does not exist

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南