generated at
Launch Configration

EC2インスタンスの設定情報を定義するための仕組み
最近は代わりにLaunch Templateを使う


GPT-4
>起動設定は、ASGが使用する古い形式のテンプレートで、EC2インスタンスを起動するための設定情報を定義します。一度作成するとその設定は変更できず、新しい設定を適用したい場合は新しい起動設定を作成し、ASGに紐付けなおす必要があります。起動設定は、Auto Scalingの基本的な機能をサポートしていますが、新しいAWS機能のサポートには限界があり、起動テンプレートに比べて柔軟性に欠けます。

れい.tf
resource "aws_launch_configuration" "example" { image_id = "ami-0fb653ca2d3203ac1" instance_type = "t2.micro" security_groups = [aws_security_group.instance.id] user_data = <<-EOF #!/bin/bash echo "Hello, World" > index.html nohup busybox httpd -f -p ${var.server_port} & EOF lifecycle { create_before_destroy = true } }