Skip to content
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

B finspace kx cluster caching #32579

Merged
merged 3 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changelog/32579.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:bug
resource/aws_finspace_kx_cluster: `database.cache_configurations` argument is now optional
```

```release-note:bug
resource/aws_finspace_kx_cluster: `database.cache_configurations.db_paths` argument is now optional
```
4 changes: 2 additions & 2 deletions internal/service/finspace/kx_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func ResourceKxCluster() *schema.Resource {
Schema: map[string]*schema.Schema{
"cache_configurations": {
Type: schema.TypeList,
Required: true,
Optional: true,
ForceNew: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand All @@ -220,7 +220,7 @@ func ResourceKxCluster() *schema.Resource {
Elem: &schema.Schema{
Type: schema.TypeString,
},
Required: true,
Optional: true,
ForceNew: true,
},
},
Expand Down
66 changes: 66 additions & 0 deletions internal/service/finspace/kx_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,36 @@ func TestAccFinSpaceKxCluster_database(t *testing.T) {
})
}

func TestAccFinSpaceKxCluster_cacheConfigurations(t *testing.T) {
if testing.Short() {
t.Skip("skipping long-running test in short mode")
}

ctx := acctest.Context(t)
var kxcluster finspace.GetKxClusterOutput
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_finspace_kx_cluster.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
acctest.PreCheck(ctx, t)
acctest.PreCheckPartitionHasService(t, finspace.ServiceID)
},
ErrorCheck: acctest.ErrorCheck(t, finspace.ServiceID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
CheckDestroy: testAccCheckKxClusterDestroy(ctx),
Steps: []resource.TestStep{
{
Config: testAccKxClusterConfig_cacheConfigurations(rName),
Check: resource.ComposeTestCheckFunc(
testAccCheckKxClusterExists(ctx, resourceName, &kxcluster),
resource.TestCheckResourceAttr(resourceName, "status", string(types.KxClusterStatusRunning)),
),
},
},
})
}

func TestAccFinSpaceKxCluster_code(t *testing.T) {
if testing.Short() {
t.Skip("skipping long-running test in short mode")
Expand Down Expand Up @@ -733,6 +763,42 @@ resource "aws_finspace_kx_database" "test" {
environment_id = aws_finspace_kx_environment.test.id
}

resource "aws_finspace_kx_cluster" "test" {
name = %[1]q
environment_id = aws_finspace_kx_environment.test.id
type = "HDB"
release_label = "1.0"
az_mode = "SINGLE"
availability_zone_id = aws_finspace_kx_environment.test.availability_zones[0]

database {
database_name = aws_finspace_kx_database.test.name
}

capacity_configuration {
node_count = 2
node_type = "kx.s.xlarge"
}

vpc_configuration {
vpc_id = aws_vpc.test.id
security_group_ids = [aws_security_group.test.id]
subnet_ids = [aws_subnet.test.id]
ip_address_type = "IP_V4"
}
}
`, rName))
}

func testAccKxClusterConfig_cacheConfigurations(rName string) string {
return acctest.ConfigCompose(
testAccKxClusterConfigBase(rName),
fmt.Sprintf(`
resource "aws_finspace_kx_database" "test" {
name = %[1]q
environment_id = aws_finspace_kx_environment.test.id
}

resource "aws_finspace_kx_cluster" "test" {
name = %[1]q
environment_id = aws_finspace_kx_environment.test.id
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/finspace_kx_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ The code block supports the following arguments:
The database block supports the following arguments:

* `database_name` - (Required) Name of the KX database.
* `cache_configurations` - (Required) Configuration details for the disk cache to increase performance reading from a KX database mounted to the cluster. See [cache_configurations](#cache_configurations).
* `cache_configurations` - (Optional) Configuration details for the disk cache to increase performance reading from a KX database mounted to the cluster. See [cache_configurations](#cache_configurations).
* `changeset_id` - (Optional) A unique identifier of the changeset that is associated with the cluster.

#### cache_configurations

The cache_configuration block supports the following arguments:

* `cache_type` - (Required) Type of disk cache.
* `db_paths` - (Required) Paths within the database to cache.
* `db_paths` - (Optional) Paths within the database to cache.

### savedown_storage_configuration

Expand Down