{"action":"created","issue":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-consul/issues/60","repository_url":"https://api.github.com/repos/terraform-providers/terraform-provider-consul","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-consul/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-consul/issues/60/comments","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-consul/issues/60/events","html_url":"https://github.com/terraform-providers/terraform-provider-consul/pull/60","id":354845927,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExNTEyMjcz","number":60,"title":"Add resources for ACLs & tokens management (new ACLs v1.4)","user":{"login":"bhuisgen","id":159157,"node_id":"MDQ6VXNlcjE1OTE1Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/159157?v=4","gravatar_id":"","url":"https://api.github.com/users/bhuisgen","html_url":"https://github.com/bhuisgen","followers_url":"https://api.github.com/users/bhuisgen/followers","following_url":"https://api.github.com/users/bhuisgen/following{/other_user}","gists_url":"https://api.github.com/users/bhuisgen/gists{/gist_id}","starred_url":"https://api.github.com/users/bhuisgen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhuisgen/subscriptions","organizations_url":"https://api.github.com/users/bhuisgen/orgs","repos_url":"https://api.github.com/users/bhuisgen/repos","events_url":"https://api.github.com/users/bhuisgen/events{/privacy}","received_events_url":"https://api.github.com/users/bhuisgen/received_events","type":"User","site_admin":false},"labels":[{"id":625730276,"node_id":"MDU6TGFiZWw2MjU3MzAyNzY=","url":"https://api.github.com/repos/terraform-providers/terraform-provider-consul/labels/dependencies","name":"dependencies","color":"fad8c7","default":false},{"id":620326934,"node_id":"MDU6TGFiZWw2MjAzMjY5MzQ=","url":"https://api.github.com/repos/terraform-providers/terraform-provider-consul/labels/documentation","name":"documentation","color":"fef2c0","default":false},{"id":737832484,"node_id":"MDU6TGFiZWw3Mzc4MzI0ODQ=","url":"https://api.github.com/repos/terraform-providers/terraform-provider-consul/labels/size/XL","name":"size/XL","color":"ffffff","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":24,"created_at":"2018-08-28T18:16:23Z","updated_at":"2019-04-07T01:44:42Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-consul/pulls/60","html_url":"https://github.com/terraform-providers/terraform-provider-consul/pull/60","diff_url":"https://github.com/terraform-providers/terraform-provider-consul/pull/60.diff","patch_url":"https://github.com/terraform-providers/terraform-provider-consul/pull/60.patch"},"body":"This PR adds the support of these resources:\r\n- `consul_acl_policy` to create new ACL policies\r\n- `consul_acl_token` to create new ACL tokens (management, client and agent tokens)\r\n- `consul_acl_master_token` to setup and bootstrap a cluster only with terraform\r\n\r\nTo test the ACL policy + token creation with this PR:\r\n\r\n````\r\nresource \"consul_acl_policy\" \"test\" {\r\n\tname = \"test\"\r\n\trules = \"node_prefix \\\"\\\" { policy = \\\"read\\\" }\"\r\n\tdatacenters = [ \"dc1\" ]\r\n}\r\n\r\nresource \"consul_acl_token\" \"test\" {\r\n\tdescription = \"test\"\r\n\tpolicies = [\"${consul_acl_policy.test.name}\"]\r\n\tlocal = true\r\n}\r\n````\r\n\r\nMy goal is to completely create and configure a consul cluster with this resources. Here is the plan to do it (without HTTPS & docker stuff):\r\n\r\n````\r\nprovider \"consul\" {\r\n  alias          = \"bootstrap\"\r\n  address        = \"127.0.0.1:8500\"\r\n  scheme         = \"http\"\r\n  datacenter     = \"dc1\"\r\n}\r\n\r\nprovider \"consul\" {\r\n  alias          = \"setup\"\r\n  address        = \"127.0.0.1:8500\"\r\n  scheme         = \"http\"\r\n  datacenter     = \"dc1\"\r\n  token          = \"${consul_acl_master_token.master.token}\"\r\n}\r\n\r\nprovider \"consul\" {\r\n  address        = \"127.0.0.1:8500\"\r\n  scheme         = \"http\"\r\n  datacenter     = \"dc1\"\r\n  token          = \"${consul_acl_token.admin.token}\"\r\n}\r\n\r\nresource \"consul_acl_master_token\" \"master\" {\r\n  provider = \"consul.bootstrap\"\r\n}\r\n\r\nresource \"null_resource\" \"bootstrap\" {\r\n  depends_on = [\"consul_acl_master_token.master\"]\r\n\r\n  triggers {\r\n    consul_acl_master_token = \"${consul_acl_master_token.master.id}\"\r\n  }\r\n\r\n  provisioner \"local-exec\" {\r\n    command = \"sleep 30\"\r\n  }\r\n}\r\n\r\nresource \"consul_acl_policy\" \"admin\" {\r\n  depends_on = [\"null_resource.bootstrap\"]\r\n\r\n  provider = \"consul.setup\"\r\n\r\n  name = \"admin\"\r\n  rules = \"node_prefix \\\"\\\" { policy = \\\"write\\\" } key_prefix \\\"\\\" { policy = \\\"write\\\" } service_prefix \\\"\\\" { policy = \\\"write\\\" }\"\r\n}\r\n\r\n\r\nresource \"consul_acl_token\" \"admin\" {\r\n  provider = \"consul.setup\"\r\n\r\n  description = \"admin token\"\r\n  policies = [\"${consul_acl_policy.admin.name}\"]\r\n}\r\n\r\nresource \"consul_acl_policy\" \"agent\" {\r\n  depends_on = [\"consul_acl_token.admin\"]\r\n\r\n  provider = \"consul.setup\"\r\n\r\n  name = \"agent\"\r\n  rules = \"node_prefix \\\"\\\" { policy = \\\"write\\\" } service_prefix \\\"\\\" { policy = \\\"read\\\" }\"\r\n}\r\n\r\nresource \"consul_acl_token\" \"agent\" {\r\n  provider = \"consul.setup\"\r\n\r\n  policies = [\"${consul_acl_policy.agent.name}\"]\r\n}\r\n````\r\n"},"comment":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-consul/issues/comments/480551508","html_url":"https://github.com/terraform-providers/terraform-provider-consul/pull/60#issuecomment-480551508","issue_url":"https://api.github.com/repos/terraform-providers/terraform-provider-consul/issues/60","id":480551508,"node_id":"MDEyOklzc3VlQ29tbWVudDQ4MDU1MTUwOA==","user":{"login":"Nowaker","id":611746,"node_id":"MDQ6VXNlcjYxMTc0Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/611746?v=4","gravatar_id":"","url":"https://api.github.com/users/Nowaker","html_url":"https://github.com/Nowaker","followers_url":"https://api.github.com/users/Nowaker/followers","following_url":"https://api.github.com/users/Nowaker/following{/other_user}","gists_url":"https://api.github.com/users/Nowaker/gists{/gist_id}","starred_url":"https://api.github.com/users/Nowaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nowaker/subscriptions","organizations_url":"https://api.github.com/users/Nowaker/orgs","repos_url":"https://api.github.com/users/Nowaker/repos","events_url":"https://api.github.com/users/Nowaker/events{/privacy}","received_events_url":"https://api.github.com/users/Nowaker/received_events","type":"User","site_admin":false},"created_at":"2019-04-07T01:44:42Z","updated_at":"2019-04-07T01:44:42Z","author_association":"NONE","body":"@remilapeyre My use case is generating an individual secret ID for each user (or service accounts). Accessor IDs aren't useful in any way."}}
{"actor":{"display_login":"Nowaker"}}