diff --git a/aws/data_source_aws_lambda_invocation.go b/aws/data_source_aws_lambda_invocation.go index 442f5a25918..188359c3502 100644 --- a/aws/data_source_aws_lambda_invocation.go +++ b/aws/data_source_aws_lambda_invocation.go @@ -2,9 +2,7 @@ package aws import ( "crypto/md5" - "encoding/json" "fmt" - "log" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lambda" @@ -38,15 +36,6 @@ func dataSourceAwsLambdaInvocation() *schema.Resource { Type: schema.TypeString, Computed: true, }, - - "result_map": { - Type: schema.TypeMap, - Computed: true, - Deprecated: "use `result` attribute with jsondecode() function", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, }, } } @@ -77,16 +66,6 @@ func dataSourceAwsLambdaInvocationRead(d *schema.ResourceData, meta interface{}) return err } - var result map[string]interface{} - - if err = json.Unmarshal(res.Payload, &result); err != nil { - return err - } - - if err = d.Set("result_map", result); err != nil { - log.Printf("[WARN] Cannot use the result invocation as a string map: %s", err) - } - d.SetId(fmt.Sprintf("%s_%s_%x", functionName, qualifier, md5.Sum(input))) return nil diff --git a/aws/data_source_aws_lambda_invocation_test.go b/aws/data_source_aws_lambda_invocation_test.go index d8f8165bcb4..6cc1d635928 100644 --- a/aws/data_source_aws_lambda_invocation_test.go +++ b/aws/data_source_aws_lambda_invocation_test.go @@ -45,10 +45,6 @@ func TestAccDataSourceAwsLambdaInvocation_basic(t *testing.T) { { Config: testAccDataSourceAwsLambdaInvocation_basic_config(rName, testData), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_lambda_invocation.invocation_test", "result_map.%", "3"), - resource.TestCheckResourceAttr("data.aws_lambda_invocation.invocation_test", "result_map.key1", "value1"), - resource.TestCheckResourceAttr("data.aws_lambda_invocation.invocation_test", "result_map.key2", "value2"), - resource.TestCheckResourceAttr("data.aws_lambda_invocation.invocation_test", "result_map.key3", testData), testAccCheckLambdaInvocationResult("data.aws_lambda_invocation.invocation_test", `{"key1":"value1","key2":"value2","key3":"`+testData+`"}`), ), }, @@ -67,10 +63,7 @@ func TestAccDataSourceAwsLambdaInvocation_qualifier(t *testing.T) { { Config: testAccDataSourceAwsLambdaInvocation_qualifier_config(rName, testData), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_lambda_invocation.invocation_test", "result_map.%", "3"), - resource.TestCheckResourceAttr("data.aws_lambda_invocation.invocation_test", "result_map.key1", "value1"), - resource.TestCheckResourceAttr("data.aws_lambda_invocation.invocation_test", "result_map.key2", "value2"), - resource.TestCheckResourceAttr("data.aws_lambda_invocation.invocation_test", "result_map.key3", testData), + testAccCheckLambdaInvocationResult("data.aws_lambda_invocation.invocation_test", `{"key1":"value1","key2":"value2","key3":"`+testData+`"}`), ), }, }, @@ -88,7 +81,6 @@ func TestAccDataSourceAwsLambdaInvocation_complex(t *testing.T) { { Config: testAccDataSourceAwsLambdaInvocation_complex_config(rName, testData), Check: resource.ComposeTestCheckFunc( - resource.TestCheckNoResourceAttr("data.aws_lambda_invocation.invocation_test", "result_map"), testAccCheckLambdaInvocationResult("data.aws_lambda_invocation.invocation_test", `{"key1":{"subkey1":"subvalue1"},"key2":{"subkey2":"subvalue2","subkey3":{"a": "b"}},"key3":"`+testData+`"}`), ), }, diff --git a/aws/data_source_aws_lb.go b/aws/data_source_aws_lb.go index 6f5b35b448a..f4e50c734f6 100644 --- a/aws/data_source_aws_lb.go +++ b/aws/data_source_aws_lb.go @@ -97,6 +97,11 @@ func dataSourceAwsLb() *schema.Resource { Computed: true, }, + "enable_http2": { + Type: schema.TypeBool, + Computed: true, + }, + "idle_timeout": { Type: schema.TypeInt, Computed: true, diff --git a/aws/resource_aws_api_gateway_resource.go b/aws/resource_aws_api_gateway_resource.go index e6961e9949a..c44b09e0f53 100644 --- a/aws/resource_aws_api_gateway_resource.go +++ b/aws/resource_aws_api_gateway_resource.go @@ -25,7 +25,6 @@ func resourceAwsApiGatewayResource() *schema.Resource { } restApiID := idParts[0] resourceID := idParts[1] - d.Set("request_validator_id", resourceID) d.Set("rest_api_id", restApiID) d.SetId(resourceID) return []*schema.ResourceData{d}, nil diff --git a/aws/resource_aws_elasticsearch_domain.go b/aws/resource_aws_elasticsearch_domain.go index 18b2a5dffcf..87ab5ec71e4 100644 --- a/aws/resource_aws_elasticsearch_domain.go +++ b/aws/resource_aws_elasticsearch_domain.go @@ -713,8 +713,14 @@ func resourceAwsElasticSearchDomainRead(d *schema.ResourceData, meta interface{} // because DescribeElasticsearchDomainConfig does not return MasterUserOptions if ds.AdvancedSecurityOptions != nil { if _, ok := d.GetOk("advanced_security_options"); ok { - d.Set("advanced_security_options.0.enabled", ds.AdvancedSecurityOptions.Enabled) - d.Set("advanced_security_options.0.internal_user_database_enabled", ds.AdvancedSecurityOptions.InternalUserDatabaseEnabled) + if err := d.Set("advanced_security_options", []interface{}{ + map[string]interface{}{ + "enabled": ds.AdvancedSecurityOptions.Enabled, + "internal_user_database_enabled": ds.AdvancedSecurityOptions.InternalUserDatabaseEnabled, + }, + }); err != nil { + return fmt.Errorf("error setting advanced_security_options: %w", err) + } } else { if err := d.Set("advanced_security_options", flattenAdvancedSecurityOptions(ds.AdvancedSecurityOptions)); err != nil { return fmt.Errorf("error setting advanced_security_options: %w", err)