リソースの関係を読み込む
同じ図で Connection・Association・Dependency の接続先を確認します。
図を読む
aws_security_group.app と aws_instance.app の太い点線を確認します。入力の vpc_security_group_ids の参照から得られた Connection です。通信できることを保証する線ではありません。
サブネットとルートテーブルの破線をたどり、両端の番号を Relationship Resources 一覧と照合します。aws_route_table_association.app による Association です。
aws_instance.app から aws_instance.new への細い実線の矢印を確認します。new の user_data が app.private_ip を参照する Dependency です。
入力 JSON
第2回の構成にセキュリティグループ、ルートテーブル、関連付けを加えた架空の Plan JSON です。JSON を保存して変換画面で選び、「生成する」を押してください。
入力 JSON を表示
{
"format_version": "1.2",
"terraform_version": "1.9.8",
"resource_changes": [
{
"address": "aws_vpc.demo",
"mode": "managed",
"type": "aws_vpc",
"name": "demo",
"provider_name": "registry.terraform.io/hashicorp/aws",
"change": {
"actions": [
"no-op"
],
"before": {
"id": "vpc-demo",
"cidr_block": "10.0.0.0/16"
},
"after": {
"id": "vpc-demo",
"cidr_block": "10.0.0.0/16"
}
}
},
{
"address": "aws_subnet.app",
"mode": "managed",
"type": "aws_subnet",
"name": "app",
"provider_name": "registry.terraform.io/hashicorp/aws",
"change": {
"actions": [
"no-op"
],
"before": {
"id": "subnet-app",
"vpc_id": "vpc-demo",
"cidr_block": "10.0.1.0/24"
},
"after": {
"id": "subnet-app",
"vpc_id": "vpc-demo",
"cidr_block": "10.0.1.0/24"
}
}
},
{
"address": "aws_instance.new",
"mode": "managed",
"type": "aws_instance",
"name": "new",
"provider_name": "registry.terraform.io/hashicorp/aws",
"change": {
"actions": [
"create"
],
"before": null,
"after": {
"subnet_id": "subnet-app",
"instance_type": "t3.micro"
}
}
},
{
"address": "aws_instance.app",
"mode": "managed",
"type": "aws_instance",
"name": "app",
"provider_name": "registry.terraform.io/hashicorp/aws",
"change": {
"actions": [
"update"
],
"before": {
"id": "i-app",
"subnet_id": "subnet-app",
"instance_type": "t3.micro",
"vpc_security_group_ids": [
"sg-app"
]
},
"after": {
"id": "i-app",
"subnet_id": "subnet-app",
"instance_type": "t3.small",
"vpc_security_group_ids": [
"sg-app"
]
}
}
},
{
"address": "aws_instance.old",
"mode": "managed",
"type": "aws_instance",
"name": "old",
"provider_name": "registry.terraform.io/hashicorp/aws",
"change": {
"actions": [
"delete"
],
"before": {
"id": "i-old",
"subnet_id": "subnet-app",
"instance_type": "t3.micro"
},
"after": null
}
},
{
"address": "aws_security_group.app",
"mode": "managed",
"type": "aws_security_group",
"name": "app",
"provider_name": "registry.terraform.io/hashicorp/aws",
"change": {
"actions": [
"no-op"
],
"before": {
"id": "sg-app",
"vpc_id": "vpc-demo"
},
"after": {
"id": "sg-app",
"vpc_id": "vpc-demo"
}
}
},
{
"address": "aws_route_table.app",
"mode": "managed",
"type": "aws_route_table",
"name": "app",
"provider_name": "registry.terraform.io/hashicorp/aws",
"change": {
"actions": [
"no-op"
],
"before": {
"id": "rtb-app",
"vpc_id": "vpc-demo"
},
"after": {
"id": "rtb-app",
"vpc_id": "vpc-demo"
}
}
},
{
"address": "aws_route_table_association.app",
"mode": "managed",
"type": "aws_route_table_association",
"name": "app",
"provider_name": "registry.terraform.io/hashicorp/aws",
"change": {
"actions": [
"no-op"
],
"before": {
"subnet_id": "subnet-app",
"route_table_id": "rtb-app"
},
"after": {
"subnet_id": "subnet-app",
"route_table_id": "rtb-app"
}
}
}
],
"configuration": {
"root_module": {
"resources": [
{
"address": "aws_vpc.demo",
"provider_config_key": "aws"
},
{
"address": "aws_subnet.app",
"expressions": {
"vpc_id": {
"references": [
"aws_vpc.demo.id"
]
}
},
"provider_config_key": "aws"
},
{
"address": "aws_instance.app",
"expressions": {
"subnet_id": {
"references": [
"aws_subnet.app.id"
]
},
"vpc_security_group_ids": {
"references": [
"aws_security_group.app.id"
]
}
},
"provider_config_key": "aws"
},
{
"address": "aws_instance.new",
"expressions": {
"subnet_id": {
"references": [
"aws_subnet.app.id"
]
},
"user_data": {
"references": [
"aws_instance.app.private_ip"
]
}
},
"provider_config_key": "aws"
},
{
"address": "aws_security_group.app",
"expressions": {
"vpc_id": {
"references": [
"aws_vpc.demo.id"
]
}
},
"provider_config_key": "aws"
},
{
"address": "aws_route_table.app",
"expressions": {
"vpc_id": {
"references": [
"aws_vpc.demo.id"
]
}
},
"provider_config_key": "aws"
},
{
"address": "aws_route_table_association.app",
"expressions": {
"subnet_id": {
"references": [
"aws_subnet.app.id"
]
},
"route_table_id": {
"references": [
"aws_route_table.app.id"
]
}
},
"provider_config_key": "aws"
}
]
},
"provider_config": {
"aws": {
"name": "aws",
"full_name": "registry.terraform.io/hashicorp/aws",
"expressions": {
"region": {
"constant_value": "us-east-1"
}
}
}
}
}
}
SVG
生成済みのファイルを表示するため、このページでは変換処理を実行しません。
試してみる
HTML viewer で各アドレスを検索し、JSON の configuration と照合しましょう。線の定義と記号の詳細は用語ページを参照してください。