Skip to content

Commit

Permalink
Cloudrun v1 (#4972)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored and chrisst committed Nov 27, 2019
1 parent e9aa873 commit d20547d
Show file tree
Hide file tree
Showing 13 changed files with 3,874 additions and 27 deletions.
3 changes: 3 additions & 0 deletions google/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ type Config struct {
BinaryAuthorizationBasePath string
CloudBuildBasePath string
CloudFunctionsBasePath string
CloudRunBasePath string
CloudSchedulerBasePath string
ComputeBasePath string
ContainerAnalysisBasePath string
Expand Down Expand Up @@ -205,6 +206,7 @@ var BigtableDefaultBasePath = "https://bigtableadmin.googleapis.com/v2/"
var BinaryAuthorizationDefaultBasePath = "https://binaryauthorization.googleapis.com/v1/"
var CloudBuildDefaultBasePath = "https://cloudbuild.googleapis.com/v1/"
var CloudFunctionsDefaultBasePath = "https://cloudfunctions.googleapis.com/v1/"
var CloudRunDefaultBasePath = "https://{{location}}-run.googleapis.com/apis/"
var CloudSchedulerDefaultBasePath = "https://cloudscheduler.googleapis.com/v1/"
var ComputeDefaultBasePath = "https://www.googleapis.com/compute/v1/"
var ContainerAnalysisDefaultBasePath = "https://containeranalysis.googleapis.com/v1/"
Expand Down Expand Up @@ -671,6 +673,7 @@ func ConfigureBasePaths(c *Config) {
c.BinaryAuthorizationBasePath = BinaryAuthorizationDefaultBasePath
c.CloudBuildBasePath = CloudBuildDefaultBasePath
c.CloudFunctionsBasePath = CloudFunctionsDefaultBasePath
c.CloudRunBasePath = CloudRunDefaultBasePath
c.CloudSchedulerBasePath = CloudSchedulerDefaultBasePath
c.ComputeBasePath = ComputeDefaultBasePath
c.ContainerAnalysisBasePath = ContainerAnalysisDefaultBasePath
Expand Down
15 changes: 13 additions & 2 deletions google/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ func Provider() terraform.ResourceProvider {
"GOOGLE_CLOUD_FUNCTIONS_CUSTOM_ENDPOINT",
}, CloudFunctionsDefaultBasePath),
},
"cloud_run_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_CLOUD_RUN_CUSTOM_ENDPOINT",
}, CloudRunDefaultBasePath),
},
"cloud_scheduler_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -437,9 +445,9 @@ func Provider() terraform.ResourceProvider {
return provider
}

// Generated resources: 81
// Generated resources: 86
// Generated IAM resources: 39
// Total generated resources: 120
// Total generated resources: 125
func ResourceMap() map[string]*schema.Resource {
resourceMap, _ := ResourceMapWithErrors()
return resourceMap
Expand Down Expand Up @@ -467,6 +475,8 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_cloudfunctions_function_iam_binding": ResourceIamBinding(CloudFunctionsCloudFunctionIamSchema, CloudFunctionsCloudFunctionIamUpdaterProducer, CloudFunctionsCloudFunctionIdParseFunc),
"google_cloudfunctions_function_iam_member": ResourceIamMember(CloudFunctionsCloudFunctionIamSchema, CloudFunctionsCloudFunctionIamUpdaterProducer, CloudFunctionsCloudFunctionIdParseFunc),
"google_cloudfunctions_function_iam_policy": ResourceIamPolicy(CloudFunctionsCloudFunctionIamSchema, CloudFunctionsCloudFunctionIamUpdaterProducer, CloudFunctionsCloudFunctionIdParseFunc),
"google_cloud_run_domain_mapping": resourceCloudRunDomainMapping(),
"google_cloud_run_service": resourceCloudRunService(),
"google_cloud_scheduler_job": resourceCloudSchedulerJob(),
"google_compute_address": resourceComputeAddress(),
"google_compute_autoscaler": resourceComputeAutoscaler(),
Expand Down Expand Up @@ -722,6 +732,7 @@ func providerConfigure(d *schema.ResourceData, terraformVersion string) (interfa
config.BinaryAuthorizationBasePath = d.Get("binary_authorization_custom_endpoint").(string)
config.CloudBuildBasePath = d.Get("cloud_build_custom_endpoint").(string)
config.CloudFunctionsBasePath = d.Get("cloud_functions_custom_endpoint").(string)
config.CloudRunBasePath = d.Get("cloud_run_custom_endpoint").(string)
config.CloudSchedulerBasePath = d.Get("cloud_scheduler_custom_endpoint").(string)
config.ComputeBasePath = d.Get("compute_custom_endpoint").(string)
config.ContainerAnalysisBasePath = d.Get("container_analysis_custom_endpoint").(string)
Expand Down
Loading

0 comments on commit d20547d

Please sign in to comment.