Skip to content

Commit

Permalink
Add ephemeral_storage attribute to Lambda function scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
bschaatsbergen committed Mar 24, 2022
1 parent 638b465 commit b54fe1b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions internal/service/lambda/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,24 @@ func ResourceFunction() *schema.Resource {
Optional: true,
ValidateFunc: validation.StringInSlice(lambda.Runtime_Values(), false),
},
"ephemeral_storage": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"size": {
Type: schema.TypeInt,
Required: true,
Default: 512,
ValidateFunc: validation.All(
validation.IntBetween(512, 10240),
),
},
},
},
},
"timeout": {
Type: schema.TypeInt,
Optional: true,
Expand Down Expand Up @@ -378,6 +396,7 @@ func hasConfigChanges(d verify.ResourceDiffer) bool {
d.HasChange("layers") ||
d.HasChange("dead_letter_config") ||
d.HasChange("tracing_config") ||
d.HasChange("ephemeral_storage") ||
d.HasChange("vpc_config.0.security_group_ids") ||
d.HasChange("vpc_config.0.subnet_ids") ||
d.HasChange("runtime") ||
Expand Down Expand Up @@ -506,6 +525,14 @@ func resourceFunctionCreate(d *schema.ResourceData, meta interface{}) error {
}
}

// if v, ok := d.GetOk("ephemeral_storage"); ok {
// ephemeralStorageConfig := v.([]interface{})
// ephemeralStorage := ephemeralStorageConfig[0].(map[string]interface{})
// params.EphemeralStorage = &lambda.EphemeralStorage{
// Size: aws.Int64(int64(ephemeralStorage["size"].(int))),
// }
// }

if v, ok := d.GetOk("environment"); ok {
environments := v.([]interface{})
environment, ok := environments[0].(map[string]interface{})
Expand Down

0 comments on commit b54fe1b

Please sign in to comment.