Skip to content

Commit

Permalink
Removed redundant type declarations in composite literals
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninir committed Nov 2, 2016
1 parent 2a96947 commit baed1c6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
42 changes: 21 additions & 21 deletions builtin/providers/aws/resource_aws_lambda_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,108 +32,108 @@ func resourceAwsLambdaFunction() *schema.Resource {
},

Schema: map[string]*schema.Schema{
"filename": &schema.Schema{
"filename": {
Type: schema.TypeString,
Optional: true,
ConflictsWith: []string{"s3_bucket", "s3_key", "s3_object_version"},
},
"s3_bucket": &schema.Schema{
"s3_bucket": {
Type: schema.TypeString,
Optional: true,
ConflictsWith: []string{"filename"},
},
"s3_key": &schema.Schema{
"s3_key": {
Type: schema.TypeString,
Optional: true,
ConflictsWith: []string{"filename"},
},
"s3_object_version": &schema.Schema{
"s3_object_version": {
Type: schema.TypeString,
Optional: true,
ConflictsWith: []string{"filename"},
},
"description": &schema.Schema{
"description": {
Type: schema.TypeString,
Optional: true,
},
"function_name": &schema.Schema{
"function_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"handler": &schema.Schema{
"handler": {
Type: schema.TypeString,
Required: true,
},
"memory_size": &schema.Schema{
"memory_size": {
Type: schema.TypeInt,
Optional: true,
Default: 128,
},
"role": &schema.Schema{
"role": {
Type: schema.TypeString,
Required: true,
},
"runtime": &schema.Schema{
"runtime": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validateRuntime,
},
"timeout": &schema.Schema{
"timeout": {
Type: schema.TypeInt,
Optional: true,
Default: 3,
},
"publish": &schema.Schema{
"publish": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},
"version": &schema.Schema{
"version": {
Type: schema.TypeString,
Computed: true,
},
"vpc_config": &schema.Schema{
"vpc_config": {
Type: schema.TypeList,
Optional: true,
ForceNew: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"subnet_ids": &schema.Schema{
"subnet_ids": {
Type: schema.TypeSet,
Required: true,
ForceNew: true,
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
},
"security_group_ids": &schema.Schema{
"security_group_ids": {
Type: schema.TypeSet,
Required: true,
ForceNew: true,
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
},
"vpc_id": &schema.Schema{
"vpc_id": {
Type: schema.TypeString,
Computed: true,
},
},
},
},
"arn": &schema.Schema{
"arn": {
Type: schema.TypeString,
Computed: true,
},
"qualified_arn": &schema.Schema{
"qualified_arn": {
Type: schema.TypeString,
Computed: true,
},
"last_modified": &schema.Schema{
"last_modified": {
Type: schema.TypeString,
Computed: true,
},
"source_code_hash": &schema.Schema{
"source_code_hash": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Expand Down
26 changes: 13 additions & 13 deletions builtin/providers/aws/resource_aws_lambda_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestAccAWSLambdaFunction_basic(t *testing.T) {
Providers: testAccProviders,
CheckDestroy: testAccCheckLambdaFunctionDestroy,
Steps: []resource.TestStep{
resource.TestStep{
{
Config: testAccAWSLambdaConfigBasic(rName),
Check: resource.ComposeTestCheckFunc(
testAccCheckAwsLambdaFunctionExists("aws_lambda_function.lambda_function_test", rName, &conf),
Expand All @@ -49,7 +49,7 @@ func TestAccAWSLambdaFunction_versioned(t *testing.T) {
Providers: testAccProviders,
CheckDestroy: testAccCheckLambdaFunctionDestroy,
Steps: []resource.TestStep{
resource.TestStep{
{
Config: testAccAWSLambdaConfigVersioned(rName),
Check: resource.ComposeTestCheckFunc(
testAccCheckAwsLambdaFunctionExists("aws_lambda_function.lambda_function_test", rName, &conf),
Expand All @@ -74,7 +74,7 @@ func TestAccAWSLambdaFunction_VPC(t *testing.T) {
Providers: testAccProviders,
CheckDestroy: testAccCheckLambdaFunctionDestroy,
Steps: []resource.TestStep{
resource.TestStep{
{
Config: testAccAWSLambdaConfigWithVPC(rName),
Check: resource.ComposeTestCheckFunc(
testAccCheckAwsLambdaFunctionExists("aws_lambda_function.lambda_function_test", rName, &conf),
Expand All @@ -100,7 +100,7 @@ func TestAccAWSLambdaFunction_s3(t *testing.T) {
Providers: testAccProviders,
CheckDestroy: testAccCheckLambdaFunctionDestroy,
Steps: []resource.TestStep{
resource.TestStep{
{
Config: testAccAWSLambdaConfigS3(rName),
Check: resource.ComposeTestCheckFunc(
testAccCheckAwsLambdaFunctionExists("aws_lambda_function.lambda_function_s3test", rName, &conf),
Expand All @@ -127,7 +127,7 @@ func TestAccAWSLambdaFunction_localUpdate(t *testing.T) {
Providers: testAccProviders,
CheckDestroy: testAccCheckLambdaFunctionDestroy,
Steps: []resource.TestStep{
resource.TestStep{
{
PreConfig: func() {
testAccCreateZipFromFiles(map[string]string{"test-fixtures/lambda_func.js": "lambda.js"}, zipFile)
},
Expand All @@ -139,7 +139,7 @@ func TestAccAWSLambdaFunction_localUpdate(t *testing.T) {
testAccCheckAwsLambdaSourceCodeHash(&conf, "8DPiX+G1l2LQ8hjBkwRchQFf1TSCEvPrYGRKlM9UoyY="),
),
},
resource.TestStep{
{
PreConfig: func() {
testAccCreateZipFromFiles(map[string]string{"test-fixtures/lambda_func_modified.js": "lambda.js"}, zipFile)
},
Expand Down Expand Up @@ -175,7 +175,7 @@ func TestAccAWSLambdaFunction_localUpdate_nameOnly(t *testing.T) {
Providers: testAccProviders,
CheckDestroy: testAccCheckLambdaFunctionDestroy,
Steps: []resource.TestStep{
resource.TestStep{
{
PreConfig: func() {
testAccCreateZipFromFiles(map[string]string{"test-fixtures/lambda_func.js": "lambda.js"}, zipFile)
},
Expand All @@ -187,7 +187,7 @@ func TestAccAWSLambdaFunction_localUpdate_nameOnly(t *testing.T) {
testAccCheckAwsLambdaSourceCodeHash(&conf, "8DPiX+G1l2LQ8hjBkwRchQFf1TSCEvPrYGRKlM9UoyY="),
),
},
resource.TestStep{
{
PreConfig: func() {
testAccCreateZipFromFiles(map[string]string{"test-fixtures/lambda_func_modified.js": "lambda.js"}, updatedZipFile)
},
Expand Down Expand Up @@ -220,7 +220,7 @@ func TestAccAWSLambdaFunction_s3Update(t *testing.T) {
Providers: testAccProviders,
CheckDestroy: testAccCheckLambdaFunctionDestroy,
Steps: []resource.TestStep{
resource.TestStep{
{
PreConfig: func() {
// Upload 1st version
testAccCreateZipFromFiles(map[string]string{"test-fixtures/lambda_func.js": "lambda.js"}, zipFile)
Expand All @@ -233,7 +233,7 @@ func TestAccAWSLambdaFunction_s3Update(t *testing.T) {
testAccCheckAwsLambdaSourceCodeHash(&conf, "8DPiX+G1l2LQ8hjBkwRchQFf1TSCEvPrYGRKlM9UoyY="),
),
},
resource.TestStep{
{
ExpectNonEmptyPlan: true,
PreConfig: func() {
// Upload 2nd version
Expand All @@ -243,7 +243,7 @@ func TestAccAWSLambdaFunction_s3Update(t *testing.T) {
},
// Extra step because of missing ComputedWhen
// See https://github.com/hashicorp/terraform/pull/4846 & https://github.com/hashicorp/terraform/pull/5330
resource.TestStep{
{
Config: genAWSLambdaFunctionConfig_s3(bucketName, key, path),
Check: resource.ComposeTestCheckFunc(
testAccCheckAwsLambdaFunctionExists("aws_lambda_function.lambda_function_s3", "tf_acc_lambda_name_s3", &conf),
Expand Down Expand Up @@ -274,7 +274,7 @@ func TestAccAWSLambdaFunction_s3Update_unversioned(t *testing.T) {
Providers: testAccProviders,
CheckDestroy: testAccCheckLambdaFunctionDestroy,
Steps: []resource.TestStep{
resource.TestStep{
{
PreConfig: func() {
// Upload 1st version
testAccCreateZipFromFiles(map[string]string{"test-fixtures/lambda_func.js": "lambda.js"}, zipFile)
Expand All @@ -287,7 +287,7 @@ func TestAccAWSLambdaFunction_s3Update_unversioned(t *testing.T) {
testAccCheckAwsLambdaSourceCodeHash(&conf, "8DPiX+G1l2LQ8hjBkwRchQFf1TSCEvPrYGRKlM9UoyY="),
),
},
resource.TestStep{
{
PreConfig: func() {
// Upload 2nd version
testAccCreateZipFromFiles(map[string]string{"test-fixtures/lambda_func_modified.js": "lambda.js"}, zipFile)
Expand Down

0 comments on commit baed1c6

Please sign in to comment.