Merge pull request #10112 from Ninir/aws_kinesis_firehose_stream_buffer_option
provider/aws: kinesis_firehose_delivery_stream: Fixed ES buffering_interval option
This commit is contained in:
commit
665ca05bf6
|
@ -51,7 +51,7 @@ func resourceAwsKinesisFirehoseDeliveryStream() *schema.Resource {
|
|||
SchemaVersion: 1,
|
||||
MigrateState: resourceAwsKinesisFirehoseMigrateState,
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
"name": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
|
@ -65,7 +65,7 @@ func resourceAwsKinesisFirehoseDeliveryStream() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"destination": &schema.Schema{
|
||||
"destination": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
|
@ -84,82 +84,82 @@ func resourceAwsKinesisFirehoseDeliveryStream() *schema.Resource {
|
|||
},
|
||||
|
||||
// elements removed in v0.7.0
|
||||
"role_arn": &schema.Schema{
|
||||
"role_arn": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Removed: "role_arn has been removed. Use a s3_configuration block instead. See https://terraform.io/docs/providers/aws/r/kinesis_firehose_delivery_stream.html",
|
||||
},
|
||||
|
||||
"s3_bucket_arn": &schema.Schema{
|
||||
"s3_bucket_arn": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Removed: "s3_bucket_arn has been removed. Use a s3_configuration block instead. See https://terraform.io/docs/providers/aws/r/kinesis_firehose_delivery_stream.html",
|
||||
},
|
||||
|
||||
"s3_prefix": &schema.Schema{
|
||||
"s3_prefix": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Removed: "s3_prefix has been removed. Use a s3_configuration block instead. See https://terraform.io/docs/providers/aws/r/kinesis_firehose_delivery_stream.html",
|
||||
},
|
||||
|
||||
"s3_buffer_size": &schema.Schema{
|
||||
"s3_buffer_size": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Removed: "s3_buffer_size has been removed. Use a s3_configuration block instead. See https://terraform.io/docs/providers/aws/r/kinesis_firehose_delivery_stream.html",
|
||||
},
|
||||
|
||||
"s3_buffer_interval": &schema.Schema{
|
||||
"s3_buffer_interval": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Removed: "s3_buffer_interval has been removed. Use a s3_configuration block instead. See https://terraform.io/docs/providers/aws/r/kinesis_firehose_delivery_stream.html",
|
||||
},
|
||||
|
||||
"s3_data_compression": &schema.Schema{
|
||||
"s3_data_compression": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Removed: "s3_data_compression has been removed. Use a s3_configuration block instead. See https://terraform.io/docs/providers/aws/r/kinesis_firehose_delivery_stream.html",
|
||||
},
|
||||
|
||||
"s3_configuration": &schema.Schema{
|
||||
"s3_configuration": {
|
||||
Type: schema.TypeList,
|
||||
Required: true,
|
||||
MaxItems: 1,
|
||||
Elem: &schema.Resource{
|
||||
Schema: map[string]*schema.Schema{
|
||||
"bucket_arn": &schema.Schema{
|
||||
"bucket_arn": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"buffer_size": &schema.Schema{
|
||||
"buffer_size": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Default: 5,
|
||||
},
|
||||
|
||||
"buffer_interval": &schema.Schema{
|
||||
"buffer_interval": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Default: 300,
|
||||
},
|
||||
|
||||
"compression_format": &schema.Schema{
|
||||
"compression_format": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Default: "UNCOMPRESSED",
|
||||
},
|
||||
|
||||
"kms_key_arn": &schema.Schema{
|
||||
"kms_key_arn": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
|
||||
"role_arn": &schema.Schema{
|
||||
"role_arn": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"prefix": &schema.Schema{
|
||||
"prefix": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
|
@ -169,43 +169,43 @@ func resourceAwsKinesisFirehoseDeliveryStream() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"redshift_configuration": &schema.Schema{
|
||||
"redshift_configuration": {
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
MaxItems: 1,
|
||||
Elem: &schema.Resource{
|
||||
Schema: map[string]*schema.Schema{
|
||||
"cluster_jdbcurl": &schema.Schema{
|
||||
"cluster_jdbcurl": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"username": &schema.Schema{
|
||||
"username": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"password": &schema.Schema{
|
||||
"password": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"role_arn": &schema.Schema{
|
||||
"role_arn": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"copy_options": &schema.Schema{
|
||||
"copy_options": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
|
||||
"data_table_columns": &schema.Schema{
|
||||
"data_table_columns": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
|
||||
"data_table_name": &schema.Schema{
|
||||
"data_table_name": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
@ -215,13 +215,13 @@ func resourceAwsKinesisFirehoseDeliveryStream() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"elasticsearch_configuration": &schema.Schema{
|
||||
"elasticsearch_configuration": {
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
MaxItems: 1,
|
||||
Elem: &schema.Resource{
|
||||
Schema: map[string]*schema.Schema{
|
||||
"buffering_interval": &schema.Schema{
|
||||
"buffering_interval": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Default: 300,
|
||||
|
@ -235,7 +235,7 @@ func resourceAwsKinesisFirehoseDeliveryStream() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"buffering_size": &schema.Schema{
|
||||
"buffering_size": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Default: 5,
|
||||
|
@ -249,17 +249,17 @@ func resourceAwsKinesisFirehoseDeliveryStream() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"domain_arn": &schema.Schema{
|
||||
"domain_arn": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"index_name": &schema.Schema{
|
||||
"index_name": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"index_rotation_period": &schema.Schema{
|
||||
"index_rotation_period": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Default: "OneDay",
|
||||
|
@ -273,7 +273,7 @@ func resourceAwsKinesisFirehoseDeliveryStream() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"retry_duration": &schema.Schema{
|
||||
"retry_duration": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Default: 300,
|
||||
|
@ -287,12 +287,12 @@ func resourceAwsKinesisFirehoseDeliveryStream() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"role_arn": &schema.Schema{
|
||||
"role_arn": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"s3_backup_mode": &schema.Schema{
|
||||
"s3_backup_mode": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Default: "FailedDocumentsOnly",
|
||||
|
@ -306,7 +306,7 @@ func resourceAwsKinesisFirehoseDeliveryStream() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"type_name": &schema.Schema{
|
||||
"type_name": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
|
||||
|
@ -324,19 +324,19 @@ func resourceAwsKinesisFirehoseDeliveryStream() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"arn": &schema.Schema{
|
||||
"arn": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"version_id": &schema.Schema{
|
||||
"version_id": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"destination_id": &schema.Schema{
|
||||
"destination_id": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
|
@ -551,7 +551,7 @@ func updateElasticsearchConfig(d *schema.ResourceData, s3Update *firehose.S3Dest
|
|||
func extractBufferingHints(es map[string]interface{}) *firehose.ElasticsearchBufferingHints {
|
||||
bufferingHints := &firehose.ElasticsearchBufferingHints{}
|
||||
|
||||
if bufferingInterval, ok := es["buffering_hints"].(int); ok {
|
||||
if bufferingInterval, ok := es["buffering_interval"].(int); ok {
|
||||
bufferingHints.IntervalInSeconds = aws.Int64(int64(bufferingInterval))
|
||||
}
|
||||
if bufferingSize, ok := es["buffering_size"].(int); ok {
|
||||
|
|
|
@ -25,7 +25,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_s3basic(t *testing.T) {
|
|||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: config,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckKinesisFirehoseDeliveryStreamExists("aws_kinesis_firehose_delivery_stream.test_stream", &stream),
|
||||
|
@ -45,7 +45,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_s3WithCloudwatchLogging(t *testing.
|
|||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccKinesisFirehoseDeliveryStreamConfig_s3WithCloudwatchLogging(os.Getenv("AWS_ACCOUNT_ID"), ri),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckKinesisFirehoseDeliveryStreamExists("aws_kinesis_firehose_delivery_stream.test_stream", &stream),
|
||||
|
@ -77,7 +77,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_s3ConfigUpdates(t *testing.T) {
|
|||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: preConfig,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckKinesisFirehoseDeliveryStreamExists("aws_kinesis_firehose_delivery_stream.test_stream", &stream),
|
||||
|
@ -85,7 +85,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_s3ConfigUpdates(t *testing.T) {
|
|||
),
|
||||
},
|
||||
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: postConfig,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckKinesisFirehoseDeliveryStreamExists("aws_kinesis_firehose_delivery_stream.test_stream", &stream),
|
||||
|
@ -116,7 +116,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_RedshiftConfigUpdates(t *testing.T)
|
|||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: preConfig,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckKinesisFirehoseDeliveryStreamExists("aws_kinesis_firehose_delivery_stream.test_stream", &stream),
|
||||
|
@ -124,7 +124,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_RedshiftConfigUpdates(t *testing.T)
|
|||
),
|
||||
},
|
||||
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: postConfig,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckKinesisFirehoseDeliveryStreamExists("aws_kinesis_firehose_delivery_stream.test_stream", &stream),
|
||||
|
@ -156,14 +156,14 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ElasticsearchConfigUpdates(t *testi
|
|||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: preConfig,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckKinesisFirehoseDeliveryStreamExists("aws_kinesis_firehose_delivery_stream.test_stream_es", &stream),
|
||||
testAccCheckAWSKinesisFirehoseDeliveryStreamAttributes(&stream, nil, nil, nil),
|
||||
),
|
||||
},
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: postConfig,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckKinesisFirehoseDeliveryStreamExists("aws_kinesis_firehose_delivery_stream.test_stream_es", &stream),
|
||||
|
|
Loading…
Reference in New Issue