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

Add Cloud Deploy Delivery Pipelines and Targets to tpg built from the… #11658

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
Add Cloud Deploy Delivery Pipelines and Targets to tpg built from the…
…ir DCL resources (#5999)

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician committed May 6, 2022
commit 57b0d44130bf9e62ae1bb743459cbf5ea02aaa54
6 changes: 6 additions & 0 deletions .changelog/5999.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:new-resource
`google_clouddeploy_delivery_pipeline`
```
```release-note:new-resource
`google_clouddeploy_target`
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/hashicorp/terraform-provider-google
require (
cloud.google.com/go/bigtable v1.13.0
cloud.google.com/go/iam v0.1.1 // indirect
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.5.1
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.5.2
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
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1549,3 +1549,5 @@ github.com/GoogleCloudPlatform/declarative-resource-client-library v1.5.1 h1:Wsa
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.5.1/go.mod h1:UJoDYx6t3+xCOd+dZX8+NrEB+Y/eW1pQlvxh2Gt7y5E=
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.5.1 h1:WsauUAtzKxwcfR2SAN8K/yeHS6S4pGK6r/oJdKJaTgI=
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.5.1/go.mod h1:UJoDYx6t3+xCOd+dZX8+NrEB+Y/eW1pQlvxh2Gt7y5E=
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.5.2 h1:SrHcyR/zNEaghHyLZvKKIjKL6RKNuESkyYZIgMHE3ko=
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.5.2/go.mod h1:UJoDYx6t3+xCOd+dZX8+NrEB+Y/eW1pQlvxh2Gt7y5E=
1 change: 1 addition & 0 deletions google/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ type Config struct {
// start DCLBasePaths
// dataprocBasePath is implemented in mm
AssuredWorkloadsBasePath string
ClouddeployBasePath string
CloudResourceManagerBasePath string
ContainerAwsBasePath string
ContainerAzureBasePath string
Expand Down
4 changes: 4 additions & 0 deletions google/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ func Provider() *schema.Provider {

// dcl
AssuredWorkloadsEndpointEntryKey: AssuredWorkloadsEndpointEntry,
ClouddeployEndpointEntryKey: ClouddeployEndpointEntry,
CloudResourceManagerEndpointEntryKey: CloudResourceManagerEndpointEntry,
EventarcEndpointEntryKey: EventarcEndpointEntry,
FirebaserulesEndpointEntryKey: FirebaserulesEndpointEntry,
Expand Down Expand Up @@ -1240,6 +1241,8 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_apikeys_key": resourceApikeysKey(),
"google_assured_workloads_workload": resourceAssuredWorkloadsWorkload(),
"google_cloudbuild_worker_pool": resourceCloudbuildWorkerPool(),
"google_clouddeploy_delivery_pipeline": resourceClouddeployDeliveryPipeline(),
"google_clouddeploy_target": resourceClouddeployTarget(),
"google_compute_firewall_policy_association": resourceComputeFirewallPolicyAssociation(),
"google_compute_firewall_policy": resourceComputeFirewallPolicy(),
"google_compute_firewall_policy_rule": resourceComputeFirewallPolicyRule(),
Expand Down Expand Up @@ -1492,6 +1495,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
// dcl
config.ApikeysBasePath = d.Get(ApikeysEndpointEntryKey).(string)
config.AssuredWorkloadsBasePath = d.Get(AssuredWorkloadsEndpointEntryKey).(string)
config.ClouddeployBasePath = d.Get(ClouddeployEndpointEntryKey).(string)
config.CloudResourceManagerBasePath = d.Get(CloudResourceManagerEndpointEntryKey).(string)
config.EventarcBasePath = d.Get(EventarcEndpointEntryKey).(string)
config.FirebaserulesBasePath = d.Get(FirebaserulesEndpointEntryKey).(string)
Expand Down
24 changes: 24 additions & 0 deletions google/provider_dcl_client_creation.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
assuredworkloads "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/assuredworkloads"
bigqueryreservation "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/bigqueryreservation"
cloudbuild "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/cloudbuild"
clouddeploy "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/clouddeploy"
cloudresourcemanager "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/cloudresourcemanager"
compute "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/compute"
containeraws "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/containeraws"
Expand Down Expand Up @@ -130,6 +131,29 @@ func NewDCLCloudbuildClient(config *Config, userAgent, billingProject string, ti
return cloudbuild.NewClient(dclConfig)
}

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

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 clouddeploy.NewClient(dclConfig)
}

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

var ClouddeployEndpointEntryKey = "clouddeploy_custom_endpoint"
var ClouddeployEndpointEntry = &schema.Schema{
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_CLOUDDEPLOY_CUSTOM_ENDPOINT",
}, ""),
}

var CloudResourceManagerEndpointEntryKey = "cloud_resource_manager_custom_endpoint"
var CloudResourceManagerEndpointEntry = &schema.Schema{
Type: schema.TypeString,
Expand Down Expand Up @@ -161,6 +170,7 @@ var RecaptchaEnterpriseEndpointEntry = &schema.Schema{
//ApikeysBasePath string
//AssuredWorkloadsBasePath string
//CloudBuildWorkerPoolBasePath string
//ClouddeployBasePath string
//CloudResourceManagerBasePath string
//ComputeBasePath string
//ContainerAwsBasePath string
Expand All @@ -178,6 +188,7 @@ var RecaptchaEnterpriseEndpointEntry = &schema.Schema{
// ApikeysEndpointEntryKey: ApikeysEndpointEntry,
// AssuredWorkloadsEndpointEntryKey: AssuredWorkloadsEndpointEntry,
// CloudBuildWorkerPoolEndpointEntryKey: CloudBuildWorkerPoolEndpointEntry,
// ClouddeployEndpointEntryKey: ClouddeployEndpointEntry,
// CloudResourceManagerEndpointEntryKey: CloudResourceManagerEndpointEntry,
// ComputeEndpointEntryKey: ComputeEndpointEntry,
// ContainerAwsEndpointEntryKey: ContainerAwsEndpointEntry,
Expand All @@ -195,6 +206,7 @@ var RecaptchaEnterpriseEndpointEntry = &schema.Schema{
// config.ApikeysBasePath = d.Get(ApikeysEndpointEntryKey).(string)
// config.AssuredWorkloadsBasePath = d.Get(AssuredWorkloadsEndpointEntryKey).(string)
// config.CloudBuildWorkerPoolBasePath = d.Get(CloudBuildWorkerPoolEndpointEntryKey).(string)
// config.ClouddeployBasePath = d.Get(ClouddeployEndpointEntryKey).(string)
// config.CloudResourceManagerBasePath = d.Get(CloudResourceManagerEndpointEntryKey).(string)
// config.ComputeBasePath = d.Get(ComputeEndpointEntryKey).(string)
// config.ContainerAwsBasePath = d.Get(ContainerAwsEndpointEntryKey).(string)
Expand Down
Loading