Skip to main content

COPY AMI FROM ONE REGION TO ANOTHER

 NOTE: AWS_AMI_COPY - COPY CODE 


write ami id and the region we are in . if we want to copy ami in california region . we need to change region in "provider " region= "us-west-1"


provider "aws" {
  region     = "us-west-1"
  access_key = "AKIAUGQ"
  secret_key = "Kurid"
}

resource "aws_ami_copy" "example" {
  name              = "terraform-example-COPY"
  description       = "COPY AMI"
  source_ami_id     = "ami-0e7540ad79b0d2157"
  source_ami_region = "us-east-1"

  tags = {
    Name = "HelloWorld"
  }
}

Comments