{"action":"created","issue":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/1662","repository_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/1662/labels{/name}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/1662/comments","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/1662/events","html_url":"https://github.com/terraform-providers/terraform-provider-azurerm/issues/1662","id":345012125,"node_id":"MDU6SXNzdWUzNDUwMTIxMjU=","number":1662,"title":"Allow Container ~Group~ Ports to be specifically specified rather than aggregating the container ports","user":{"login":"granadacoder","id":5487824,"node_id":"MDQ6VXNlcjU0ODc4MjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/5487824?v=4","gravatar_id":"","url":"https://api.github.com/users/granadacoder","html_url":"https://github.com/granadacoder","followers_url":"https://api.github.com/users/granadacoder/followers","following_url":"https://api.github.com/users/granadacoder/following{/other_user}","gists_url":"https://api.github.com/users/granadacoder/gists{/gist_id}","starred_url":"https://api.github.com/users/granadacoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/granadacoder/subscriptions","organizations_url":"https://api.github.com/users/granadacoder/orgs","repos_url":"https://api.github.com/users/granadacoder/repos","events_url":"https://api.github.com/users/granadacoder/events{/privacy}","received_events_url":"https://api.github.com/users/granadacoder/received_events","type":"User","site_admin":false},"labels":[{"id":620326282,"node_id":"MDU6TGFiZWw2MjAzMjYyODI=","url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/labels/enhancement","name":"enhancement","color":"e6e600","default":true},{"id":832553472,"node_id":"MDU6TGFiZWw4MzI1NTM0NzI=","url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/labels/service/container-instance","name":"service/container-instance","color":"5da308","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-26T21:28:41Z","updated_at":"2018-08-09T09:03:23Z","closed_at":null,"author_association":"NONE","body":"<!--- Please keep this note for the community --->\r\n\r\n\r\nThis feature request is about the public ports on the container_GROUP.\r\n\r\nLooking at the source code here:\r\n\r\nhttps://github.com/terraform-providers/terraform-provider-azurerm/blob/master/azurerm/resource_arm_container_group.go\r\n\r\nIt looks like \r\n\r\n`containerGroupPorts = append(containerGroupPorts, containerGroupPort)`\r\n\r\n`containerGroupPorts` ( I think ) is a variable to concatenate the ports of the individual containers.\r\n\r\n\r\nIn the ARM template version, the container group (public) ports can be specified ~at the container group level.\r\n```\r\n\r\n  \"resources\": [\r\n    {\r\n      \"name\": \"[parameters('resourceGroupName')]\",\r\n      \"type\": \"Microsoft.ContainerInstance/containerGroups\",\r\n      \"apiVersion\": \"2018-06-01\",\r\n      \"location\": \"[resourceGroup().location]\",\r\n      \"properties\": {\r\n        \"containers\": [        \r\n\t\t\r\n\t\t\"osType\": \"Linux\",\r\n        \"ipAddress\": {\r\n          \"type\": \"Public\",\r\n          \"ports\": [\r\n            {\r\n              \"protocol\": \"TCP\",\r\n              \"port\": 443\r\n            },\r\n            {\r\n              \"protocol\": \"TCP\",\r\n              \"port\": 80\r\n            }\r\n          ],\r\n          \"dnsNameLabel\": \"[uniqueString( resourceGroup().id )]\"\r\n        }\r\n\r\n```\r\n\r\nSo the idea (for security) is (of course) that your containers can talk to each other (on say, 20 ports for example), but you are only going to exposed a handful of ports publicly.\r\n\r\nMini example.  webserver (container) is open to the world on 80/443.  middleTier/webapi server is privately open some port.  and some logging/service is privately available on some port.  Aka, you don't want middleTier/webapi server or logging/service ports open to the world.\r\n\r\nI know microsoft is paying attention to the container group ports, because the arm template is smart enough to know if you're trying to open a port on the container that is not in the container group.\r\n\r\n```\r\n[Deployment failed. Correlation ID: abc65f84-267f-abc3-8a7a-6fce6659e607. {\r\n  \"error\": {\r\n    \"code\": \"UnreferencedIpAddressPorts\",\r\n    \"message\": \"Following ports '443' in the 'ipAddress' are not used by any container in container group 'myContainerGroup'.\"\r\n  }\r\n}]\r\n```\r\n\r\nAnyway.  Having a container_group parameters for ports that matches the ARM would be fantastic.\r\n\r\n\r\nSidenote, I'm basically trying to pull off (in terraform) what this article mentions.\r\n\r\nThis port will be accessible within the entire container group, but not from the outside world and not from other container groups either. Containers within a group can communicate with each other by using ‘localhost’ and the exposed container port.\r\n\r\n[Article here](https://xpirit.com/2017/11/12/containers-as-a-service-in-azure/)\r\n\r\n[GitHub code here](https://github.com/loekd/AzureContainerInstancesLinux)\r\n\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### Description\r\n\r\n<!--- Please leave a helpful description of the feature request here. --->\r\n\r\n### New or Affected Resource(s)\r\n\r\n<!--- Please list the new or affected resources and data sources. --->\r\n\r\n* azurerm_container_group\r\n\r\n### Potential Terraform Configuration\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# Copy-paste your Terraform configurations here - for large Terraform configs,\r\n# please use a service like Dropbox and share a link to the ZIP file. For\r\n# security, you can also encrypt the files using our GPG public key.\r\n```\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 blog posts or documentation? For example:\r\n\r\n* https://azure.microsoft.com/en-us/roadmap/virtual-network-service-endpoint-for-azure-cosmos-db/\r\n--->\r\n\r\n* #0000\r\n"},"comment":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/comments/411689414","html_url":"https://github.com/terraform-providers/terraform-provider-azurerm/issues/1662#issuecomment-411689414","issue_url":"https://api.github.com/repos/terraform-providers/terraform-provider-azurerm/issues/1662","id":411689414,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTY4OTQxNA==","user":{"login":"tombuildsstuff","id":666005,"node_id":"MDQ6VXNlcjY2NjAwNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/666005?v=4","gravatar_id":"","url":"https://api.github.com/users/tombuildsstuff","html_url":"https://github.com/tombuildsstuff","followers_url":"https://api.github.com/users/tombuildsstuff/followers","following_url":"https://api.github.com/users/tombuildsstuff/following{/other_user}","gists_url":"https://api.github.com/users/tombuildsstuff/gists{/gist_id}","starred_url":"https://api.github.com/users/tombuildsstuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tombuildsstuff/subscriptions","organizations_url":"https://api.github.com/users/tombuildsstuff/orgs","repos_url":"https://api.github.com/users/tombuildsstuff/repos","events_url":"https://api.github.com/users/tombuildsstuff/events{/privacy}","received_events_url":"https://api.github.com/users/tombuildsstuff/received_events","type":"User","site_admin":false},"created_at":"2018-08-09T09:03:23Z","updated_at":"2018-08-09T09:03:23Z","author_association":"CONTRIBUTOR","body":"hey @joakimhellum-in \r\n\r\nSorry for the delayed reply here.\r\n\r\n> @tombuildsstuff would you accept community PR with attempt to implement this? It looks like multiple issues need to be solved in azurerm_container_group resource and this may be a good place to start. Thanks for any advice.\r\n\r\nYes definitely - [this commit](\r\nhttps://github.com/terraform-providers/terraform-provider-azurerm/pull/1740/commits/cbb13b80c5464ec55554c02d834b990bf466c9a2) as a part of #1740 shows how to deprecate one field in favour of another whilst allowing both to work - which should be what's needed in this case. Feel free to comment on this issue / on a PR with specific questions and we can take help as needed :)\r\n\r\nThanks!"}}
{"actor":{"display_login":"tombuildsstuff"}}