You can use Terraform's -target
option to target specific resources, modules, or collections of resources. In this tutorial, you will provision an S3 bucket with some objects in it, then apply changes incrementally with -target
.
For example:
terraform plan -target="random_pet.bucket_name"
terraform apply -target="random_pet.bucket_name"
terraform apply -target="aws_s3_object.objects[2]" -target="aws_s3_object.objects[3]"