hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.61k stars 9k forks source link

Elastic Beanstalk & RDS silent failure to apply v2 #9807

Open jkolobok opened 4 years ago

jkolobok commented 4 years ago

There was a ticket, #3955 but it was closed without any fix. The issue is still present.

Community Note

Terraform Version

Terraform v0.12.6

Affected Resource(s)

Terraform Configuration Files

provider "aws" {
  region = "eu-west-1"
}

resource "aws_elastic_beanstalk_application" "tftest" {
  name = "tf-eb-rds-test-1"
  description = "App to test EB env with rds cration "
}

resource "aws_elastic_beanstalk_environment" "tfenvtest" {
  name = "tf-test-name-1"
  application = "${aws_elastic_beanstalk_application.tftest.name}"
  solution_stack_name = "64bit Amazon Linux 2018.03 v3.2.1 running Tomcat 8.5 Java 8"

  setting {
    namespace = "aws:rds:dbinstance"
    name = "DBEngine"
    value = "postgres"
  }
  setting {
    namespace = "aws:rds:dbinstance"
    name = "DBEngineVersion"
    value = "10"
  }
  setting {
    namespace = "aws:rds:dbinstance"
    name = "DBUser"
    value = "postgresss"
  }
  setting {
    namespace = "aws:rds:dbinstance"
    name = "DBPassword"
    value = "123456"
  }
  setting {
    namespace = "aws:rds:dbinstance"
    name = "DBDeletionPolicy"
    value = "Snapshot"
  }
  setting {
    namespace = "aws:rds:dbinstance"
    name = "DBAllocatedStorage"
    value = "10"
  }
  setting {
    namespace = "aws:rds:dbinstance"
    name = "DBInstanceClass"
    value = "t3.small"
  }
}

Debug Output

https://gist.github.com/jkolobok/d20749ee48bfa31038b410394f255fe4

Panic Output

Expected Behavior

Elastic beanstalk environment with RDS instance attached to it will be created

Actual Behavior

TF creates EB environment without RDS at all

Steps to Reproduce

  1. terraform apply

Important Factoids

References

nwmahoney commented 4 years ago

Please vote on this issue by adding a +1 reaction to the original issue to help the community and maintainers prioritize this request

I can't add a reaction to the original issue. I suspect that is because it is closed, so I doubt anyone can. I added a +1 to this instead. Let me know if there is a better way for me or others to vote for this.

Azrrael commented 4 years ago

Same thing happens with: $ terraform -version Terraform v0.12.28

okgolove commented 3 years ago

As soon as I got it is not enough to set RDS related options. AWS WebConsole uses TemplateSpecification field. The field contains CloudFormation snippet which creates RDS. Example of the snippet: https://s3.eu-west-1.amazonaws.com/elasticbeanstalk-env-resources-eu-west-1/eb_snippets/rds/rds.json

And if you take a look at eb cli code you also find TemplateSpecification: https://github.com/aws/aws-elastic-beanstalk-cli/blob/4b68bc370aedce6e09297ad50b59a3cf16d5eda3/ebcli/lib/elasticbeanstalk.py#L278-L286

I think the same logic should be implemented in provider.

ManuelAUT commented 3 years ago

Same thing happens with: $ terraform -version Terraform v1.0.0 on windows_amd64

justinretzolk commented 2 years ago

Hey y'all :wave: Thank you for taking the time to file this issue and for the ongoing discussion! Given that there's been a number of AWS provider releases since the last update, can anyone confirm whether you're still experiencing this behavior?

arsaghri commented 2 years ago

I still have the issue unfortunately

developer239 commented 1 year ago

Hello people from 2024 ๐Ÿ‘‹

jkolobok commented 1 month ago

Any change to have this fixed and make Elasticbeanstalk usable with terraform?