{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/17727","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/17727/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/17727/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/17727/events","html_url":"https://github.com/hashicorp/terraform/issues/17727","id":309743769,"number":17727,"title":"element: argument 1 should be type list, got type string","user":{"login":"anderssoder","id":13778416,"avatar_url":"https://avatars1.githubusercontent.com/u/13778416?v=4","gravatar_id":"","url":"https://api.github.com/users/anderssoder","html_url":"https://github.com/anderssoder","followers_url":"https://api.github.com/users/anderssoder/followers","following_url":"https://api.github.com/users/anderssoder/following{/other_user}","gists_url":"https://api.github.com/users/anderssoder/gists{/gist_id}","starred_url":"https://api.github.com/users/anderssoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anderssoder/subscriptions","organizations_url":"https://api.github.com/users/anderssoder/orgs","repos_url":"https://api.github.com/users/anderssoder/repos","events_url":"https://api.github.com/users/anderssoder/events{/privacy}","received_events_url":"https://api.github.com/users/anderssoder/received_events","type":"User","site_admin":false},"labels":[{"id":85946957,"url":"https://api.github.com/repos/hashicorp/terraform/labels/bug","name":"bug","color":"f7c6c7","default":true},{"id":608979767,"url":"https://api.github.com/repos/hashicorp/terraform/labels/config","name":"config","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-03-29T12:56:31Z","updated_at":"2018-04-09T07:41:11Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nHi there,\r\n\r\nThank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.\r\n\r\nIf your issue relates to a specific Terraform provider, please open it in the provider's own repository. The index of providers is at https://github.com/terraform-providers .\r\n-->\r\n\r\n### Terraform Version\r\n<!---\r\nRun `terraform -v` to show the version, and paste the result between the ``` marks below.\r\n\r\nIf you are not running the latest version of Terraform, please try upgrading because your issue may have already been fixed.\r\n-->\r\n\r\n```\r\n0.11.3\r\n```\r\n\r\n### Terraform Configuration Files\r\n<!--\r\nPaste the relevant parts of your Terraform configuration between the ``` marks below.\r\n\r\nFor large Terraform configs, please use a service like Dropbox and share a link to the ZIP file. For security, you can also encrypt the files using our GPG public key.\r\n-->\r\n\r\nPart of resources in module:\r\n\r\n```hcl\r\nresource \"aws_acm_certificate\" \"cert\" {\r\n  domain_name = \"${var.aliases[0]}\"\r\n  subject_alternative_names = \"${compact(split(\",\", replace(join(\",\",var.aliases), var.aliases[0], \"\")))}\"\r\n  validation_method = \"DNS\"\r\n}\r\n\r\nresource \"aws_route53_record\" \"cert_validation\" {\r\n  count = \"${length(var.aliases)}\"\r\n  name = \"${element(aws_acm_certificate.cert.domain_validation_options.*.resource_record_name, count.index)}\"\r\n  type = \"CNAME\"\r\n  zone_id = \"${data.aws_route53_zone.zone.id}\"\r\n  records = [\"${element(aws_acm_certificate.cert.domain_validation_options.*.resource_record_value, count.index)}\"]\r\n  ttl = 60\r\n}\r\n\r\nresource \"aws_acm_certificate_validation\" \"cert\" {\r\n  certificate_arn = \"${aws_acm_certificate.cert.arn}\"\r\n  validation_record_fqdns = [\"${aws_route53_record.cert_validation.0.fqdn}\"]\r\n}\r\n```\r\n\r\n### Expected Behavior\r\n<!--\r\nWhat should have happened?\r\n-->\r\nExpect to the attributes from domain_validation_options list (which is an exported attribute of aws_acm_certificate resource). The goal is to be able to create Route53 records for each dns specified in var.aliases as a part of DNS validating the certificate. Getting this to work for just the main domain name is ok, I'm trying to get this to work with SAN certs but cannot find a way to correctly parse these parts to get a DNS validation record setup for each of them. Hopefully it's just a stupid mistake somewhere there but I'm blind to it! \r\n\r\n### Actual Behavior\r\n<!--\r\nWhat actually happened?\r\n-->\r\n\r\nError: Error refreshing state: 1 error(s) occurred:\r\n\r\n* module.cloudfront.module.acm_cert_test_b17g_stage_net.aws_route53_record.cert_validation: 2 error(s) occurred:\r\n\r\n* module.cloudfront.module.acm_cert_test_b17g_stage_net.aws_route53_record.cert_validation[1]: At column 3, line 1: element: argument 1 should be type list, got type string in:\r\n\r\n${element(aws_acm_certificate.cert.domain_validation_options.*.resource_record_name, count.index)}\r\n* module.cloudfront.module.acm_cert_test_b17g_stage_net.aws_route53_record.cert_validation[0]: At column 3, line 1: element: argument 1 should be type list, got type string in:\r\n\r\n${element(aws_acm_certificate.cert.domain_validation_options.*.resource_record_name, count.index)}\r\n\r\n\r\n### Steps to Reproduce\r\n<!--\r\nPlease list the full steps required to reproduce the issue, for example:\r\n1. `terraform init`\r\n2. `terraform apply`\r\n-->\r\n1. Try to create ACM cert with X number of SAN names specified using DNS validation.\r\n2. terraform init\r\n3. terraform plan \r\n\r\n### Additional Context\r\n<!--\r\nAre there anything atypical about your situation that we should know? For example: is Terraform running in a wrapper script or in a CI system? Are you passing any unusual command line options or environment variables to opt-in to non-default behavior?\r\n-->\r\n\r\n### References\r\n<!--\r\nAre there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:\r\n\r\n- #6017\r\n\r\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/379663127","html_url":"https://github.com/hashicorp/terraform/issues/17727#issuecomment-379663127","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/17727","id":379663127,"user":{"login":"anderssoder","id":13778416,"avatar_url":"https://avatars1.githubusercontent.com/u/13778416?v=4","gravatar_id":"","url":"https://api.github.com/users/anderssoder","html_url":"https://github.com/anderssoder","followers_url":"https://api.github.com/users/anderssoder/followers","following_url":"https://api.github.com/users/anderssoder/following{/other_user}","gists_url":"https://api.github.com/users/anderssoder/gists{/gist_id}","starred_url":"https://api.github.com/users/anderssoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anderssoder/subscriptions","organizations_url":"https://api.github.com/users/anderssoder/orgs","repos_url":"https://api.github.com/users/anderssoder/repos","events_url":"https://api.github.com/users/anderssoder/events{/privacy}","received_events_url":"https://api.github.com/users/anderssoder/received_events","type":"User","site_admin":false},"created_at":"2018-04-09T07:41:11Z","updated_at":"2018-04-09T07:41:11Z","author_association":"NONE","body":"@ebekker nice! Tried your setup and now works better, or at least I think it will. First run this morning, without the previous errors but the apply did not complete because I got a timeout on certificate_validation after 45 mins.\r\n\r\n\"* aws_acm_certificate_validation.cert: Expected certificate to be issued but was in state VALIDATION_TIMED_OUT\"\r\n\r\nI can see that the validation records have been correctly created in Route53 in correct zone. Will test a bit more to see if I can get it working. I do need to add support in the module to use different aws provider region, as my default provider is set to eu-central-1 but when using this module it needs to create the certificate in us-east-1 to be applicate for Cloudfront. Could of course be this that is making the certificate_validation not to work in my case."}}
{"actor":{"display_login":"anderssoder"}}