Terraform v0.11.13
+ provider.aws v2.7.0
data "aws_caller_identity" "current" {}
resource "aws_config_configuration_aggregator" "account" {
name = "MyAccountAggregator"
account_aggregation_source {
all_regions = true
account_ids = ["${data.aws_caller_identity.current.account_id}"]
}
}
terraform apply
terraform apply
againterraform import aws_config_configuration_aggregator.account MyAccountAggregator
terraform apply
againI haven't redacted any sensitive tokens from the debug output so I haven't got the entire thing to post, but I did save debug output for each run and did a diff. This stood out:
[DEBUG] plugin.terraform-provider-aws_v2.7.0_x4: [WARN] No such configuration aggregator (myaccountaggregator), removing from state
...which led to me to try the same exercise again, with the name my-account-aggregator
instead. This worked fine.
So it appears that:
I actually run into Error: Provider produced inconsistent result after apply
because of this.
I have what I believe is a related issue:
resource "aws_config_configuration_aggregator" "account" {
count = "${var.aws_account_id == "XXXXXXXXXXXX" ? 1 : 0}"
name = "XXXXXXXXXXXX"
account_aggregation_source {
account_ids = [
for acct in var.non_security_member_accounts :
acct.aws_account_id
]
all_regions = true
}
}
Execution plan results in:
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# module.config.aws_config_configuration_aggregator.account[0] will be updated in-place
~ resource "aws_config_configuration_aggregator" "account" {
arn = "arn:aws:config:us-west-2:XXXXXXXXXXXX:config-aggregator/config-aggregator-jhbprejd"
id = "XXXXXXXXXXXX"
name = "XXXXXXXXXXXX"
~ account_aggregation_source {
~ account_ids = [
"AAAAAAAAAAAA",
- "BBBBBBBBBBBB",
- "CCCCCCCCCCCC",
"DDDDDDDDDDDD",
"EEEEEEEEEEEE",
+ "BBBBBBBBBBBB",
]
all_regions = true
regions = []
}
}
Plan: 0 to add, 1 to change, 0 to destroy.
I did expect to see CCCCCCCCCCCC removed, as it's not part of the list I'm passing in to the variable. However, notice B is both added and removed. Attempting to apply results in:
Error: Provider produced inconsistent result after apply
When applying changes to
module.config.aws_config_configuration_aggregator.account[0], provider "aws"
produced an unexpected new value for was present, but now absent.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
I believe this part of related state management problems for this resource.
Same behavior is still present in version 3.2.0...
Terraform v0.12.29
+ provider.aws v3.2.0
still same problem with 3.7
Most helpful comment
I have what I believe is a related issue:
Execution plan results in:
I did expect to see CCCCCCCCCCCC removed, as it's not part of the list I'm passing in to the variable. However, notice B is both added and removed. Attempting to apply results in:
I believe this part of related state management problems for this resource.