You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into issue with terraform script erroring out during scan start with DigitalOcean VMs.
I entered API key in providers and filled rest like this:
I also tried filling in tag but error was the same.
Here is Ansible output log of the error:
fatal: [localhost]: FAILED! => {"changed": false, "cmd": "/usr/bin/terraform init -input=false -no-color -backend-config region=eu-central-1 -backend-config bucket=hodororbit -backend-config key=statefile/oa8z4qk9u4e77tm/terraform.tfstate -backend-config access_key=REDACTED -backend-config secret_key=REDACTED", "msg": "\nError: Terraform encountered problems during initialisation, including problems\nwith the configuration, described below.\n\nThe Terraform configuration must be valid before initialization so that\nTerraform can determine which modules and providers need to be installed.\n\n\nError: Invalid resource name\n\n on digitalocean_do.tf line 1, in resource \"digitalocean_tag\" \"\":\n 1: resource \"digitalocean_tag\" \"\" {\n\nA name must start with a letter or underscore and may contain only letters,\ndigits, underscores, and dashes.\n\nError: Invalid attribute name\n\n on digitalocean_do.tf line 20, in resource \"digitalocean_droplet\" \"vm\":\n 20: tags = [digitalocean_tag..id,]\n\nAn attribute name is required after a dot.", "rc": 1, "stderr": "\nError: Terraform encountered problems during initialisation, including problems\nwith the configuration, described below.\n\nThe Terraform configuration must be valid before initialization so that\nTerraform can determine which modules and providers need to be installed.\n\n\nError: Invalid resource name\n\n on digitalocean_do.tf line 1, in resource \"digitalocean_tag\" \"\":\n 1: resource \"digitalocean_tag\" \"\" {\n\nA name must start with a letter or underscore and may contain only letters,\ndigits, underscores, and dashes.\n\nError: Invalid attribute name\n\n on digitalocean_do.tf line 20, in resource \"digitalocean_droplet\" \"vm\":\n 20: tags = [digitalocean_tag..id,]\n\nAn attribute name is required after a dot.\n", "stderr_lines": ["", "Error: Terraform encountered problems during initialisation, including problems", "with the configuration, described below.", "", "The Terraform configuration must be valid before initialization so that", "Terraform can determine which modules and providers need to be installed.", "", "", "Error: Invalid resource name", "", " on digitalocean_do.tf line 1, in resource \"digitalocean_tag\" \"\":", " 1: resource \"digitalocean_tag\" \"\" {", "", "A name must start with a letter or underscore and may contain only letters,", "digits, underscores, and dashes.", "", "Error: Invalid attribute name", "", " on digitalocean_do.tf line 20, in resource \"digitalocean_droplet\" \"vm\":", " 20: tags = [digitalocean_tag..id,]", "", "An attribute name is required after a dot."], "stdout": "Initializing the backend...\n\nSuccessfully configured the backend \"s3\"! Terraform will automatically\nuse this backend unless the backend configuration changes.\n", "stdout_lines": ["Initializing the backend...", "", "Successfully configured the backend \"s3\"! Terraform will automatically", "use this backend unless the backend configuration changes."]}
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. It was a template issue in ansible and it is fixed. Fix below. In the next taged version this will not be a issue. But for now just add one tag and it will work.
{% if vm.tags and vm.tags.strip() %} {% for tag in vm.tags.split(',') %} resource "digitalocean_tag" "{{ tag | trim | lower | replace(' ', '_') }}" { name = "{{ tag | trim }}" } {% endfor %} {% endif %}
Hello,
I ran into issue with terraform script erroring out during scan start with DigitalOcean VMs.
I entered API key in providers and filled rest like this:
I also tried filling in tag but error was the same.
Here is Ansible output log of the error:
The text was updated successfully, but these errors were encountered: