Skip to content

Commit

Permalink
Sql user label (#3422) (#389)
Browse files Browse the repository at this point in the history
* Add user labels kv map to sql instance

* Add userLabels to sql instance

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored and Stuart Paterson committed Apr 28, 2020
1 parent 1dcd50c commit b156926
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/resources/google_sql_database_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ Properties that can be accessed from the `google_sql_database_instance` resource

* `settings_version`: The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value.

* `user_labels`: User-provided labels, represented as a dictionary where each label is a single key value pair.

* `gce_zone`: The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone.

* `state`: The current serving state of the database instance.
Expand Down
3 changes: 3 additions & 0 deletions libraries/google/sql/property/databaseinstance_settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class DatabaseInstanceSettings

attr_reader :settings_version

attr_reader :user_labels

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
Expand All @@ -42,6 +44,7 @@ def initialize(args = nil, parent_identifier = nil)
@availability_type = args['availabilityType']
@backup_configuration = GoogleInSpec::SQL::Property::DatabaseInstanceSettingsBackupConfiguration.new(args['backupConfiguration'], to_s)
@settings_version = args['settingsVersion']
@user_labels = args['userLabels']
end

def to_s
Expand Down

0 comments on commit b156926

Please sign in to comment.