Skip to content

Commit

Permalink
hashicorp#20068 logdeliveryconfigurations schema
Browse files Browse the repository at this point in the history
  • Loading branch information
nickolivera committed Sep 23, 2021
1 parent 1194e7a commit 5362676
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions aws/elasticache_logdeliveryconfigurations.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package aws

import (
"github.com/aws/aws-sdk-go/service/elasticache"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
)

func getAwsElasticacheLogDeliveryConfigurationsSchema() *schema.Resource {
return &schema.Resource{
Schema: map[string]*schema.Schema{
"destination_details": {
Type: schema.TypeList,
Required: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"cloudwatch_logs": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"log_group": {
Type: schema.TypeString,
Required: true,
},
},
},
ConflictsWith: []string{"log_delivery_configurations.0.destination_details.0.kinesis_firehose"},
},
"kinesis_firehose": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"delivery_stream": {
Type: schema.TypeString,
Required: true,
},
},
},
ConflictsWith: []string{"log_delivery_configurations.0.destination_details.0.cloudwatch_logs"},
},
},
},
},
"destination_type": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice(elasticache.DestinationType_Values(), false),
},
"log_format": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice(elasticache.LogFormat_Values(), false),
},
"log_type": {
Type: schema.TypeString,
Optional: true,
Default: elasticache.LogTypeSlowLog,
ValidateFunc: validation.StringInSlice(elasticache.LogType_Values(), false),
},
"message": {
Type: schema.TypeString,
Computed: true,
},
"status": {
Type: schema.TypeString,
Computed: true,
},
},
}

}

0 comments on commit 5362676

Please sign in to comment.