热门标签 | 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.


   



推荐阅读
  • 本文介绍了在rhel5.5操作系统下搭建网关+LAMP+postfix+dhcp的步骤和配置方法。通过配置dhcp自动分配ip、实现外网访问公司网站、内网收发邮件、内网上网以及SNAT转换等功能。详细介绍了安装dhcp和配置相关文件的步骤,并提供了相关的命令和配置示例。 ... [详细]
  • 本文介绍了Oracle数据库中tnsnames.ora文件的作用和配置方法。tnsnames.ora文件在数据库启动过程中会被读取,用于解析LOCAL_LISTENER,并且与侦听无关。文章还提供了配置LOCAL_LISTENER和1522端口的示例,并展示了listener.ora文件的内容。 ... [详细]
  • 图解redis的持久化存储机制RDB和AOF的原理和优缺点
    本文通过图解的方式介绍了redis的持久化存储机制RDB和AOF的原理和优缺点。RDB是将redis内存中的数据保存为快照文件,恢复速度较快但不支持拉链式快照。AOF是将操作日志保存到磁盘,实时存储数据但恢复速度较慢。文章详细分析了两种机制的优缺点,帮助读者更好地理解redis的持久化存储策略。 ... [详细]
  • 本文讨论了在数据库打开和关闭状态下,重新命名或移动数据文件和日志文件的情况。针对性能和维护原因,需要将数据库文件移动到不同的磁盘上或重新分配到新的磁盘上的情况,以及在操作系统级别移动或重命名数据文件但未在数据库层进行重命名导致报错的情况。通过三个方面进行讨论。 ... [详细]
  • 本文介绍了Windows操作系统的版本及其特点,包括Windows 7系统的6个版本:Starter、Home Basic、Home Premium、Professional、Enterprise、Ultimate。Windows操作系统是微软公司研发的一套操作系统,具有人机操作性优异、支持的应用软件较多、对硬件支持良好等优点。Windows 7 Starter是功能最少的版本,缺乏Aero特效功能,没有64位支持,最初设计不能同时运行三个以上应用程序。 ... [详细]
  • 本文介绍了Python爬虫技术基础篇面向对象高级编程(中)中的多重继承概念。通过继承,子类可以扩展父类的功能。文章以动物类层次的设计为例,讨论了按照不同分类方式设计类层次的复杂性和多重继承的优势。最后给出了哺乳动物和鸟类的设计示例,以及能跑、能飞、宠物类和非宠物类的增加对类数量的影响。 ... [详细]
  • 虚拟化_深度:资源虚拟化
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了深度:资源虚拟化相关的知识,希望对你有一定的参考价值。 ... [详细]
  • vc写入mysql数据库无效_VC连接mysql数据库错误:libmysql.lib : fatal error LNK1113: invalid machine 解决方法...
    VC连接MySQL的配置过程在上一篇博文中,不过当你设置好,以为万事大吉的时候,运行却出现这个错误:libmysql.lib:fatalerrorLNK1113:inval ... [详细]
  • 本文介绍了在mac环境下使用nginx配置nodejs代理服务器的步骤,包括安装nginx、创建目录和文件、配置代理的域名和日志记录等。 ... [详细]
  • Java在运行已编译完成的类时,是通过java虚拟机来装载和执行的,java虚拟机通过操作系统命令JAVA_HOMEbinjava–option来启 ... [详细]
  • 怎么在PHP项目中实现一个HTTP断点续传功能发布时间:2021-01-1916:26:06来源:亿速云阅读:96作者:Le ... [详细]
  • PHP反射API的功能和用途详解
    本文详细介绍了PHP反射API的功能和用途,包括动态获取信息和调用对象方法的功能,以及自动加载插件、生成文档、扩充PHP语言等用途。通过反射API,可以获取类的元数据,创建类的实例,调用方法,传递参数,动态调用类的静态方法等。PHP反射API是一种内建的OOP技术扩展,通过使用Reflection、ReflectionClass和ReflectionMethod等类,可以帮助我们分析其他类、接口、方法、属性和扩展。 ... [详细]
  • 域名解析系统DNS
    文章目录前言一、域名系统概述二、因特网的域名结构三、域名服务器1.根域名服务器2.顶级域名服务器(TLD,top-leveldomain)3.权威(Authoritative)域名 ... [详细]
  • Apple iPad:过渡设备还是平板电脑?
    I’vebeenagonizingoverwhethertopostaniPadarticle.Applecertainlydon’tneedmorepublicityandthe ... [详细]
  • 本文整理了Java中com.amazonaws.services.kms.AWSKMSClientBuilder类的一些代码示例,展示了AWSKMSClie ... [详细]
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社区 版权所有