I have an archive that contains some binary on S3 which I need to put on EC2 during the provisioning. On the moment, I am downloading the archive to the machine(host provisioned) and upload it to the machine which I need to provision.
Or how can I get a link from aws_s3_bucket_object? or is there a way to mount s3 object as file into ec2 instance with terraform?
data "aws_s3_bucket_object" "release" {
bucket = data.aws_s3_bucket.artifacts.id
key = "release.tgz"
}
resource "aws_instance" "engine" {
ami = data.aws_ami.server.id
instance_type = var.aws_instance_type
...
}