Skip to content

Commit

Permalink
add pubsub lite (#4295) (#8011)
Browse files Browse the repository at this point in the history
Co-authored-by: upodroid <cy@borg.dev>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: upodroid <cy@borg.dev>
  • Loading branch information
modular-magician and upodroid committed Dec 14, 2020
1 parent 6ba959b commit 48ec547
Show file tree
Hide file tree
Showing 12 changed files with 1,811 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changelog/4295.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:new-resource
`google_pubsub_lite_topic`
```
```release-note:new-resource
`google_pubsub_lite_subscription`
```
3 changes: 3 additions & 0 deletions google/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ type Config struct {
OSConfigBasePath string
OSLoginBasePath string
PubsubBasePath string
PubsubLiteBasePath string
RedisBasePath string
ResourceManagerBasePath string
RuntimeConfigBasePath string
Expand Down Expand Up @@ -198,6 +199,7 @@ var NotebooksDefaultBasePath = "https://notebooks.googleapis.com/v1/"
var OSConfigDefaultBasePath = "https://osconfig.googleapis.com/v1/"
var OSLoginDefaultBasePath = "https://oslogin.googleapis.com/v1/"
var PubsubDefaultBasePath = "https://pubsub.googleapis.com/v1/"
var PubsubLiteDefaultBasePath = "https://{{region}}-pubsublite.googleapis.com/v1/admin/"
var RedisDefaultBasePath = "https://redis.googleapis.com/v1/"
var ResourceManagerDefaultBasePath = "https://cloudresourcemanager.googleapis.com/v1/"
var RuntimeConfigDefaultBasePath = "https://runtimeconfig.googleapis.com/v1beta1/"
Expand Down Expand Up @@ -983,6 +985,7 @@ func ConfigureBasePaths(c *Config) {
c.OSConfigBasePath = OSConfigDefaultBasePath
c.OSLoginBasePath = OSLoginDefaultBasePath
c.PubsubBasePath = PubsubDefaultBasePath
c.PubsubLiteBasePath = PubsubLiteDefaultBasePath
c.RedisBasePath = RedisDefaultBasePath
c.ResourceManagerBasePath = ResourceManagerDefaultBasePath
c.RuntimeConfigBasePath = RuntimeConfigDefaultBasePath
Expand Down
15 changes: 13 additions & 2 deletions google/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,14 @@ func Provider() *schema.Provider {
"GOOGLE_PUBSUB_CUSTOM_ENDPOINT",
}, PubsubDefaultBasePath),
},
"pubsub_lite_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_PUBSUB_LITE_CUSTOM_ENDPOINT",
}, PubsubLiteDefaultBasePath),
},
"redis_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -678,9 +686,9 @@ func Provider() *schema.Provider {
return provider
}

// Generated resources: 174
// Generated resources: 176
// Generated IAM resources: 75
// Total generated resources: 249
// Total generated resources: 251
func ResourceMap() map[string]*schema.Resource {
resourceMap, _ := ResourceMapWithErrors()
return resourceMap
Expand Down Expand Up @@ -907,6 +915,8 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_pubsub_topic_iam_member": ResourceIamMember(PubsubTopicIamSchema, PubsubTopicIamUpdaterProducer, PubsubTopicIdParseFunc),
"google_pubsub_topic_iam_policy": ResourceIamPolicy(PubsubTopicIamSchema, PubsubTopicIamUpdaterProducer, PubsubTopicIdParseFunc),
"google_pubsub_subscription": resourcePubsubSubscription(),
"google_pubsub_lite_topic": resourcePubsubLiteTopic(),
"google_pubsub_lite_subscription": resourcePubsubLiteSubscription(),
"google_redis_instance": resourceRedisInstance(),
"google_resource_manager_lien": resourceResourceManagerLien(),
"google_runtimeconfig_config_iam_binding": ResourceIamBinding(RuntimeConfigConfigIamSchema, RuntimeConfigConfigIamUpdaterProducer, RuntimeConfigConfigIdParseFunc),
Expand Down Expand Up @@ -1163,6 +1173,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
config.OSConfigBasePath = d.Get("os_config_custom_endpoint").(string)
config.OSLoginBasePath = d.Get("os_login_custom_endpoint").(string)
config.PubsubBasePath = d.Get("pubsub_custom_endpoint").(string)
config.PubsubLiteBasePath = d.Get("pubsub_lite_custom_endpoint").(string)
config.RedisBasePath = d.Get("redis_custom_endpoint").(string)
config.ResourceManagerBasePath = d.Get("resource_manager_custom_endpoint").(string)
config.RuntimeConfigBasePath = d.Get("runtime_config_custom_endpoint").(string)
Expand Down
Loading

0 comments on commit 48ec547

Please sign in to comment.