Importing aws_cloudfront_distribution uses the deprecated cache_behavior instead of ordered_cache_behavior #4773
Labels
bug
Addresses a defect in current functionality.
service/cloudfront
Issues and PRs that pertain to the cloudfront service.
Milestone
Community Note
Terraform Version
Affected Resource(s)
Expected Behavior
Running terraform import on a cloudfront distribution with one default cache behavior and one non-default cache behavior should result in the state file having
and
Actual Behavior
Running terraform import on a cloudfront distribution with one default cache behavior and one non-default cache behavior resulted in the state file having
and
Note that the import used "cache_behavior" for the non-default cache behavior instead of ordered_cache_behavior. https://www.terraform.io/docs/providers/aws/r/cloudfront_distribution.html says cache_behavior is "Deprecated, use ordered_cache_behavior instead".
Steps to Reproduce
terraform import
to import itWorkaround
Do the import and then manually edit the state file, changing "cache_behavior.#" to "ordered_cache_behavior.#" and cache_behavior.XXXXXXXXXX.* to ordered_cache_behavior.0.*. If you have more than one non-default cache behavior, you can order them appropriately.
The text was updated successfully, but these errors were encountered: