Method: AWS::SNS::Topic#policy=

Defined in:
lib/aws/sns/topic.rb

#policy=(policy) ⇒ nil

Sets the topic’s policy.

Parameters:

  • policy (String, Policy)

    A JSON policy string, a Policy object or any other object that responds to #to_json with a valid policy.

Returns:

  • (nil)


197
198
199
200
201
# File 'lib/aws/sns/topic.rb', line 197

def policy= policy
  policy_json = policy.is_a?(String) ? policy : policy.to_json
  set_attribute('Policy', policy_json)
  nil
end