linzhengen / tech-notes

My tech notes write in github issues🧲
1 stars 0 forks source link

[20210125] `ordered_cache_behavior`を使う時に、追加順を守らないとidが入れ替わって、planで出力された差分わかりづらい #66

Open linzhengen opened 3 years ago

linzhengen commented 3 years ago

ドキュメント

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_distribution


resource "aws_cloudfront_distribution" "s3_distribution" {
...

  ordered_cache_behavior {
    path_pattern     = "/path1"
...
  }

  ordered_cache_behavior {
    path_pattern     = "/path2"
...
  }

  # behavior id 変わらないように順で追加していく
  ordered_cache_behavior {
    path_pattern     = "/path3"
...
  }
}