热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

ElasticBeanstalkenvironmentforcesupdateoneachapply

Hello,EverytimeIrun

Hello,

Every time I run

1
terraform apply

my elastic beanstalk environment is marked for update, which in turn re-creates my environment. This is clearly undesirable behavior.

Terraform Version

1
Terraform v0.10.2


Affected Resource(s)


  • aws_elastic_beanstalk_environment

Terraform Configuration Files

1
2
3
4
5
6
7
8
9
10
11
hcl

resource "aws_elastic_beanstalk_environment" "backend" {

  name                = "backend-${var.environment}"

  application         = "backend"

  solution_stack_name = "64bit Amazon Linux 2017.03 v2.4.3 running PHP 5.6"

  tier                = "WebServer"



  setting {

  ...

  }

}


Output

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
  ~ module.ums.aws_elastic_beanstalk_environment.backend

      setting.#:                    "19" => "20"

      setting.1224657411.name:      "SSHSourceRestriction" => ""

      setting.1224657411.namespace: "aws:autoscaling:launchconfiguration" => ""

      setting.1224657411.resource:  "" => ""

      setting.1224657411.value:     "tcp,22,22,null" => ""

      setting.1311926541.name:      "RollingUpdateEnabled" => "RollingUpdateEnabled"

      setting.1311926541.namespace: "aws:autoscaling:updatepolicy:rollingupdate" => "aws:autoscaling:updatepolicy:rollingupdate"

      setting.1311926541.resource:  "" => ""

      setting.1311926541.value:     "true" => "true"

      setting.1531156480.name:      "Application Healthcheck URL" => ""

      setting.1531156480.namespace: "aws:elasticbeanstalk:application" => ""

      setting.1531156480.resource:  "" => ""

      setting.1531156480.value:     "/elb-status" => ""

      setting.1636165274.name:      "EC2KeyName" => "EC2KeyName"

      setting.1636165274.namespace: "aws:autoscaling:launchconfiguration" => "aws:autoscaling:launchconfiguration"

      setting.1636165274.resource:  "" => ""

      setting.1636165274.value:     "key" => "key"

      setting.2276893638.name:      "RollingUpdateType" => "RollingUpdateType"

      setting.2276893638.namespace: "aws:autoscaling:updatepolicy:rollingupdate" => "aws:autoscaling:updatepolicy:rollingupdate"

      setting.2276893638.resource:  "" => ""

      setting.2276893638.value:     "Health" => "Health"

      setting.2396587397.name:      "MinSize" => "MinSize"

      setting.2396587397.namespace: "aws:autoscaling:asg" => "aws:autoscaling:asg"

      setting.2396587397.resource:  "" => ""

      setting.2396587397.value:     "1" => "1"

      setting.2420299722.name:      "SystemType" => "SystemType"

      setting.2420299722.namespace: "aws:elasticbeanstalk:healthreporting:system" => "aws:elasticbeanstalk:healthreporting:system"

      setting.2420299722.resource:  "" => ""

      setting.2420299722.value:     "enhanced" => "enhanced"

      setting.2558992023.name:      "ManagedActionsEnabled" => "ManagedActionsEnabled"

      setting.2558992023.namespace: "aws:elasticbeanstalk:managedactions" => "aws:elasticbeanstalk:managedactions"

      setting.2558992023.resource:  "" => ""

      setting.2558992023.value:     "true" => "true"

      setting.2671587030.name:      "Subnets" => "Subnets"

      setting.2671587030.namespace: "aws:ec2:vpc" => "aws:ec2:vpc"

      setting.2671587030.resource:  "" => ""

      setting.2671587030.value:     "subnet-3630230b,subnet-6a798c23,subnet-6d116547,subnet-8ea1a4d6" => "subnet-3630230b,subnet-6a798c23,subnet-6d116547,subnet-8ea1a4d6"

      setting.2808638165.name:      "PreferredStartTime" => "PreferredStartTime"

      setting.2808638165.namespace: "aws:elasticbeanstalk:managedactions" => "aws:elasticbeanstalk:managedactions"

      setting.2808638165.resource:  "" => ""

      setting.2808638165.value:     "Sun:02:00" => "Sun:02:00"

      setting.2983186660.name:      "UpdateLevel" => "UpdateLevel"

      setting.2983186660.namespace: "aws:elasticbeanstalk:managedactions:platformupdate" => "aws:elasticbeanstalk:managedactions:platformupdate"

      setting.2983186660.resource:  "" => ""

      setting.2983186660.value:     "minor" => "minor"

      setting.3007260544.name:      "AssociatePublicIpAddress" => "AssociatePublicIpAddress"

      setting.3007260544.namespace: "aws:ec2:vpc" => "aws:ec2:vpc"

      setting.3007260544.resource:  "" => ""

      setting.3007260544.value:     "true" => "true"

      setting.3172159480.name:      "ELBSubnets" => "ELBSubnets"

      setting.3172159480.namespace: "aws:ec2:vpc" => "aws:ec2:vpc"

      setting.3172159480.resource:  "" => ""

      setting.3172159480.value:     "subnet-3630230b,subnet-6a798c23,subnet-6d116547,subnet-8ea1a4d6" => "subnet-3630230b,subnet-6a798c23,subnet-6d116547,subnet-8ea1a4d6"

      setting.3225151102.name:      "MaxSize" => "MaxSize"

      setting.3225151102.namespace: "aws:autoscaling:asg" => "aws:autoscaling:asg"

      setting.3225151102.resource:  "" => ""

      setting.3225151102.value:     "2" => "2"

      setting.3276487710.name:      "" => "Application Healthcheck URL"

      setting.3276487710.namespace: "" => "aws:elasticbeanstalk:application"

      setting.3276487710.resource:  "" => ""

      setting.3276487710.value:     "" => "HTTP:80/elb-status"

      setting.335963092.name:       "" => "DBSubnets"

      setting.335963092.namespace:  "" => "aws:ec2:vpc"

      setting.335963092.resource:   "" => ""

      setting.335963092.value:      "" => "subnet-3630230b,subnet-6a798c23,subnet-6d116547,subnet-8ea1a4d6"

      setting.337125008.name:       "" => "SSHSourceRestriction"

      setting.337125008.namespace:  "" => "aws:autoscaling:launchconfiguration"

      setting.337125008.resource:   "" => ""

      setting.337125008.value:      "" => "tcp, 22, 22, sg-9f9946e4"

      setting.37040285.name:        "ServiceRole" => "ServiceRole"

      setting.37040285.namespace:   "aws:elasticbeanstalk:environment" => "aws:elasticbeanstalk:environment"

      setting.37040285.resource:    "" => ""

      setting.37040285.value:       "aws-elasticbeanstalk-service-role" => "aws-elasticbeanstalk-service-role"

      setting.3909253589.name:      "VPCId" => "VPCId"

      setting.3909253589.namespace: "aws:ec2:vpc" => "aws:ec2:vpc"

      setting.3909253589.resource:  "" => ""

      setting.3909253589.value:     "vpc-581ad93f" => "vpc-581ad93f"

      setting.417274623.name:       "InstanceType" => "InstanceType"

      setting.417274623.namespace:  "aws:autoscaling:launchconfiguration" => "aws:autoscaling:launchconfiguration"

      setting.417274623.resource:   "" => ""

      setting.417274623.value:      "m3.medium" => "m3.medium"

      setting.43215759.name:        "SecurityGroups" => "SecurityGroups"

      setting.43215759.namespace:   "aws:autoscaling:launchconfiguration" => "aws:autoscaling:launchconfiguration"

      setting.43215759.resource:    "" => ""

      setting.43215759.value:       "sg-b445c3c4" => "sg-b445c3c4"

      setting.733236782.name:       "IamInstanceProfile" => "IamInstanceProfile"

      setting.733236782.namespace:  "aws:autoscaling:launchconfiguration" => "aws:autoscaling:launchconfiguration"

      setting.733236782.resource:   "" => ""

      setting.733236782.value:      "profile" => "profile"


Expected Behavior

No change should be detected

Actual Behavior

Terraform thinks I've made a change

Steps to Reproduce


  1. Run
    1
    terraform apply


  2. Run
    1
    terraform apply

    again with no changes


该提问来源于开源项目:hashicorp/terraform-provider-aws

One other thing I just noticed was that when you have lists of things (subnets, security groups), sometimes they come back in a different order than your TF config specifies, so it detects a diff every time. Reorder the entries in the value to match what's coming back, and it should be set. That, plus the




1
resource = ""

hack is what fixed it all for me.


   



推荐阅读
  • 在对WordPress Duplicator插件0.4.4版本的安全评估中,发现其存在跨站脚本(XSS)攻击漏洞。此漏洞可能被利用进行恶意操作,建议用户及时更新至最新版本以确保系统安全。测试方法仅限于安全研究和教学目的,使用时需自行承担风险。漏洞编号:HTB23162。 ... [详细]
  • JUC(三):深入解析AQS
    本文详细介绍了Java并发工具包中的核心类AQS(AbstractQueuedSynchronizer),包括其基本概念、数据结构、源码分析及核心方法的实现。 ... [详细]
  • Spring – Bean Life Cycle
    Spring – Bean Life Cycle ... [详细]
  • 本文介绍了如何利用HTTP隧道技术在受限网络环境中绕过IDS和防火墙等安全设备,实现RDP端口的暴力破解攻击。文章详细描述了部署过程、攻击实施及流量分析,旨在提升网络安全意识。 ... [详细]
  • php更新数据库字段的函数是,php更新数据库字段的函数是 ... [详细]
  • 如何在Windows内置的Ubuntu系统中更改SSH服务的端口号设置
    如何在Windows内置的Ubuntu系统中更改SSH服务的端口号设置 ... [详细]
  • 基于Net Core 3.0与Web API的前后端分离开发:Vue.js在前端的应用
    本文介绍了如何使用Net Core 3.0和Web API进行前后端分离开发,并重点探讨了Vue.js在前端的应用。后端采用MySQL数据库和EF Core框架进行数据操作,开发环境为Windows 10和Visual Studio 2019,MySQL服务器版本为8.0.16。文章详细描述了API项目的创建过程、启动步骤以及必要的插件安装,为开发者提供了一套完整的开发指南。 ... [详细]
  • SecureCRT是一款功能强大的终端仿真软件,支持SSH1和SSH2协议,适用于在Windows环境下高效连接和管理Linux服务器。该工具不仅提供了稳定的连接性能,还具备丰富的配置选项,能够满足不同用户的需求。通过SecureCRT,用户可以轻松实现对远程Linux系统的安全访问和操作。 ... [详细]
  • 服务器部署中的安全策略实践与优化
    服务器部署中的安全策略实践与优化 ... [详细]
  • 优化后的标题:深入探讨网关安全:将微服务升级为OAuth2资源服务器的最佳实践
    本文深入探讨了如何将微服务升级为OAuth2资源服务器,以订单服务为例,详细介绍了在POM文件中添加 `spring-cloud-starter-oauth2` 依赖,并配置Spring Security以实现对微服务的保护。通过这一过程,不仅增强了系统的安全性,还提高了资源访问的可控性和灵活性。文章还讨论了最佳实践,包括如何配置OAuth2客户端和资源服务器,以及如何处理常见的安全问题和错误。 ... [详细]
  • V8不仅是一款著名的八缸发动机,广泛应用于道奇Charger、宾利Continental GT和BossHoss摩托车中。自2008年以来,作为Chromium项目的一部分,V8 JavaScript引擎在性能优化和技术创新方面取得了显著进展。该引擎通过先进的编译技术和高效的垃圾回收机制,显著提升了JavaScript的执行效率,为现代Web应用提供了强大的支持。持续的优化和创新使得V8在处理复杂计算和大规模数据时表现更加出色,成为众多开发者和企业的首选。 ... [详细]
  • 本文深入探讨了NoSQL数据库的四大主要类型:键值对存储、文档存储、列式存储和图数据库。NoSQL(Not Only SQL)是指一系列非关系型数据库系统,它们不依赖于固定模式的数据存储方式,能够灵活处理大规模、高并发的数据需求。键值对存储适用于简单的数据结构;文档存储支持复杂的数据对象;列式存储优化了大数据量的读写性能;而图数据库则擅长处理复杂的关系网络。每种类型的NoSQL数据库都有其独特的优势和应用场景,本文将详细分析它们的特点及应用实例。 ... [详细]
  • 在PHP中实现腾讯云接口签名,以完成人脸核身功能的对接与签名配置时,需要注意将文档中的POST请求改为GET请求。具体步骤包括:使用你的`secretKey`生成签名字符串`$srcStr`,格式为`GET faceid.tencentcloudapi.com?`,确保参数正确拼接,避免因请求方法错误导致的签名问题。此外,还需关注API的其他参数要求,确保请求的完整性和安全性。 ... [详细]
  • 在安装并配置了Elasticsearch后,我在尝试通过GET /_nodes请求获取节点信息时遇到了问题,收到了错误消息。为了确保请求的正确性和安全性,我需要进一步排查配置和网络设置,以确保Elasticsearch集群能够正常响应。此外,还需要检查安全设置,如防火墙规则和认证机制,以防止未经授权的访问。 ... [详细]
  • 数字图书馆近期展出了一批精选的Linux经典著作,这些书籍虽然部分较为陈旧,但依然具有重要的参考价值。如需转载相关内容,请务必注明来源:小文论坛(http://www.xiaowenbbs.com)。 ... [详细]
author-avatar
陈婉恩上源
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有