putResolverRulePolicy method

Future<PutResolverRulePolicyResponse> putResolverRulePolicy({
  1. required String arn,
  2. required String resolverRulePolicy,
})

Specifies an AWS rule that you want to share with another account, the account that you want to share the rule with, and the operations that you want the account to be able to perform on the rule.

May throw InvalidPolicyDocument. May throw InvalidParameterException. May throw UnknownResourceException. May throw InternalServiceErrorException.

Parameter arn : The Amazon Resource Name (ARN) of the rule that you want to share with another account.

Parameter resolverRulePolicy : An AWS Identity and Access Management policy statement that lists the rules that you want to share with another AWS account and the operations that you want the account to be able to perform. You can specify the following operations in the Action section of the statement:

  • route53resolver:GetResolverRule
  • route53resolver:AssociateResolverRule
  • route53resolver:DisassociateResolverRule
  • route53resolver:ListResolverRules
  • route53resolver:ListResolverRuleAssociations
In the Resource section of the statement, specify the ARN for the rule that you want to share with another account. Specify the same ARN that you specified in Arn.

Implementation

Future<PutResolverRulePolicyResponse> putResolverRulePolicy({
  required String arn,
  required String resolverRulePolicy,
}) async {
  ArgumentError.checkNotNull(arn, 'arn');
  _s.validateStringLength(
    'arn',
    arn,
    1,
    255,
    isRequired: true,
  );
  ArgumentError.checkNotNull(resolverRulePolicy, 'resolverRulePolicy');
  _s.validateStringLength(
    'resolverRulePolicy',
    resolverRulePolicy,
    0,
    5000,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Route53Resolver.PutResolverRulePolicy'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Arn': arn,
      'ResolverRulePolicy': resolverRulePolicy,
    },
  );

  return PutResolverRulePolicyResponse.fromJson(jsonResponse.body);
}