-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lifecycle ignore_changes not working, still showing ~ update in-place #16930
Comments
Hi @nodesocket, I'm not able to reproduce this, at least in my config the Is there anything else in that |
Running Here is the full configuration I am using. Do I need to also apply the variable "domain_name" {
description = "Domain name of the Elasticsearch cluster"
}
variable "allowed_ips" {
type = "list"
description = "A list of allowed IPs that can connect to the Elasticsearch cluster"
}
variable "version" {
description = "The version of Elasticsearch to run in the cluster"
default = "5.5" // latest version
}
variable "data_node_count" {
description = "The number of Elasticsearch data nodes"
default = 2 // must be an even number
}
variable "data_node_instance_type" {
description = "The instance type of each Elasticsearch data node"
default = "r4.large.elasticsearch"
}
variable "master_node_count" {
description = "The number of Elasticsearch dedicated master nodes"
default = 3
}
variable "master_node_instance_type" {
description = "The instance type of each Elasticsearch dedicated master node"
default = "t2.medium.elasticsearch"
}
variable "ebs_volume_size" {
description = "The EBS volume size of each Elasticsearch node"
default = 200
}
resource "aws_elasticsearch_domain" "elasticsearch" {
domain_name = "${var.domain_name}"
elasticsearch_version = "${var.version}"
cluster_config {
instance_count = "${var.data_node_count}"
instance_type = "${var.data_node_instance_type}"
dedicated_master_enabled = true
dedicated_master_count = "${var.master_node_count}"
dedicated_master_type = "${var.master_node_instance_type}"
zone_awareness_enabled = true
}
ebs_options {
ebs_enabled = true
volume_type = "gp2" // general purpose SSD
volume_size = "${var.ebs_volume_size}"
}
snapshot_options {
automated_snapshot_start_hour = 1 // 1:00am
}
}
resource "aws_elasticsearch_domain_policy" "main" {
domain_name = "${aws_elasticsearch_domain.elasticsearch.domain_name}"
access_policies = <<CONFIG
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"es:*"
],
"Principal": {
"AWS": "*"
},
"Effect": "Allow",
"Condition": {
"IpAddress": {"aws:SourceIp": ${jsonencode(var.allowed_ips)}}
}
}
]
}
CONFIG
lifecycle {
ignore_changes = [
"access_policies"
]
}
} |
I tried adding: lifecycle {
ignore_changes = [
"access_policies"
]
} To the resource
Any ideas? This is blocking since rebuilding our 100GB Elasticsearch cluster every |
I can't seem to replicate this, even using the exact config you've provided. |
@jbardin are you using it as a module as well? variable "web_public_ip_addrs" {
type = "list"
default = [
"51.1.2.3/32",
"51.1.2.4/32"
]
}
variable "justin_home_ip_addr" {
default = "1.2.3.4/32"
}
variable "adam_home_ip_addr" {
default = "2.3.4.5/32"
}
module "elasticsearch" {
source = "../../modules/elasticsearch"
domain_name = "my-elasticsearch-dev"
allowed_ips = [
"${var.justin_home_ip_addr}",
"${var.adam_home_ip_addr}",
"${var.web_public_ip_addrs}"
]
}
|
Just tried as a module, passing things in various ways that I thought might break, but still no luck here. I did notice something, which may be leading us in the right direction, is that technically the
Now regardless of what that outputs, the |
@jbardin ok, I changed the declaration to: module "elasticsearch" {
source = "../../modules/elasticsearch"
domain_name = "my-elasticsearch-dev"
allowed_ips = "${
concat(
list(
var.justin_home_ip_addr,
var.adam_home_ip_addr
),
var.web_public_ip_addrs
)
}"
} Still seeing it wanted to do |
@jbardin darn it. Just ran
|
I'm starting to wonder if the Could you capture the full log output from a plan with |
Ok, I manually deleted everything in the directory Once I get past that, I will advise on this original issue. |
@nodesocket sorry you have been having trouble with this! Looks like hashicorp/terraform-provider-aws#2772 was fixed in terraform-provider-aws version 1.7.0 so you should be good for testing again. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Due to an outstanding bug in the AWS provider and Elasticsearch service I am looking to ignore the
access_policies
property in aaws_elasticsearch_domain_policy
.However when I run
plan
, I am still seeing~ update in-place
related to theaccess_policies
. How can I completely ignore changes toaccess_policies
and not apply?The text was updated successfully, but these errors were encountered: