Aws KInesis Terraform - 如何将数据流连接到 Data Firehose
Aws KInesis Terraform - How to connect Data Streams to Data Firehose
我想使用 terraform、Kinesis datastream 和 data firehose 创建并连接它们(作为管道)。当我使用 UI 时,当我转到 firehose 时,我可以转到 source->Kinesis stream,然后选择我创建的 kinesis 流。但我想用 terraform 来做。
这是创建运动流的代码(我从官方运动文档中获取):
resource "aws_kinesis_stream" "test_stream" {
name = "terraform-kinesis-test"
shard_count = 1
retention_period = 30
shard_level_metrics = [
"IncomingBytes",
"OutgoingBytes",
]
tags = {
Environment = "test"
}
这是数据流水线的代码:
resource "aws_elasticsearch_domain" "test_cluster" {
domain_name = "firehose-es-test"
elasticsearch_version = "6.4"
cluster_config {
instance_type = "t2.small.elasticsearch"
}
ebs_options{
ebs_enabled = true
volume_size = 10
}
}
resource "aws_iam_role" "firehose_role" {
name = "firehose_test_role"
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "firehose.amazonaws.com"
},
"Effect": "Allow",
"Sid": ""
}
]
}
EOF
}
resource "aws_kinesis_firehose_delivery_stream" "test_stream" {
name = "terraform-kinesis-firehose-test-stream"
destination = "elasticsearch"
/*
s3_configuration {
role_arn = "${aws_iam_role.firehose_role.arn}"
bucket_arn = "${aws_s3_bucket.bucket.arn}"
buffer_size = 10
buffer_interval = 400
compression_format = "GZIP"
}
*/
elasticsearch_configuration {
domain_arn = "${aws_elasticsearch_domain.test_cluster.arn}"
role_arn = "${aws_iam_role.firehose_role.arn}"
index_name = "test"
type_name = "test"
processing_configuration {
enabled = "true"
}
}
}
那么我该如何连接它们,是不是类似于 ${aws_kinesis_stream.test_stream.arn} ?或类似的东西?
我使用了 aws_kinesis_stream and aws_kinesis_firehose_delivery_stream(elasticsearch 目标)的官方文档。
这在 kinesis_firehose_delivery_stream]
文档中。通过示例滚动到 Argument Reference 部分,您会看到:
The kinesis_source_configuration object supports the following:
kinesis_stream_arn (Required) The kinesis stream used as the source of the firehose delivery stream.
role_arn (Required) The ARN of the role that provides access to the source Kinesis stream.
我想使用 terraform、Kinesis datastream 和 data firehose 创建并连接它们(作为管道)。当我使用 UI 时,当我转到 firehose 时,我可以转到 source->Kinesis stream,然后选择我创建的 kinesis 流。但我想用 terraform 来做。
这是创建运动流的代码(我从官方运动文档中获取):
resource "aws_kinesis_stream" "test_stream" {
name = "terraform-kinesis-test"
shard_count = 1
retention_period = 30
shard_level_metrics = [
"IncomingBytes",
"OutgoingBytes",
]
tags = {
Environment = "test"
}
这是数据流水线的代码:
resource "aws_elasticsearch_domain" "test_cluster" {
domain_name = "firehose-es-test"
elasticsearch_version = "6.4"
cluster_config {
instance_type = "t2.small.elasticsearch"
}
ebs_options{
ebs_enabled = true
volume_size = 10
}
}
resource "aws_iam_role" "firehose_role" {
name = "firehose_test_role"
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "firehose.amazonaws.com"
},
"Effect": "Allow",
"Sid": ""
}
]
}
EOF
}
resource "aws_kinesis_firehose_delivery_stream" "test_stream" {
name = "terraform-kinesis-firehose-test-stream"
destination = "elasticsearch"
/*
s3_configuration {
role_arn = "${aws_iam_role.firehose_role.arn}"
bucket_arn = "${aws_s3_bucket.bucket.arn}"
buffer_size = 10
buffer_interval = 400
compression_format = "GZIP"
}
*/
elasticsearch_configuration {
domain_arn = "${aws_elasticsearch_domain.test_cluster.arn}"
role_arn = "${aws_iam_role.firehose_role.arn}"
index_name = "test"
type_name = "test"
processing_configuration {
enabled = "true"
}
}
}
那么我该如何连接它们,是不是类似于 ${aws_kinesis_stream.test_stream.arn} ?或类似的东西?
我使用了 aws_kinesis_stream and aws_kinesis_firehose_delivery_stream(elasticsearch 目标)的官方文档。
这在 kinesis_firehose_delivery_stream]
文档中。通过示例滚动到 Argument Reference 部分,您会看到:
The kinesis_source_configuration object supports the following:
kinesis_stream_arn (Required) The kinesis stream used as the source of the firehose delivery stream. role_arn (Required) The ARN of the role that provides access to the source Kinesis stream.