https://pulumi.com logo
Title
q

quick-plumber-17782

10/18/2022, 8:25 AM
Hi , I am new to pulumi and wanted to create an aws AMI From Instance using this code:
const backup = new aws.ec2.AmiFromInstance(`try-AMI`,{
  sourceInstanceId : 'i-0000000000',
  description:`AMI from instance`, 
  snapshotWithoutReboot:1
 
})
 
// Export the name of the bucket
exports.backupName = backup.name;
exports.backupId = backup.id;
 
exports.backupArn = backup.arn;
I got this error :
error: update failed

 aws:ec2:AmiFromInstance (try-AMI -1892022115):
   error: 1 error occurred:
       * error creating EC2 AMI try-AMI -1892022115-a6bdcdd) from EC2 Instance ('i-0000000000'): InvalidInstanceID.NotFound: The instance ID 'i-0000000000'' does not exist
       status code: 400, request id: c8ef283f-2cec-4e95-8439-d03cd3369c9b
in the aws managment console, I see the instance (running) , can anybody help me please ? thank you.
m

microscopic-barista-15731

10/18/2022, 10:15 AM
Probably the first thing I would check is if I can see instances with AWS CLI
aws ec2 describe-instances
As it could be, your default region is different and that’s why you are not able to see instances. You can try to set the region in pulumi. https://www.pulumi.com/docs/intro/concepts/config/
q

quick-plumber-17782

10/22/2022, 7:29 PM
That was the issue, Thank you.