Open mchouque opened 6 years ago
Is there any way of doing this yet with Terraform in AWS?
same question here, is it possible now?
I would love to see a Terraform resource for this as well!
This is possible now through a combination of aws_ebs_snapshot_import
and aws_ami
.
This is possible now through a combination of
aws_ebs_snapshot_import
andaws_ami
.
This is not true for all cases. You need image import, not snapshot import for a number of use cases.
I started https://github.com/hashicorp/terraform-provider-aws/pull/25621 to try and support this.
This is possible now through a combination of
aws_ebs_snapshot_import
andaws_ami
.This is not true for all cases. You need image import, not snapshot import for a number of use cases.
I started #25621 to try and support this.
Hopefully they will accept your MR - out of curiosity what use case does the import handle that the snapshot import and custom ami creation step not handle?
When I imported a Windows VM disk, then created an AMI, a Linux AMI was created. aws_ami
doesn't allow platform specification.
Is this enhancement still actively being considered? Is there an ETA on when it could be implemented if so? I need to create an EC2 from an OVA appliance that was sent to us by the vendor and the preferred way of doing that would be with Terraform.
We have this exact use case - importing a number of images from S3 into our image builder pipeline.
Hello,
With EC2 on AWS, you can use AMIs provided by Amazon or you can "bring your own OS".
Namely you can (it's documented here Importing a VM as an Image Using VM Import/Export:)
When it's done, you have an AMI that was created with the disk image you provided: your own OS tailored to your needs.
In a nutshell, with google, the code to do that is as follow (don't mind the crappy variable names and code, I'm just starting using terraform):
Namely two resources: one to upload a file to a bucket, the other to "transform" it.
With Azure, it's very similar: 2 resources. One to upload the image, and one to convert it.
With Amazon, we have the first resource, it's "_aws_s3_bucketobject".
The only thing missing in terraform for AWS is the equivalent of the second resource, azurerm_image for Azure or google_compute_image for Google.
On EC2, the conversion is triggered by "aws ec2 import-image" and I believe the API call for that is ImportImage.
Let me know if you have any questions.
Regards, Mathieu