title: How can I set the security group rule description with Terraform?
body: <p>It looks like you can now set <a href="https://aws.amazon.com/blogs/aws/new-descriptions-for-security-group-rules/" rel="nofollow noreferrer">security group rule descriptions</a>. This is super useful for maintaining whitelists for administrative access.</p>
  
  <p>I can set the description in the AWS console but can't figure out how to set it with Terraform. </p>
  
  <p>My assumption was that if the AWS API allows for it, Terraform can just do it without explicit support for it in the Terraform code. Perhaps that's wishful thinking and we'll have to wait for Terraform to support the new feature, or perhaps I'm just doing it wrong.</p>
  
  <p>I tried simply declaring the description property in the rule declaration (like you would for the description of the security group itself):</p>
  
  <pre><code>    ingress {
          from_port       = 22
          to_port         = 22
          protocol        = "tcp"
          cidr_blocks     = ["123.456.789.123"]
          description     = "some rule description"
          }
  </code></pre>
  
  <p>Terraform bails in the plan stage with:</p>
  
  <blockquote>
    <p>aws_security_group.somegroup: ingress.0: invalid or unknown key: description</p>
  </blockquote>
  
  <p>I also tried setting tags within the rule declaration (like you would for setting the name of the security group):</p>
  
  <pre><code>     ingress {
           from_port       = 22
           ...
        tags {
             "Description" = "some rule description"
             }
        }
  </code></pre>
  
  <p>Terraform bails in the plan stage with:</p>
  
  <blockquote>
    <p>aws_security_group.somegroup: ingress.0: invalid or unknown key: tags</p>
  </blockquote>