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?

1 Antwort
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
EXPERTE
Gokul
beantwortet vor 2 Jahren
  • 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

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen