-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: wal storage #608
feat: wal storage #608
Changes from all commits
2dde8e2
9241b05
3bae5f6
e5d52f9
617ea1f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,9 @@ package provider | |
import ( | ||
commonApi "github.com/EnterpriseDB/terraform-provider-biganimal/pkg/models/common/api" | ||
commonTerraform "github.com/EnterpriseDB/terraform-provider-biganimal/pkg/models/common/terraform" | ||
"github.com/hashicorp/terraform-plugin-framework/resource/schema" | ||
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" | ||
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" | ||
"github.com/hashicorp/terraform-plugin-framework/types" | ||
"github.com/hashicorp/terraform-plugin-framework/types/basetypes" | ||
) | ||
|
@@ -31,3 +34,35 @@ func buildAPIReqAssignTags(tfRsrcTags []commonTerraform.Tag) []commonApi.Tag { | |
} | ||
return tags | ||
} | ||
|
||
var resourceWal = schema.SingleNestedAttribute{ | ||
Description: "Use a separate storage volume for Write-Ahead Logs (Recommended for high write workloads)", | ||
Optional: true, | ||
Attributes: map[string]schema.Attribute{ | ||
wai-wong-edb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"iops": schema.StringAttribute{ | ||
Description: "IOPS for the selected volume. It can be set to different values depending on your volume type and properties.", | ||
Optional: true, | ||
Computed: true, | ||
PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, | ||
}, | ||
"size": schema.StringAttribute{ | ||
Description: "Size of the volume. It can be set to different values depending on your volume type and properties.", | ||
Required: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. size is actually a mandatory field. In the request if I just put P1 and leave size as nil it will return with this:
however if I put P1 and give a size of 7 Gi I get the error:
I guess a future improvement would be to fetch the list of azurepremiumstorage volume properties and their sizes so size can be optional if they select azurepremiumstorage. But I think we can have that as an enhancement There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. volume_properties: P1 so user need to fill above details, for it to work There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let provide link to volume storage ref in examples |
||
PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, | ||
}, | ||
"throughput": schema.StringAttribute{ | ||
Description: "Throughput is automatically calculated by BigAnimal based on the IOPS input if it's not provided.", | ||
Optional: true, | ||
Computed: true, | ||
PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, | ||
}, | ||
"volume_properties": schema.StringAttribute{ | ||
Description: "Volume properties in accordance with the selected volume type.", | ||
Required: true, | ||
}, | ||
"volume_type": schema.StringAttribute{ | ||
Description: "Volume type. For Azure: \"azurepremiumstorage\" or \"ultradisk\". For AWS: \"gp3\", \"io2\", org s \"io2-block-express\". For Google Cloud: only \"pd-ssd\".", | ||
wai-wong-edb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Required: true, | ||
}, | ||
}, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we handle setting volume properties internally since it does not have properties like az
# volume_type = "azurepremiumstorage"
# volume_properties = "P1"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh for AWS/GCP? Possibly it could work but maybe we can do it in another PR as an enhancement so that they can remove volume_properties for AWS/GCP. As of right now I think I recall in the API(for BA anyways) the volume_properties have to match the volume_type otherwise it will throw an error