Skip to content

Commit

Permalink
add certificate manager public CA external account key resource (#817…
Browse files Browse the repository at this point in the history
…1) (#1099)

Signed-off-by: Modular Magician <[email protected]>
Co-authored-by: Riley Karson <[email protected]>
  • Loading branch information
modular-magician and rileykarson authored Jun 26, 2023
1 parent 5ce92e0 commit 3c2f1fb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/hashicorp/terraform-plugin-framework v1.1.1
github.com/hashicorp/terraform-plugin-framework-validators v0.9.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0
github.com/hashicorp/terraform-provider-google v1.20.1-0.20230623231904-3eeed812d3bb
github.com/hashicorp/terraform-provider-google v1.20.1-0.20230626161117-b35a8cbc47e5
github.com/mitchellh/go-homedir v1.1.0
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ github.com/hashicorp/terraform-plugin-mux v0.8.0 h1:WCTP66mZ+iIaIrCNJnjPEYnVjawT
github.com/hashicorp/terraform-plugin-mux v0.8.0/go.mod h1:vdW0daEi8Kd4RFJmet5Ot+SIVB/B8SwQVJiYKQwdCy8=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0 h1:FtCLTiTcykdsURXPt/ku7fYXm3y19nbzbZcUxHx9RbI=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0/go.mod h1:80wf5oad1tW+oLnbXS4UTYmDCrl7BuN1Q+IA91X1a4Y=
github.com/hashicorp/terraform-provider-google v1.20.1-0.20230623231904-3eeed812d3bb h1:IHesRBDYyTiy0GMpN5hN+3S0uwyPlP6xKFnAYYtULpA=
github.com/hashicorp/terraform-provider-google v1.20.1-0.20230623231904-3eeed812d3bb/go.mod h1:77DqxtmralrdfVRvR61N8tjIgwHhstwgoakDCYDjIMg=
github.com/hashicorp/terraform-provider-google v1.20.1-0.20230626161117-b35a8cbc47e5 h1:xr02+F27LULE/9PiyxxtwyvxEh5rNUG6DKuYC0Kv5Pw=
github.com/hashicorp/terraform-provider-google v1.20.1-0.20230626161117-b35a8cbc47e5/go.mod h1:77DqxtmralrdfVRvR61N8tjIgwHhstwgoakDCYDjIMg=
github.com/hashicorp/terraform-registry-address v0.1.0 h1:W6JkV9wbum+m516rCl5/NjKxCyTVaaUBbzYcMzBDO3U=
github.com/hashicorp/terraform-registry-address v0.1.0/go.mod h1:EnyO2jYO6j29DTHbJcm00E5nQTFeTtyZH3H5ycydQ5A=
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func configureTestBasePaths(c *transport_tpg.Config, url string) {
c.OSConfigBasePath = url
c.OSLoginBasePath = url
c.PrivatecaBasePath = url
c.PublicCABasePath = url
c.PubsubBasePath = url
c.PubsubLiteBasePath = url
c.RedisBasePath = url
Expand Down
9 changes: 9 additions & 0 deletions tfplan2cai/converters/google/resources/transport/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ type Config struct {
OSConfigBasePath string
OSLoginBasePath string
PrivatecaBasePath string
PublicCABasePath string
PubsubBasePath string
PubsubLiteBasePath string
RedisBasePath string
Expand Down Expand Up @@ -359,6 +360,7 @@ const NotebooksBasePathKey = "Notebooks"
const OSConfigBasePathKey = "OSConfig"
const OSLoginBasePathKey = "OSLogin"
const PrivatecaBasePathKey = "Privateca"
const PublicCABasePathKey = "PublicCA"
const PubsubBasePathKey = "Pubsub"
const PubsubLiteBasePathKey = "PubsubLite"
const RedisBasePathKey = "Redis"
Expand Down Expand Up @@ -462,6 +464,7 @@ var DefaultBasePaths = map[string]string{
OSConfigBasePathKey: "https://osconfig.googleapis.com/v1/",
OSLoginBasePathKey: "https://oslogin.googleapis.com/v1/",
PrivatecaBasePathKey: "https://privateca.googleapis.com/v1/",
PublicCABasePathKey: "https://publicca.googleapis.com/v1/",
PubsubBasePathKey: "https://pubsub.googleapis.com/v1/",
PubsubLiteBasePathKey: "https://{{region}}-pubsublite.googleapis.com/v1/admin/",
RedisBasePathKey: "https://redis.googleapis.com/v1/",
Expand Down Expand Up @@ -908,6 +911,11 @@ func HandleSDKDefaults(d *schema.ResourceData) error {
"GOOGLE_PRIVATECA_CUSTOM_ENDPOINT",
}, DefaultBasePaths[PrivatecaBasePathKey]))
}
if d.Get("public_ca_custom_endpoint") == "" {
d.Set("public_ca_custom_endpoint", MultiEnvDefault([]string{
"GOOGLE_PUBLIC_CA_CUSTOM_ENDPOINT",
}, DefaultBasePaths[PublicCABasePathKey]))
}
if d.Get("pubsub_custom_endpoint") == "" {
d.Set("pubsub_custom_endpoint", MultiEnvDefault([]string{
"GOOGLE_PUBSUB_CUSTOM_ENDPOINT",
Expand Down Expand Up @@ -1908,6 +1916,7 @@ func ConfigureBasePaths(c *Config) {
c.OSConfigBasePath = DefaultBasePaths[OSConfigBasePathKey]
c.OSLoginBasePath = DefaultBasePaths[OSLoginBasePathKey]
c.PrivatecaBasePath = DefaultBasePaths[PrivatecaBasePathKey]
c.PublicCABasePath = DefaultBasePaths[PublicCABasePathKey]
c.PubsubBasePath = DefaultBasePaths[PubsubBasePathKey]
c.PubsubLiteBasePath = DefaultBasePaths[PubsubLiteBasePathKey]
c.RedisBasePath = DefaultBasePaths[RedisBasePathKey]
Expand Down

0 comments on commit 3c2f1fb

Please sign in to comment.