Skip to content

Commit 5ae8e99

Browse files
feat: Add ssl_mode option to google_sql_database_instance. (#9367) (#16394)
* feat: Add ssl_mode option to google_sql_database_instance. * Put the github.com/google/go-cmp v0.5.9 back to the go.sum. Deleted it in previous commit by mistake. * Update go.mod.erb and go.sum since the commit 6aa307c reverts the commit f3db9dd. [upstream:3f433e1c3724481aa3e1649520cab5de33ee6157] Signed-off-by: Modular Magician <[email protected]>
1 parent dbfd1cb commit 5ae8e99

File tree

6 files changed

+127
-36
lines changed

6 files changed

+127
-36
lines changed

.changelog/9367.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
sql: added `ssl_mode` field to `google_sql_database_instance` resource
3+
```

go.mod

+12-12
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@ require (
2323
github.com/mitchellh/go-homedir v1.1.0
2424
github.com/mitchellh/hashstructure v1.1.0
2525
github.com/sirupsen/logrus v1.8.1
26-
golang.org/x/net v0.16.0
26+
golang.org/x/net v0.17.0
2727
golang.org/x/oauth2 v0.13.0
28-
google.golang.org/api v0.143.0
29-
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13
30-
google.golang.org/grpc v1.57.0
28+
google.golang.org/api v0.148.0
29+
google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a
30+
google.golang.org/grpc v1.58.3
3131
google.golang.org/protobuf v1.31.0
3232
)
3333

3434
require (
3535
bitbucket.org/creachadair/stringset v0.0.8 // indirect
36-
cloud.google.com/go v0.110.7 // indirect
36+
cloud.google.com/go v0.110.8 // indirect
3737
cloud.google.com/go/compute v1.23.0 // indirect
3838
cloud.google.com/go/compute/metadata v0.2.3 // indirect
39-
cloud.google.com/go/iam v1.1.1 // indirect
39+
cloud.google.com/go/iam v1.1.2 // indirect
4040
cloud.google.com/go/longrunning v0.5.1 // indirect
4141
github.com/agext/levenshtein v1.2.2 // indirect
4242
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
@@ -45,14 +45,14 @@ require (
4545
github.com/cespare/xxhash/v2 v2.2.0 // indirect
4646
github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe // indirect
4747
github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 // indirect
48-
github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f // indirect
49-
github.com/envoyproxy/protoc-gen-validate v0.10.1 // indirect
48+
github.com/envoyproxy/go-control-plane v0.11.1 // indirect
49+
github.com/envoyproxy/protoc-gen-validate v1.0.2 // indirect
5050
github.com/fatih/color v1.13.0 // indirect
5151
github.com/gammazero/deque v0.0.0-20180920172122-f6adf94963e4 // indirect
5252
github.com/golang/glog v1.1.0 // indirect
5353
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
5454
github.com/golang/protobuf v1.5.3 // indirect
55-
github.com/google/go-cmp v0.5.9 // indirect
55+
github.com/google/go-cmp v0.6.0 // indirect
5656
github.com/google/go-cpy v0.0.0-20211218193943-a9c933c06932 // indirect
5757
github.com/google/s2a-go v0.1.7 // indirect
5858
github.com/google/uuid v1.3.1 // indirect
@@ -85,12 +85,12 @@ require (
8585
github.com/zclconf/go-cty v1.11.0 // indirect
8686
go.opencensus.io v0.24.0 // indirect
8787
golang.org/x/crypto v0.14.0 // indirect
88-
golang.org/x/sync v0.3.0 // indirect
88+
golang.org/x/sync v0.4.0 // indirect
8989
golang.org/x/sys v0.13.0 // indirect
9090
golang.org/x/text v0.13.0 // indirect
9191
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
9292
google.golang.org/appengine v1.6.7 // indirect
93-
google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect
94-
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb // indirect
93+
google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect
94+
google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect
9595
gopkg.in/yaml.v2 v2.4.0 // indirect
9696
)

go.sum

+24-23
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ bitbucket.org/creachadair/stringset v0.0.8 h1:gQqe4vs8XWgMyijfyKE6K8o4TcyGGrRXe0
22
bitbucket.org/creachadair/stringset v0.0.8/go.mod h1:AgthVMyMxC/6FK1KBJ2ALdqkZObGN8hOetgpwXyMn34=
33
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
44
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
5-
cloud.google.com/go v0.110.7 h1:rJyC7nWRg2jWGZ4wSJ5nY65GTdYJkg0cd/uXb+ACI6o=
6-
cloud.google.com/go v0.110.7/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI=
5+
cloud.google.com/go v0.110.8 h1:tyNdfIxjzaWctIiLYOTalaLKZ17SI44SKFW26QbOhME=
6+
cloud.google.com/go v0.110.8/go.mod h1:Iz8AkXJf1qmxC3Oxoep8R1T36w8B92yU29PcBhHO5fk=
77
cloud.google.com/go/bigtable v1.19.0 h1:wiq9LT0kukfInzvy1joMDijCw/OD1UChpSbORXYn0LI=
88
cloud.google.com/go/bigtable v1.19.0/go.mod h1:xl5kPa8PTkJjdBxg6qdGH88464nNqmbISHSRU+D2yFE=
99
cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY=
1010
cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM=
1111
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
1212
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
13-
cloud.google.com/go/iam v1.1.1 h1:lW7fzj15aVIXYHREOqjRBV9PsH0Z6u8Y46a1YGvQP4Y=
14-
cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU=
13+
cloud.google.com/go/iam v1.1.2 h1:gacbrBdWcoVmGLozRuStX45YKvJtzIjJdAolzUs1sm4=
14+
cloud.google.com/go/iam v1.1.2/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU=
1515
cloud.google.com/go/longrunning v0.5.1 h1:Fr7TXftcqTudoyRJa113hyaqlGdiBQkp0Gq7tErFDWI=
1616
cloud.google.com/go/longrunning v0.5.1/go.mod h1:spvimkwdz6SPWKEt/XBij79E9fiTkHSQl/fRUUQJYJc=
1717
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
@@ -61,11 +61,11 @@ github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3
6161
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
6262
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
6363
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
64-
github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f h1:7T++XKzy4xg7PKy+bM+Sa9/oe1OC88yz2hXQUISoXfA=
65-
github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f/go.mod h1:sfYdkwUW4BA3PbKjySwjJy+O4Pu0h62rlqCMHNk+K+Q=
64+
github.com/envoyproxy/go-control-plane v0.11.1 h1:wSUXTlLfiAQRWs2F+p+EKOY9rUyis1MyGqJ2DIk5HpM=
65+
github.com/envoyproxy/go-control-plane v0.11.1/go.mod h1:uhMcXKCQMEJHiAb0w+YGefQLaTEw+YhGluxZkrTmD0g=
6666
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
67-
github.com/envoyproxy/protoc-gen-validate v0.10.1 h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8=
68-
github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss=
67+
github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA=
68+
github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE=
6969
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
7070
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
7171
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
@@ -120,8 +120,9 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
120120
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
121121
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
122122
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
123-
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
124123
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
124+
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
125+
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
125126
github.com/google/go-cpy v0.0.0-20211218193943-a9c933c06932 h1:5/4TSDzpDnHQ8rKEEQBjRlYx77mHOvXu08oGchxej7o=
126127
github.com/google/go-cpy v0.0.0-20211218193943-a9c933c06932/go.mod h1:cC6EdPbj/17GFCPDK39NRarlMI+kt+O60S12cNB5J9Y=
127128
github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
@@ -313,8 +314,8 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY
313314
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
314315
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
315316
golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k=
316-
golang.org/x/net v0.16.0 h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos=
317-
golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
317+
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
318+
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
318319
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
319320
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
320321
golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY=
@@ -325,8 +326,8 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ
325326
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
326327
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
327328
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
328-
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
329-
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
329+
golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
330+
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
330331
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
331332
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
332333
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -371,8 +372,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
371372
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
372373
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
373374
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
374-
google.golang.org/api v0.143.0 h1:o8cekTkqhywkbZT6p1UHJPZ9+9uuCAJs/KYomxZB8fA=
375-
google.golang.org/api v0.143.0/go.mod h1:FoX9DO9hT7DLNn97OuoZAGSDuNAXdJRuGK98rSUgurk=
375+
google.golang.org/api v0.148.0 h1:HBq4TZlN4/1pNcu0geJZ/Q50vIwIXT532UIMYoo0vOs=
376+
google.golang.org/api v0.148.0/go.mod h1:8/TBgwaKjfqTdacOJrOv2+2Q6fBDU1uHKK06oGSkxzU=
376377
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
377378
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
378379
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
@@ -382,20 +383,20 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA
382383
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
383384
google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
384385
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
385-
google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb h1:XFBgcDwm7irdHTbz4Zk2h7Mh+eis4nfJEFQFYzJzuIA=
386-
google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4=
387-
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb h1:lK0oleSc7IQsUxO3U5TjL9DWlsxpEBemh+zpB7IqhWI=
388-
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk=
389-
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 h1:N3bU/SQDCDyD6R528GJ/PwW9KjYcJA3dgyH+MovAkIM=
390-
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:KSqppvjFjtoCI+KGd4PELB0qLNxdJHRGqRI09mB6pQA=
386+
google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 h1:SeZZZx0cP0fqUyA+oRzP9k7cSwJlvDFiROO72uwD6i0=
387+
google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97/go.mod h1:t1VqOqqvce95G3hIDCT5FeO3YUc6Q4Oe24L/+rNMxRk=
388+
google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU=
389+
google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0=
390+
google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a h1:a2MQQVoTo96JC9PMGtGBymLp7+/RzpFc2yX/9WfFg1c=
391+
google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0=
391392
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
392393
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
393394
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
394395
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
395396
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
396397
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
397-
google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw=
398-
google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo=
398+
google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ=
399+
google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0=
399400
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
400401
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
401402
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=

google/services/sql/resource_sql_database_instance.go

+12
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ var (
8181
"settings.0.ip_configuration.0.allocated_ip_range",
8282
"settings.0.ip_configuration.0.enable_private_path_for_google_cloud_services",
8383
"settings.0.ip_configuration.0.psc_config",
84+
"settings.0.ip_configuration.0.ssl_mode",
8485
}
8586

8687
maintenanceWindowKeys = []string{
@@ -436,6 +437,7 @@ is set to true. Defaults to ZONAL.`,
436437
Type: schema.TypeBool,
437438
Optional: true,
438439
AtLeastOneOf: ipConfigurationKeys,
440+
Description: `Whether SSL connections over IP are enforced or not. To change this field, also set the corresponding value in ssl_mode.`,
439441
},
440442
"private_network": {
441443
Type: schema.TypeString,
@@ -480,6 +482,14 @@ is set to true. Defaults to ZONAL.`,
480482
},
481483
},
482484
},
485+
"ssl_mode": {
486+
Type: schema.TypeString,
487+
Optional: true,
488+
Computed: true,
489+
ValidateFunc: validation.StringInSlice([]string{"ALLOW_UNENCRYPTED_AND_ENCRYPTED", "ENCRYPTED_ONLY", "TRUSTED_CLIENT_CERTIFICATE_REQUIRED"}, false),
490+
Description: `Specify how SSL connection should be enforced in DB connections. This field provides more SSL enforcment options compared to require_ssl. To change this field, also set the correspoding value in require_ssl.`,
491+
AtLeastOneOf: ipConfigurationKeys,
492+
},
483493
},
484494
},
485495
},
@@ -1382,6 +1392,7 @@ func expandIpConfiguration(configured []interface{}, databaseVersion string) *sq
13821392
EnablePrivatePathForGoogleCloudServices: _ipConfiguration["enable_private_path_for_google_cloud_services"].(bool),
13831393
ForceSendFields: forceSendFields,
13841394
PscConfig: expandPscConfig(_ipConfiguration["psc_config"].(*schema.Set).List()),
1395+
SslMode: _ipConfiguration["ssl_mode"].(string),
13851396
}
13861397
}
13871398

@@ -2187,6 +2198,7 @@ func flattenIpConfiguration(ipConfiguration *sqladmin.IpConfiguration) interface
21872198
"allocated_ip_range": ipConfiguration.AllocatedIpRange,
21882199
"require_ssl": ipConfiguration.RequireSsl,
21892200
"enable_private_path_for_google_cloud_services": ipConfiguration.EnablePrivatePathForGoogleCloudServices,
2201+
"ssl_mode": ipConfiguration.SslMode,
21902202
}
21912203

21922204
if ipConfiguration.AuthorizedNetworks != nil {

google/services/sql/resource_sql_database_instance_test.go

+70
Original file line numberDiff line numberDiff line change
@@ -2116,6 +2116,76 @@ func TestAccSqlDatabaseInstance_ReplicaPromoteSkippedWithNoMasterInstanceNameAnd
21162116
})
21172117
}
21182118

2119+
func TestAccSqlDatabaseInstance_updateSslOptionsForPostgreSQL(t *testing.T) {
2120+
t.Parallel()
2121+
2122+
databaseName := "tf-test-" + acctest.RandString(t, 10)
2123+
databaseVersion := "POSTGRES_14"
2124+
resourceName := "google_sql_database_instance.instance"
2125+
2126+
acctest.VcrTest(t, resource.TestCase{
2127+
PreCheck: func() { acctest.AccTestPreCheck(t) },
2128+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
2129+
CheckDestroy: testAccSqlDatabaseInstanceDestroyProducer(t),
2130+
Steps: []resource.TestStep{
2131+
{
2132+
Config: testGoogleSqlDatabaseInstance_setSslOptionsForPostgreSQL(databaseName, databaseVersion, false, "ALLOW_UNENCRYPTED_AND_ENCRYPTED"),
2133+
},
2134+
{
2135+
ResourceName: resourceName,
2136+
ImportState: true,
2137+
ImportStateVerify: true,
2138+
ImportStateVerifyIgnore: []string{"deletion_protection"},
2139+
},
2140+
{
2141+
Config: testGoogleSqlDatabaseInstance_setSslOptionsForPostgreSQL(databaseName, databaseVersion, false, "ENCRYPTED_ONLY"),
2142+
},
2143+
{
2144+
ResourceName: resourceName,
2145+
ImportState: true,
2146+
ImportStateVerify: true,
2147+
ImportStateVerifyIgnore: []string{"deletion_protection"},
2148+
},
2149+
{
2150+
Config: testGoogleSqlDatabaseInstance_setSslOptionsForPostgreSQL(databaseName, databaseVersion, true, "TRUSTED_CLIENT_CERTIFICATE_REQUIRED"),
2151+
},
2152+
{
2153+
ResourceName: resourceName,
2154+
ImportState: true,
2155+
ImportStateVerify: true,
2156+
ImportStateVerifyIgnore: []string{"deletion_protection"},
2157+
},
2158+
{
2159+
Config: testGoogleSqlDatabaseInstance_setSslOptionsForPostgreSQL(databaseName, databaseVersion, false, "ALLOW_UNENCRYPTED_AND_ENCRYPTED"),
2160+
},
2161+
{
2162+
ResourceName: resourceName,
2163+
ImportState: true,
2164+
ImportStateVerify: true,
2165+
ImportStateVerifyIgnore: []string{"deletion_protection"},
2166+
},
2167+
},
2168+
})
2169+
}
2170+
2171+
func testGoogleSqlDatabaseInstance_setSslOptionsForPostgreSQL(databaseName string, databaseVersion string, requireSsl bool, sslMode string) string {
2172+
return fmt.Sprintf(`
2173+
resource "google_sql_database_instance" "instance" {
2174+
name = "%s"
2175+
region = "us-central1"
2176+
database_version = "%s"
2177+
deletion_protection = false
2178+
settings {
2179+
tier = "db-f1-micro"
2180+
ip_configuration {
2181+
ipv4_enabled = true
2182+
require_ssl = %t
2183+
ssl_mode = "%s"
2184+
}
2185+
}
2186+
}`, databaseName, databaseVersion, requireSsl, sslMode)
2187+
}
2188+
21192189
func testAccSqlDatabaseInstance_sqlMysqlInstancePvpExample(context map[string]interface{}) string {
21202190
return acctest.Nprintf(`
21212191
resource "google_sql_database_instance" "mysql_pvp_instance_name" {

0 commit comments

Comments
 (0)