Skip to content

put_firewall_rule_group_policy

put_firewall_rule_group_policy(
    arn: Arn,
    firewall_rule_group_policy: FirewallRuleGroupPolicy,
    *,
    config_overrides: Optional[Route53ResolverClientConfig] = None,
) -> PutFirewallRuleGroupPolicyResponse

Attaches an Identity and Access Management (Amazon Web Services IAM) policy for sharing the rule group. You can use the policy to share the rule group using Resource Access Manager (RAM).

Parameters:

  • arn (Arn) –

    The ARN (Amazon Resource Name) for the rule group that you want to share.

  • firewall_rule_group_policy (FirewallRuleGroupPolicy) –

    The Identity and Access Management (Amazon Web Services IAM) policy to attach to the rule group.

Raises:

  • AccessDeniedException –

    The current account doesn't have the IAM permissions required to perform the specified Resolver operation.

    This error can also be thrown when a customer has reached the 5120 character limit for a resource policy for CloudWatch Logs.

  • InternalServiceErrorException –

    We encountered an unknown error. Try again in a few minutes.

  • ResourceNotFoundException –

    The specified resource doesn't exist.

  • ThrottlingException –

    The request was throttled. Try again in a few minutes.

  • ValidationException –

    You have provided an invalid command. If you ran the UpdateFirewallDomains request. supported values are ADD, REMOVE, or REPLACE a domain.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_route53resolver/_services/route53_resolver.py
def put_firewall_rule_group_policy(
    self,
    arn: "capo_route53resolver.types.arn.Arn",
    firewall_rule_group_policy: "capo_route53resolver.types.firewall_rule_group_policy.FirewallRuleGroupPolicy",
    *,
    config_overrides: Optional[Route53ResolverClientConfig] = None,
) -> "capo_route53resolver.types.put_firewall_rule_group_policy_response.PutFirewallRuleGroupPolicyResponse":
    """<p>Attaches an Identity and Access Management (Amazon Web Services IAM) policy for sharing the rule group. You can use the policy to share the rule group using Resource Access Manager (RAM). </p>

    Args:
        arn: <p>The ARN (Amazon Resource Name) for the rule group that you want to share.</p>
        firewall_rule_group_policy: <p>The Identity and Access Management (Amazon Web Services IAM) policy to attach to the rule group.</p>

    Raises:
        capo_route53resolver.errors.access_denied_exception.AccessDeniedException: <p>The current account doesn't have the IAM permissions required to perform the specified Resolver operation.</p> <p>This error can also be thrown when a customer has reached the 5120 character limit for a resource policy for CloudWatch Logs.</p>
        capo_route53resolver.errors.internal_service_error_exception.InternalServiceErrorException: <p>We encountered an unknown error. Try again in a few minutes.</p>
        capo_route53resolver.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource doesn't exist.</p>
        capo_route53resolver.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Try again in a few minutes.</p>
        capo_route53resolver.errors.validation_exception.ValidationException: <p>You have provided an invalid command. If you ran the <code>UpdateFirewallDomains</code> request. supported values are <code>ADD</code>, <code>REMOVE</code>, or <code>REPLACE</code> a domain.</p>
        capo_route53resolver.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_route53resolver.types.put_firewall_rule_group_policy_request.PutFirewallRuleGroupPolicyRequest]",
    ) -> OperationResponse[
        "capo_route53resolver.types.put_firewall_rule_group_policy_response.PutFirewallRuleGroupPolicyResponse"
    ]:
        import capo_route53resolver._operations.route53_resolver.put_firewall_rule_group_policy

        output, http_response = (
            capo_route53resolver._operations.route53_resolver.put_firewall_rule_group_policy.put_firewall_rule_group_policy(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutFirewallRuleGroupPolicy")
    )
    input_: capo_route53resolver.types.put_firewall_rule_group_policy_request.PutFirewallRuleGroupPolicyRequest = {
        "arn": arn,
        "firewall_rule_group_policy": firewall_rule_group_policy,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output