{"action":"closed","issue":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/5694","repository_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/5694/labels{/name}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/5694/comments","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/5694/events","html_url":"https://github.com/terraform-providers/terraform-provider-aws/issues/5694","id":354444942,"node_id":"MDU6SXNzdWUzNTQ0NDQ5NDI=","number":5694,"title":"creating aws_instance - timeout i/o (no security group is attached when remote provisioner is run)","user":{"login":"oerp-odoo","id":7812986,"node_id":"MDQ6VXNlcjc4MTI5ODY=","avatar_url":"https://avatars0.githubusercontent.com/u/7812986?v=4","gravatar_id":"","url":"https://api.github.com/users/oerp-odoo","html_url":"https://github.com/oerp-odoo","followers_url":"https://api.github.com/users/oerp-odoo/followers","following_url":"https://api.github.com/users/oerp-odoo/following{/other_user}","gists_url":"https://api.github.com/users/oerp-odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/oerp-odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oerp-odoo/subscriptions","organizations_url":"https://api.github.com/users/oerp-odoo/orgs","repos_url":"https://api.github.com/users/oerp-odoo/repos","events_url":"https://api.github.com/users/oerp-odoo/events{/privacy}","received_events_url":"https://api.github.com/users/oerp-odoo/received_events","type":"User","site_admin":false},"labels":[{"id":620316244,"node_id":"MDU6TGFiZWw2MjAzMTYyNDQ=","url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/labels/question","name":"question","color":"cc317c","default":true},{"id":794043766,"node_id":"MDU6TGFiZWw3OTQwNDM3NjY=","url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/labels/service/ec2","name":"service/ec2","color":"bfd4f2","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-27T19:23:08Z","updated_at":"2018-08-28T21:36:37Z","closed_at":"2018-08-28T21:36:37Z","author_association":"NONE","body":"<!---\r\nPlease note the following potential times when an issue might be in Terraform core:\r\n\r\n* [Configuration Language](https://www.terraform.io/docs/configuration/index.html) or resource ordering issues\r\n* [State](https://www.terraform.io/docs/state/index.html) and [State Backend](https://www.terraform.io/docs/backends/index.html) issues\r\n* [Provisioner](https://www.terraform.io/docs/provisioners/index.html) issues\r\n* [Registry](https://registry.terraform.io/) issues\r\n* Spans resources across multiple providers\r\n\r\nIf you are running into one of these scenarios, we recommend opening an issue in the [Terraform core repository](https://github.com/hashicorp/terraform/) instead.\r\n--->\r\n\r\n<!--- Please keep this note for the community --->\r\n\r\n### Community Note\r\n\r\n* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request\r\n* Please do not leave \"+1\" or \"me too\" comments, they generate extra noise for issue followers and do not help prioritize the request\r\n* If you are interested in working on this issue or have submitted a pull request, please leave a comment\r\n\r\n<!--- Thank you for keeping this note for the community --->\r\n\r\n### Terraform Version\r\nTerraform v0.11.8\r\n+ provider.aws v1.33.0\r\n\r\n<!--- Please run `terraform -v` to show the Terraform core version and provider version(s). If you are not running the latest version of Terraform or the provider, please upgrade because your issue may have already been fixed. [Terraform documentation on provider versioning](https://www.terraform.io/docs/configuration/providers.html#provider-versions). --->\r\n\r\n### Affected Resource(s)\r\n\r\n<!--- Please list the affected resources and data sources. --->\r\n\r\n* aws_instance\r\n* aws_eip_association\r\n* aws_network_interface_sg_attachment\r\n\r\n### Terraform Configuration Files\r\n\r\n<!--- Information about code formatting: https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code --->\r\n\r\n```hcl\r\n# Provider data.\r\nprovider \"aws\" {\r\n  access_key = \"${var.access_key}\"\r\n  secret_key = \"${var.secret_key}\"\r\n  region     = \"${var.region}\"\r\n}\r\n\r\n# Resources for ec2 instance.\r\nresource \"aws_instance\" \"staging-ec2\" {\r\n  ami           = \"ami-1\"\r\n  instance_type = \"t2.micro\"\r\n\r\n  provisioner \"file\" {\r\n    source      = \"/path/to/update-odoo-cfg.py\"\r\n    destination = \"/tmp/update-odoo-cfg.py\"\r\n    connection {\r\n      type        = \"ssh\"\r\n      user        = \"ubuntu\"\r\n      private_key = \"${file(\"/path/to.pem\")}\"\r\n    }\r\n  }\r\n  provisioner \"remote-exec\" {\r\n\r\n    connection {\r\n      type        = \"ssh\"\r\n      user        = \"ubuntu\"\r\n      private_key = \"${file(\"/path/to.pem\")}\"\r\n    }\r\n\r\n    inline = [\r\n      \"python3 /tmp/update-odoo-cfg.py ${aws_db_instance.staging-rds.address} --cfg-path=/etc/odoo11.conf\",\r\n      \"sudo systemctl restart odoo11.service\"\r\n    ]\r\n  }\r\n\r\nresource \"aws_eip_association\" \"staging-eip-assoc\" {\r\n  instance_id   = \"${aws_instance.staging-ec2.id}\"\r\n  allocation_id = \"eipalloc-1\"\r\n}\r\n\r\n\r\nresource \"aws_network_interface_sg_attachment\" \"ec2-sg_attachment\" {\r\n  # Group for staging.\r\n  security_group_id    = \"sg-1\"\r\n  network_interface_id = \"${aws_instance.staging-ec2.primary_network_interface_id}\"\r\n}\r\n\r\n}\r\n# Resources for db instance.\r\ndata \"aws_db_snapshot\" \"latest_prod_snapshot\" {\r\n  db_instance_identifier = \"dbinstance-eu-central-1\"\r\n  most_recent = true\r\n}\r\n\r\n# Use the latest production snapshot to create a dev instance.\r\nresource \"aws_db_instance\" \"staging-rds\" {\r\n  instance_class         = \"db.t2.micro\"\r\n  storage_type           = \"gp2\"\r\n  identifier             = \"dbinstance-staging-eu-central-1\"\r\n  snapshot_identifier    = \"${data.aws_db_snapshot.latest_prod_snapshot.id}\"\r\n  vpc_security_group_ids = [\"sg-2\"]\r\n  lifecycle {\r\n    ignore_changes = [\"snapshot_identifier\"]\r\n  }\r\n}\r\n\r\n# Output variables.\r\noutput \"ip\" {\r\n  value = \"${aws_instance.staging-ec2.public_ip}\"\r\n}\r\noutput \"rds-endpoint\" {\r\n  value = \"${aws_db_instance.staging-rds.address}\"\r\n}\r\n```\r\n\r\n### Debug Output\r\n\r\n<!---\r\nPlease provide a link to a GitHub Gist containing the complete debug output. Please do NOT paste the debug output in the issue; just paste a link to the Gist.\r\n\r\nTo obtain the debug output, see the [Terraform documentation on debugging](https://www.terraform.io/docs/internals/debugging.html).\r\n--->\r\n\r\n### Panic Output\r\n\r\n<!--- If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the `crash.log`. --->\r\n\r\n### Expected Behavior\r\nShould create EC2 instance, associate EIP and associate security group.\r\n<!--- What should have happened? --->\r\n\r\n### Actual Behavior\r\n```\r\naws_instance.staging-ec2: Still creating... (4m30s elapsed)\r\naws_instance.staging-ec2: Still creating... (4m40s elapsed)\r\naws_instance.staging-ec2: Still creating... (4m50s elapsed)\r\naws_instance.staging-ec2: Still creating... (5m0s elapsed)\r\naws_instance.staging-ec2: Still creating... (5m10s elapsed)\r\naws_instance.staging-ec2: Still creating... (5m20s elapsed)\r\n\r\nError: Error applying plan:\r\n\r\n1 error(s) occurred:\r\n\r\n* aws_instance.staging-ec2: timeout - last error: dial tcp 52.29.93.120:22: i/o timeout\r\n```\r\n\r\n<!--- What actually happened? --->\r\n\r\n### Steps to Reproduce\r\n\r\n<!--- Please list the steps required to reproduce the issue. --->\r\n\r\n1. `terraform apply`\r\n\r\n### Important Factoids\r\n\r\n<!--- Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? --->\r\nIt seems there is already similar issue created last year (look at references).  **Is there a workaround at least then?**.. Cause I don't know now how to run `provisioner file` and `provisioner remote-exec` when terraform tries to apply those commands before actually setting security group and elastic IP.\r\n\r\n### References\r\n\r\n<!---\r\nInformation about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests\r\n\r\nAre there any other GitHub issues (open or closed) or pull requests that should be linked here? Vendor documentation? For example:\r\n--->\r\nLooks like this issue is similar to mine, though I do get a bit different error:\r\nhttps://github.com/terraform-providers/terraform-provider-aws/issues/1712\r\n\r\n* #0000\r\n"}}
{"actor":{"display_login":"bflad"}}