Skip to content

Commit

Permalink
Merge branch 'main' into feat-mssql-storage-type-extra-#185149472
Browse files Browse the repository at this point in the history
  • Loading branch information
fnaranjo-vmw committed Aug 9, 2023
2 parents 2555943 + f5af30a commit 830260d
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export GSB_SERVICE_CSB_AWS_AURORA_POSTGRESQL_PLANS='[{"name":"default","id":"d20
export GSB_SERVICE_CSB_AWS_AURORA_MYSQL_PLANS='[{"name":"default","id":"10b2bd92-2a0b-11ed-b70f-c7c5cf3bb719","description":"Default Aurora MySQL plan","display_name":"default"}]'
export GSB_SERVICE_CSB_AWS_MYSQL_PLANS='[{"name":"default","id":"0f3522b2-f040-443b-bc53-4aed25284840","description":"Default MySQL plan","display_name":"default","instance_class":"db.m6i.large","mysql_version":"8.0","storage_gb":100}]'
export GSB_SERVICE_CSB_AWS_REDIS_PLANS='[{"name":"default", "id":"c7f64994-a1d9-4e1f-9491-9d8e56bbf146","description":"Default Redis plan","display_name":"default","node_type":"cache.t3.medium","redis_version": "6.0"},{"name" : "example-with-flexible-node-type","id" : "2deb6c13-7ea1-4bad-a519-0ac9600e9a29","description" : "An example of a Redis plan for which node_type can be specified at provision time. Replace with your own plan configuration.","redis_version" : "6.x","node_count" : 2}]'
export GSB_SERVICE_CSB_AWS_MSSQL_PLANS='[{"name":"default","id":"7400cd8f-5f98-4457-8de0-03232ec12f62","description":"Default MSSQL plan","display_name":"default","engine":"sqlserver-ex","mssql_version":"15.00.4236.7.v1","storage_gb":20, "instance_class":"db.t3.small" }]'
export GSB_SERVICE_CSB_AWS_MSSQL_PLANS='[{"name":"default","id":"7400cd8f-5f98-4457-8de0-03232ec12f62","description":"Default MSSQL plan","display_name":"default","engine":"sqlserver-se","mssql_version":"15.00.4236.7.v1","storage_gb":20, "instance_class":"db.t3.xlarge" }]'
export GSB_BROKERPAK_CONFIG='{"global_labels":[{"key": "key1", "value": "value1"},{"key": "key2", "value": "value2"}]}'
2 changes: 1 addition & 1 deletion .github/workflows/run-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.20.7'
go-version: '1.21.0'
- uses: actions/checkout@v3
- run: make test
call-dependabot-pr-workflow:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ help: ## list Makefile targets

###### Setup ##################################################################
IAAS=aws
GO-VERSION = 1.20.7
GO-VERSION = 1.21.0
GO-VER = go$(GO-VERSION)
CSB_VERSION := $(or $(CSB_VERSION), $(shell grep 'github.com/cloudfoundry/cloud-service-broker' go.mod | grep -v replace | awk '{print $$NF}' | sed -e 's/v//'))
CSB_RELEASE_VERSION := $(CSB_VERSION) # this doesnt work well if we did make latest-csb.
Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/apps/dynamodbnsapp/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module dynamodbnsapp

go 1.20
go 1.21

