hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.61k stars 9k forks source link

[Bug]: Imagebuilder distribution inconsistent final plan #27854

Open p24-max opened 1 year ago

p24-max commented 1 year ago

Terraform Core Version

1.3.4

AWS Provider Version

4.39.0

Affected Resource(s)

Expected Behavior

existing imagebuilder distribution can be updated in-place

Actual Behavior

terraform apply exits with error "Provider produced inconsistent final plan"

Relevant Error/Panic Output Snippet

╷
│ Error: Provider produced inconsistent final plan
│ 
│ When expanding the plan for
│ aws_imagebuilder_distribution_configuration.magento-web to include new
│ values learned so far during apply, provider
│ "registry.terraform.io/hashicorp/aws" produced an invalid new value for
│ .distribution: planned set element
│ cty.ObjectVal(map[string]cty.Value{"ami_distribution_configuration":cty.ListValEmpty(cty.Object(map[string]cty.Type{"ami_tags":cty.Map(cty.String),
│ "description":cty.String, "kms_key_id":cty.String,
│ "launch_permission":cty.List(cty.Object(map[string]cty.Type{"organization_arns":cty.Set(cty.String),
│ "organizational_unit_arns":cty.Set(cty.String),
│ "user_groups":cty.Set(cty.String), "user_ids":cty.Set(cty.String)})),
│ "name":cty.String, "target_account_ids":cty.Set(cty.String)})),
│ "container_distribution_configuration":cty.ListValEmpty(cty.Object(map[string]cty.Type{"container_tags":cty.Set(cty.String),
│ "description":cty.String,
│ "target_repository":cty.List(cty.Object(map[string]cty.Type{"repository_name":cty.String,
│ "service":cty.String}))})),
│ "fast_launch_configuration":cty.SetValEmpty(cty.Object(map[string]cty.Type{"account_id":cty.String,
│ "enabled":cty.Bool,
│ "launch_template":cty.List(cty.Object(map[string]cty.Type{"launch_template_id":cty.String,
│ "launch_template_name":cty.String, "launch_template_version":cty.String})),
│ "max_parallel_launches":cty.Number,
│ "snapshot_configuration":cty.List(cty.Object(map[string]cty.Type{"target_resource_count":cty.Number}))})),
│ "launch_template_configuration":cty.SetValEmpty(cty.Object(map[string]cty.Type{"account_id":cty.String,
│ "default":cty.Bool, "launch_template_id":cty.String})),
│ "license_configuration_arns":cty.SetValEmpty(cty.String),
│ "region":cty.NullVal(cty.String)}) does not correlate with any element in
│ actual.
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

Terraform Configuration Files

resource "aws_imagebuilder_distribution_configuration" "magento-web" { name = "magento" tags = {} tags_all = {}

distribution { license_configuration_arns = [] region = var.aws_region

ami_distribution_configuration {
}

launch_template_configuration {
  default            = true
  launch_template_id = var.launch_template_id
}

} }

Steps to Reproduce

Debug Output

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: ~ update in-place -/+ destroy and then create replacement

Terraform will perform the following actions:

aws_imagebuilder_distribution_configuration.magento-web will be updated in-place

~ resource "aws_imagebuilder_distribution_configuration" "magento-web" { id = "arn:aws:imagebuilder:eu-west-1:330322201868:distribution-configuration/magento" name = "magento" tags = {}

(3 unchanged attributes hidden)

  + distribution {
      + license_configuration_arns = []
      + region                     = "eu-west-1"

      + ami_distribution_configuration {
          + target_account_ids = []
        }

      + launch_template_configuration {
          + default            = true
          + launch_template_id = "lt-04a0c8be708b568df"
        }
    }
  - distribution {
      - license_configuration_arns = [] -> null
      - region                     = "eu-west-1" -> null

      - ami_distribution_configuration {
        }

      - launch_template_configuration {
          - account_id         = "330322201868" -> null
          - default            = true -> null
          - launch_template_id = "lt-04a0c8be708b568df" -> null
        }
    }
  + distribution {
      + license_configuration_arns = []
    }
}

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue