mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-05 01:19:09 +00:00
Compare commits
2 Commits
6edc828ece
...
7ce9ed564e
Author | SHA1 | Date | |
---|---|---|---|
|
7ce9ed564e | ||
|
8074276643 |
@ -13,6 +13,11 @@ resource "aws_instance" "instance" {
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_ec2_instance_state" "instance" {
|
||||
instance_id = aws_instance.instance.id
|
||||
state = "running"
|
||||
}
|
||||
|
||||
data "aws_vpc" "vpc" {
|
||||
default = true
|
||||
}
|
||||
|
@ -12,9 +12,12 @@
|
||||
|
||||
# Use existing image in S3
|
||||
data "aws_s3_object" "image" {
|
||||
bucket = var.images_bucket
|
||||
key = "arrow.vhd"
|
||||
checksum_mode = "ENABLED"
|
||||
bucket = var.images_bucket
|
||||
key = "arrow.vhd"
|
||||
}
|
||||
|
||||
resource "terraform_data" "image_replacement" {
|
||||
input = data.aws_s3_object.image.checksum_sha256
|
||||
}
|
||||
|
||||
# Setup IAM access for the VM Importer
|
||||
@ -72,7 +75,7 @@ resource "aws_ebs_snapshot_import" "image" {
|
||||
|
||||
role_name = aws_iam_role.vmimport.name
|
||||
lifecycle {
|
||||
replace_triggered_by = [data.aws_s3_object.image.checksum_sha256]
|
||||
replace_triggered_by = [terraform_data.image_replacement]
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user