require (
github.com/aws/aws-sdk-go-v2 v1.20.0
Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/apps/dynamodbtableapp/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module dynamodbtableapp

go 1.20
go 1.21

require (
github.com/aws/aws-sdk-go-v2 v1.20.0
Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/apps/mysqlapp/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module mysqlapp

go 1.20
go 1.21

require (
github.com/cloudfoundry-community/go-cfenv v1.18.0
Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/apps/postgresqlapp/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module postgresqlapp

go 1.20
go 1.21

require (
github.com/cloudfoundry-community/go-cfenv v1.18.0
Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/apps/redisapp/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module redisapp

go 1.20
go 1.21

require (
github.com/cloudfoundry-community/go-cfenv v1.18.0
Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/apps/s3app/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module s3app

go 1.20
go 1.21

require (
github.com/aws/aws-sdk-go-v2 v1.20.0
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module csbbrokerpakaws

go 1.20
go 1.21

require (
code.cloudfoundry.org/jsonry v1.1.4
Expand Down
2 changes: 1 addition & 1 deletion providers/terraform-provider-csbdynamodbns/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.DEFAULT_GOAL = help

GO-VERSION = 1.20.7
GO-VERSION = 1.21.0
GO-VER = go$(GO-VERSION)
GO_OK := $(or $(USE_GO_CONTAINERS), $(shell which go 1>/dev/null 2>/dev/null; echo $$?))
DOCKER_OK := $(shell which docker 1>/dev/null 2>/dev/null; echo $$?)
Expand Down
2 changes: 1 addition & 1 deletion providers/terraform-provider-csbdynamodbns/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/cloudfoundry/csb-brokerpak-aws/terraform-provider-dynamodbns

go 1.20
go 1.21

require (
github.com/aws/aws-sdk-go-v2 v1.17.7
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.DEFAULT_GOAL = help

GO-VERSION = 1.20.7
GO-VERSION = 1.21.0
GO-VER = go$(GO-VERSION)
GO_OK := $(or $(USE_GO_CONTAINERS), $(shell which go 1>/dev/null 2>/dev/null; echo $$?))
DOCKER_OK := $(shell which docker 1>/dev/null 2>/dev/null; echo $$?)
Expand Down
2 changes: 1 addition & 1 deletion providers/terraform-provider-csbmajorengineversion/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/cloudfoundry/csb-brokerpak-aws/terraform-provider-majorengineversion

go 1.20
go 1.21

require (
github.com/aws/aws-sdk-go-v2 v1.18.1
Expand Down
22 changes: 21 additions & 1 deletion terraform-tests/mssql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ var _ = Describe("mssql", Label("mssql-terraform"), Ordered, func() {
"engine_version": Equal("some-engine-version"),
"identifier": Equal("csb-mssql-test"),
"storage_encrypted": BeTrue(),
"kms_key_id": Equal(""),
"instance_class": Equal(""),
"tags": HaveKeyWithValue("label1", "value1"),
"db_subnet_group_name": Equal("csb-mssql-test-p-sn"),
Expand Down Expand Up @@ -329,5 +328,26 @@ var _ = Describe("mssql", Label("mssql-terraform"), Ordered, func() {
}))
})
})

Context("sqlserver validations", func() {
DescribeTable("sqlserver-ex is the only edition without encryption support",
func(extraProps map[string]any, expectedError string) {
if expectedError == "" {
plan = ShowPlan(terraformProvisionDir, buildVars(defaultVars, requiredVars, extraProps))
} else {
session, _ := FailPlan(terraformProvisionDir, buildVars(defaultVars, requiredVars, extraProps))
Expect(session.ExitCode()).NotTo(Equal(0))
Expect(session).To(gbytes.Say(expectedError))
}
},
Entry("sqlserver-ex & encryption", map[string]any{"engine": "sqlserver-ex", "storage_encrypted": true}, "sqlserver-ex does not support encryption"),
Entry("sqlserver-se & encryption", map[string]any{"engine": "sqlserver-se", "storage_encrypted": true}, ""),
Entry("sqlserver-ee & encryption", map[string]any{"engine": "sqlserver-ee", "storage_encrypted": true}, ""),
Entry("sqlserver-web & encryption", map[string]any{"engine": "sqlserver-web", "storage_encrypted": true}, ""),
Entry("sqlserver-ex ! encryption", map[string]any{"engine": "sqlserver-ex", "storage_encrypted": false}, ""),
Entry("sqlserver-se ! encryption", map[string]any{"engine": "sqlserver-se", "storage_encrypted": false}, ""),
Entry("sqlserver-ee ! encryption", map[string]any{"engine": "sqlserver-ee", "storage_encrypted": false}, ""),
Entry("sqlserver-web ! encryption", map[string]any{"engine": "sqlserver-web", "storage_encrypted": false}, ""),
)
})
})

Check failure on line 353 in terraform-tests/mssql_test.go

View workflow job for this annotation

GitHub Actions / Go test

expected ')', found 'EOF'

Check failure on line 353 in terraform-tests/mssql_test.go

View workflow job for this annotation

GitHub Actions / Go test

expected ';', found 'EOF'

Check failure on line 353 in terraform-tests/mssql_test.go

View workflow job for this annotation

GitHub Actions / Go test

expected '}', found 'EOF'

Check failure on line 353 in terraform-tests/mssql_test.go

View workflow job for this annotation

GitHub Actions / Go test

missing ',' in argument list

Check failure on line 353 in terraform-tests/mssql_test.go

View workflow job for this annotation

GitHub Actions / Go test

expected '}', found 'EOF'

Check failure on line 353 in terraform-tests/mssql_test.go

View workflow job for this annotation

GitHub Actions / Go test

expected '}', found 'EOF'
10 changes: 10 additions & 0 deletions terraform/mssql/provision/validations.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@ resource "terraform_data" "kms_key_was_provided" {
}
}

resource "terraform_data" "mssql-express-encryption" {
count = var.engine == "sqlserver-ex" ? 1 : 0

lifecycle {
precondition {
condition = var.storage_encrypted == false
error_message = "sqlserver-ex does not support encryption at rest"
}
}
}

0 comments on commit 830260d

Please sign in to comment.