2016-11-10 6 views
0

Ich versuche mich an der Erstellung von AWS EC2-Instanzen mit Terraform.Fehler beim Speichern des Status: Öffnen Sie terraform.tfstate: Berechtigung verweigert

$ terraform apply

Ich habe die folgende Ausgabe nach dem obigen Befehl ausgeführt wird.

aws_instance.example: Creating... 
    ami:       "" => "ami-2d39803a" 
    associate_public_ip_address: "" => "<computed>" 
    availability_zone:   "" => "<computed>" 
    ebs_block_device.#:   "" => "<computed>" 
    ephemeral_block_device.#: "" => "<computed>" 
    instance_state:    "" => "<computed>" 
    instance_type:    "" => "t2.micro" 
    key_name:     "" => "<computed>" 
    network_interface_id:  "" => "<computed>" 
    placement_group:    "" => "<computed>" 
    private_dns:     "" => "<computed>" 
    private_ip:     "" => "<computed>" 
    public_dns:     "" => "<computed>" 
    public_ip:     "" => "<computed>" 
    root_block_device.#:   "" => "<computed>" 
    security_groups.#:   "" => "<computed>" 
    source_dest_check:   "" => "true" 
    subnet_id:     "" => "<computed>" 
    tenancy:      "" => "<computed>" 
    vpc_security_group_ids.#: "" => "<computed>" 
aws_instance.example: Still creating... (10s elapsed) 
aws_instance.example: Still creating... (20s elapsed) 
aws_instance.example: Still creating... (30s elapsed) 
aws_instance.example: Creation complete 
Failed to save state: open terraform.tfstate: permission denied 

Obwohl die EC2-Instanz wird erstellt, aber der Zustand meiner Infrastruktur wird nicht gespeichert, wie Sie in der letzten Zeile in der Konsolenausgabe beachten können.

Antwort

1

Nachdem ich verzweifelt versucht hatte, eine Lösung zu finden, habe ich zufällig die Zugriffsrechte des Verzeichnisses überprüft, in dem meine Terraform-Dateien abgelegt wurden.

Die Berechtigung des Home-Verzeichnisses wurde auf schreibgeschützt gesetzt. Ich habe entsprechende Änderungen vorgenommen und jetzt terraform apply funktioniert gut.

Verwandte Themen