Skip to content

Pub/Sub - Change Allowed Persistence Regions to Set in 'google_pubsub_topic' #9743

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

Merged
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
9 changes: 7 additions & 2 deletions google-beta/services/pubsub/resource_pubsub_topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ constraints are in effect.`,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"allowed_persistence_regions": {
Type: schema.TypeList,
Type: schema.TypeSet,
Required: true,
Description: `A list of IDs of GCP regions where messages that are published to
the topic may be persisted in storage. Messages published by
Expand All @@ -383,6 +383,7 @@ and is not a valid configuration.`,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Set: schema.HashString,
},
"enforce_in_transit": {
Type: schema.TypeBool,
Expand Down Expand Up @@ -907,7 +908,10 @@ func flattenPubsubTopicMessageStoragePolicy(v interface{}, d *schema.ResourceDat
return []interface{}{transformed}
}
func flattenPubsubTopicMessageStoragePolicyAllowedPersistenceRegions(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
return v
if v == nil {
return v
}
return schema.NewSet(schema.HashString, v.([]interface{}))
}

func flattenPubsubTopicMessageStoragePolicyEnforceInTransit(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
Expand Down Expand Up @@ -1267,6 +1271,7 @@ func expandPubsubTopicMessageStoragePolicy(v interface{}, d tpgresource.Terrafor
}

func expandPubsubTopicMessageStoragePolicyAllowedPersistenceRegions(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
v = v.(*schema.Set).List()
return v, nil
}

Expand Down
Loading