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

google_os_config_os_policy_assignment #3892

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
3 changes: 3 additions & 0 deletions .changelog/5481.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
`google_os_config_os_policy_assignment`
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/hashicorp/terraform-provider-google-beta
require (
cloud.google.com/go/bigtable v1.10.1
github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20211201210024-59e87ee7d811
github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20211202000727-18e4bafd7e9b
github.com/apparentlymart/go-cidr v1.1.0
github.com/client9/misspell v0.3.4
github.com/davecgh/go-spew v1.1.1
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,5 @@ github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-202110
github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20211026195335-4a6ae4ac04de/go.mod h1:oEeBHikdF/NrnUy0ornVaY1OT+jGvTqm+LQS0+ZDKzU=
github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20211027225138-ef28ca390518 h1:tFdFasG+VDpnn+BfVbZrfGcoH6pw6s7ODYlZlhTO3UM=
github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20211027225138-ef28ca390518/go.mod h1:oEeBHikdF/NrnUy0ornVaY1OT+jGvTqm+LQS0+ZDKzU=
github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20211129235756-547215b5e6ef h1:f+09BJVg+I/SObjSguOGGoSQHlT/Y1c8ah+nz1bkppI=
github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20211129235756-547215b5e6ef/go.mod h1:oEeBHikdF/NrnUy0ornVaY1OT+jGvTqm+LQS0+ZDKzU=
github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20211201210024-59e87ee7d811 h1:j1JJXw1MuANOPXJcruRaKIYIfPMNUwksphKSQruFF6w=
github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20211201210024-59e87ee7d811/go.mod h1:oEeBHikdF/NrnUy0ornVaY1OT+jGvTqm+LQS0+ZDKzU=
github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20211202000727-18e4bafd7e9b h1:tXwnAInHrxG7UA0ZqJqA6Wh8IFamRpSXZXt/DTZFOyU=
github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20211202000727-18e4bafd7e9b/go.mod h1:oEeBHikdF/NrnUy0ornVaY1OT+jGvTqm+LQS0+ZDKzU=
1 change: 1 addition & 0 deletions google-beta/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_gke_hub_feature_membership": resourceGkeHubFeatureMembership(),
"google_monitoring_monitored_project": resourceMonitoringMonitoredProject(),
"google_org_policy_policy": resourceOrgPolicyPolicy(),
"google_os_config_os_policy_assignment": resourceOSConfigOSPolicyAssignment(),
"google_privateca_certificate_template": resourcePrivatecaCertificateTemplate(),
"google_recaptcha_enterprise_key": resourceRecaptchaEnterpriseKey(),
},
Expand Down
24 changes: 24 additions & 0 deletions google-beta/provider_dcl_client_creation.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
gkehub "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/gkehub/beta"
monitoring "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/monitoring/beta"
orgpolicy "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/orgpolicy/beta"
osconfig "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/osconfig/beta"
privateca "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/privateca/beta"
recaptchaenterprise "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/recaptchaenterprise/beta"
)
Expand Down Expand Up @@ -239,6 +240,29 @@ func NewDCLOrgPolicyClient(config *Config, userAgent, billingProject string, tim
return orgpolicy.NewClient(dclConfig)
}

func NewDCLOSConfigClient(config *Config, userAgent, billingProject string, timeout time.Duration) *osconfig.Client {
configOptions := []dcl.ConfigOption{
dcl.WithHTTPClient(config.client),
dcl.WithUserAgent(userAgent),
dcl.WithLogger(dclLogger{}),
dcl.WithBasePath(config.OSConfigBasePath),
}

if timeout != 0 {
configOptions = append(configOptions, dcl.WithTimeout(timeout))
}

if config.UserProjectOverride {
configOptions = append(configOptions, dcl.WithUserProjectOverride())
if billingProject != "" {
configOptions = append(configOptions, dcl.WithBillingProject(billingProject))
}
}

dclConfig := dcl.NewConfig(configOptions...)
return osconfig.NewClient(dclConfig)
}

func NewDCLPrivatecaClient(config *Config, userAgent, billingProject string, timeout time.Duration) *privateca.Client {
configOptions := []dcl.ConfigOption{
dcl.WithHTTPClient(config.client),
Expand Down
12 changes: 12 additions & 0 deletions google-beta/provider_dcl_endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ var OrgPolicyEndpointEntry = &schema.Schema{
}, ""),
}

var OSConfigEndpointEntryKey = "os_config_custom_endpoint"
var OSConfigEndpointEntry = &schema.Schema{
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_OS_CONFIG_CUSTOM_ENDPOINT",
}, ""),
}

var PrivatecaEndpointEntryKey = "privateca_custom_endpoint"
var PrivatecaEndpointEntry = &schema.Schema{
Type: schema.TypeString,
Expand All @@ -111,6 +120,7 @@ var RecaptchaEnterpriseEndpointEntry = &schema.Schema{
//EventarcBasePath string
//MonitoringBasePath string
//OrgPolicyBasePath string
//OSConfigBasePath string
//PrivatecaBasePath string
//RecaptchaEnterpriseBasePath string

Expand All @@ -122,6 +132,7 @@ var RecaptchaEnterpriseEndpointEntry = &schema.Schema{
// EventarcEndpointEntryKey: EventarcEndpointEntry,
// MonitoringEndpointEntryKey: MonitoringEndpointEntry,
// OrgPolicyEndpointEntryKey: OrgPolicyEndpointEntry,
// OSConfigEndpointEntryKey: OSConfigEndpointEntry,
// PrivatecaEndpointEntryKey: PrivatecaEndpointEntry,
// RecaptchaEnterpriseEndpointEntryKey: RecaptchaEnterpriseEndpointEntry,

Expand All @@ -133,5 +144,6 @@ var RecaptchaEnterpriseEndpointEntry = &schema.Schema{
// config.EventarcBasePath = d.Get(EventarcEndpointEntryKey).(string)
// config.MonitoringBasePath = d.Get(MonitoringEndpointEntryKey).(string)
// config.OrgPolicyBasePath = d.Get(OrgPolicyEndpointEntryKey).(string)
// config.OSConfigBasePath = d.Get(OSConfigEndpointEntryKey).(string)
// config.PrivatecaBasePath = d.Get(PrivatecaEndpointEntryKey).(string)
// config.RecaptchaEnterpriseBasePath = d.Get(RecaptchaEnterpriseEndpointEntryKey).(string)
Loading