max_retries
… APIのリトライ回数を指定できるhttps://www.terraform.io/docs/providers/aws/d/acm_certificate.html
ACM証明書の情報取得
参考:
https://www.terraform.io/docs/providers/aws/d/caller_identity.html
Terraform実行中のAWSアカウントのID等の情報を取得する。
参考:
https://www.terraform.io/docs/providers/aws/d/iam_policy_document.html
IAM PolicyのJSONをHCLっぽく定義できる。
JSONテンプレートより融通が効くし、syntax checkも掛かるので、便利なことがある。
https://www.terraform.io/docs/providers/aws/d/region.html
provider
で設定したリージョンを取得できる。
https://www.terraform.io/docs/providers/aws/d/sns_topic.html
SNS TopicのARNを取得できる。
https://www.terraform.io/docs/providers/aws/d/ssm_parameter.html
EC2 Parameter Storeからデータ取得
# "foo"という名前のパラメータストアを取得
data "aws_ssm_parameter" "foo" {
name = "foo"
}
SecureString
であっても特にKSM keyを指定する必要はない。内部的にdecryptしてくれるみたい。参考:
Application AutoScaling.
ECS Serviceなどのオートスケール設定。
retention_in_days
… ログの保持期間。とり得る値は http://docs.aws.amazon.com/ja_jp/AmazonCloudWatchLogs/latest/APIReference/API_PutRetentionPolicy.html に示されている。 0
を指定すると無期限になる。schedule_expression
の書式は http://docs.aws.amazon.com/ja_jp/AmazonCloudWatch/latest/events/ScheduledEvents.htmlplacement_strategy
… ECSタスク配置戦略。See https://docs.aws.amazon.com/ja_jp/AmazonECS/latest/developerguide/task-placement-strategies.html動的ポートマッピングをする場合、task_definitionでhostPortを0にする:
# ecs_task_definition.tf
resource "aws_ecs_task_definition" "service" {
:
container_definitions = "${file("task-definitions/service.json")}"
:
}
# task_definitions/service.json
[
{
:
"portMappings": [
{
"containerPort": 3000,
"hostPort": 0,
]
},
:
]
参考:
domain_id
… ${AWSアカウントID}/${クラスタ名}
. 監視のdimentionとしてはそのままでは使えない。ALB等の作成・管理:
CLB:
vpc_id
を指定するとPrivate Hosted Zoneになる。delegation_set_id
を指定するとPublic Hosted Zoneになる。enable_dns_hostnames
, enable_dns_support
を true
にする。https://www.terraform.io/docs/providers/aws/r/budgets_budget.html
Budgetにコストアラートを設定できたり。
https://www.terraform.io/docs/providers/aws/r/dynamodb_table.html
DynamoDB table作成
https://www.terraform.io/docs/providers/aws/r/security_group.html
Security Groupの作成・管理
https://www.terraform.io/docs/providers/aws/r/sqs_queue.html
SQS Queueの作成・管理
https://www.terraform.io/docs/providers/aws/r/ssm_parameter.html
EC2 Parameter Storeにデータを保存する。