如何在 Terraform 上定义 AWS Elastic Beanstalk 的 URL/域?

发布于 2025-01-11 13:19:19 字数 1063 浏览 0 评论 0原文

基本上,我试图在 Terraform 上为我的 EBS 设置一个预设的域/url (绿色框是我想更改什么 URL/域),但我非常不确定在哪里可以执行此操作,以便我的后端管道可以直接上传到我的基础设施,并且我的前端仍然可以连接到它而无需更改任何值任何一个。

他们可以引导我的任何帮助/指示都非常有帮助!

provider "aws" {
  region = "us-east-1"
}
resource "aws_elastic_beanstalk_application" "beanstalkApplication" {
  name        = "beanstalk-test"
  description = "Development test EBS system"
}
resource  "aws_elastic_beanstalk_environment" "beanstalk-env" {
  name = "beanstalk-env"
  domain = "beanstalk-env"
  application = aws_elastic_beanstalk_application.beanstalkApplication.name
  solution_stack_name = "64bit Amazon Linux 2 v2.2.10 running .NET Core" 
  setting {
    namespace = "aws:autoscaling:launchconfiguration"
    name = "IamInstanceProfile"
    value = "aws-elasticbeanstalk-ec2-role"
  }
  setting {
    namespace = "aws:autoscaling:launchconfiguration"
    name = "InstanceType"
    value = "t3a.micro"
  }
}

Basically, I'm trying to have a pre-set domain/url for my EBS on Terraform (Green box is what URL/Domain I want to change), but I am very unsure of where I can do this so that my backend pipeline can upload directly to my infrastructure and my frontend can still connect to it without having to change any values on either.

Any help/direction they can lead me to is very helpful!

provider "aws" {
  region = "us-east-1"
}
resource "aws_elastic_beanstalk_application" "beanstalkApplication" {
  name        = "beanstalk-test"
  description = "Development test EBS system"
}
resource  "aws_elastic_beanstalk_environment" "beanstalk-env" {
  name = "beanstalk-env"
  domain = "beanstalk-env"
  application = aws_elastic_beanstalk_application.beanstalkApplication.name
  solution_stack_name = "64bit Amazon Linux 2 v2.2.10 running .NET Core" 
  setting {
    namespace = "aws:autoscaling:launchconfiguration"
    name = "IamInstanceProfile"
    value = "aws-elasticbeanstalk-ec2-role"
  }
  setting {
    namespace = "aws:autoscaling:launchconfiguration"
    name = "InstanceType"
    value = "t3a.micro"
  }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青衫负雪 2025-01-18 13:19:19

我认为您正在寻找这个

cname_prefix = "prefix.you.want"

I think you are looking for this:

cname_prefix = "prefix.you.want"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文