OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

"The security group does not exist" when setting Elastic Beanstalk EC2 security group with Terraform

  • Thread starter Thread starter dodov
  • Start date Start date
D

dodov

Guest
As the title goes, I have this Terraform file:

Code:
resource "aws_security_group" "database" {
  name = "my-database"
}

resource "aws_elastic_beanstalk_environment" "default" {
  # ...

  setting {
    namespace = "aws:autoscaling:launchconfiguration"
    name      = "SecurityGroups"
    value     = aws_security_group.database.id
  }
}

However, when I run terraform apply, I get the following error:

Error: updating Elastic Beanstalk Environment (e-7mdzvujjfx): ConfigurationValidationException: Configuration validation exception: Invalid option value: 'sg-0beb6502be9e607bf' (Namespace: 'aws:autoscaling:launchconfiguration', OptionName: 'SecurityGroups'): The security group 'sg-0beb6502be9e607bf' does not exist

…but the security group does exist and it has the exact same ID.
<p>As the title goes, I have this Terraform file:</p>
<pre><code>resource "aws_security_group" "database" {
name = "my-database"
}

resource "aws_elastic_beanstalk_environment" "default" {
# ...

setting {
namespace = "aws:autoscaling:launchconfiguration"
name = "SecurityGroups"
value = aws_security_group.database.id
}
}
</code></pre>
<p>However, when I run <code>terraform apply</code>, I get the following error:</p>
<blockquote>
<p>Error: updating Elastic Beanstalk Environment (e-7mdzvujjfx): ConfigurationValidationException: Configuration validation exception: Invalid option value: 'sg-0beb6502be9e607bf' (Namespace: 'aws:autoscaling:launchconfiguration', OptionName: 'SecurityGroups'): The security group 'sg-0beb6502be9e607bf' does not exist</p>
</blockquote>
<p>…but the security group <strong>does</strong> exist and it has the exact same ID.</p>
Continue reading...
 

Latest posts

Top