Skip to content

Commit

Permalink
Merge pull request #29721 from hashicorp/f-aws_lambda_function-valida…
Browse files Browse the repository at this point in the history
…tion

`r/aws_lambda_function`: Add `memory_size`, `role`, and `timeout` validation
  • Loading branch information
jar-b authored Mar 2, 2023
2 parents 859c562 + 240fff1 commit 0a07124
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .changelog/29721.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_lambda_function: Add plan time validators for `memory_size`, `role`, and `timeout`
```
19 changes: 11 additions & 8 deletions internal/service/lambda/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,10 @@ func ResourceFunction() *schema.Resource {
},
},
"memory_size": {
Type: schema.TypeInt,
Optional: true,
Default: 128,
Type: schema.TypeInt,
Optional: true,
Default: 128,
ValidateFunc: validation.IntBetween(128, 10240),
},
"package_type": {
Type: schema.TypeString,
Expand Down Expand Up @@ -260,8 +261,9 @@ func ResourceFunction() *schema.Resource {
ValidateFunc: validation.IntAtLeast(-1),
},
"role": {
Type: schema.TypeString,
Required: true,
Type: schema.TypeString,
Required: true,
ValidateFunc: verify.ValidARN,
},
"runtime": {
Type: schema.TypeString,
Expand Down Expand Up @@ -327,9 +329,10 @@ func ResourceFunction() *schema.Resource {
"tags": tftags.TagsSchema(),
"tags_all": tftags.TagsSchemaComputed(),
"timeout": {
Type: schema.TypeInt,
Optional: true,
Default: 3,
Type: schema.TypeInt,
Optional: true,
Default: 3,
ValidateFunc: validation.IntBetween(1, 900),
},
"tracing_config": {
Type: schema.TypeList,
Expand Down

0 comments on commit 0a07124

Please sign in to comment.