:doc:`CloudFormation <../../cloudformation>` / Client / set_stack_policy

****************
set_stack_policy
****************



.. py:method:: CloudFormation.Client.set_stack_policy(**kwargs)

  

  Sets a stack policy for a specified stack.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SetStackPolicy>`_  


  **Request Syntax**
  ::

    response = client.set_stack_policy(
        StackName='string',
        StackPolicyBody='string',
        StackPolicyURL='string'
    )
    
  :type StackName: string
  :param StackName: **[REQUIRED]** 

    The name or unique stack ID that you want to associate a policy with.

    

  
  :type StackPolicyBody: string
  :param StackPolicyBody: 

    Structure that contains the stack policy body. For more information, see `Prevent updates to stack resources <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html>`__ in the *CloudFormation User Guide*. You can specify either the ``StackPolicyBody`` or the ``StackPolicyURL`` parameter, but not both.

    

  
  :type StackPolicyURL: string
  :param StackPolicyURL: 

    Location of a file that contains the stack policy. The URL must point to a policy (maximum size: 16 KB) located in an Amazon S3 bucket in the same Amazon Web Services Region as the stack. The location for an Amazon S3 bucket must start with ``https://``. URLs from S3 static websites are not supported.

     

    You can specify either the ``StackPolicyBody`` or the ``StackPolicyURL`` parameter, but not both.

    

  
  
  :returns: None