Skip to content

Commit

Permalink
Pub/Sub Topic CMEK/KMS support
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
drebes authored and modular-magician committed Jun 29, 2019
1 parent 4e020f1 commit 938e668
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions google/pubsub_topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ func GetPubsubTopicApiObject(d TerraformResourceData, config *Config) (map[strin
} else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
obj["name"] = nameProp
}
kmsKeyNameProp, err := expandPubsubTopicKmsKeyName(d.Get("kms_key_name"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("kms_key_name"); !isEmptyValue(reflect.ValueOf(kmsKeyNameProp)) && (ok || !reflect.DeepEqual(v, kmsKeyNameProp)) {
obj["kmsKeyName"] = kmsKeyNameProp
}
labelsProp, err := expandPubsubTopicLabels(d.Get("labels"), d, config)
if err != nil {
return nil, err
Expand All @@ -64,6 +70,10 @@ func expandPubsubTopicName(v interface{}, d TerraformResourceData, config *Confi
return GetResourceNameFromSelfLink(v.(string)), nil
}

func expandPubsubTopicKmsKeyName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
return v, nil
}

func expandPubsubTopicLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) {
if v == nil {
return map[string]string{}, nil
Expand Down

0 comments on commit 938e668

Please sign in to comment.