- https://www.terraform.io/docs/commands/refresh.html
- https://www.terraform.io/docs/providers/aws/d/iam_policy_document.html
- terraform state show
brew uninstall --force terraform
brew cleanup -s terraform
-
brew install warrensbox/tap/tfswitch tfswitch 0.11.14
-
brew install tfenv tfenv install 0.11.14
-
terraform destroy stuck on refreshing state hashicorp/terraform#23564
TF_LOG=DEBUG RKE_LOG=1 terraform <plan/destroy>
terraform force-unlock <LOCK_ID>
resource "aws_iam_policy" "allow_kms_decrypt_letsEncryptKey" {
name = "tf-policy-${var.instance_name}_access_kms_letsEncryptKey"
path = "/"
description = "Give certificate manager access to letsEncryptKey via KMS"
policy = "${data.template_file.allow_kms_decrypt_letsEncryptKey.rendered}"
}
resource "aws_iam_role_policy_attachment" "attach_kms_decrypt_letsEncryptKey_to_role" {
role = "${aws_iam_role.certificate_manager_role.name}"
policy_arn = "${aws_iam_policy.allow_kms_decrypt_letsEncryptKey.arn}"
}
data "template_file" "allow_route53_ListResourceRecordSets" {
template = "${file("../common-modules/aws/policy/route53/ListResourceRecordSets.json.tpl")}"
vars = {
resource = "arn:aws:kms:us-east-1:494770124270:key/400e47b4-8562-4015-a14d-857dc3f388e6"
}
}