CmdID / aws / aws route53resolver
aws route53resolver put-resolver-rule-policy
Specifies an Amazon Web Services 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. AWS CLI reference
1 example 2 options Its page in the AWS CLI reference
Examples
To share a Resolver rule with another AWS account
The following put-resolver-rule-policy example specifies a Resolver rule that you want to share with another AWS account, the account that you want to share the rule with, and the rule-related operations that you want the account to be able to perform on the rules.
Note You must run this command using credentials from the same account that created the rule.
aws route53resolver put-resolver-rule-policy --arn "arn:aws:route53resolver:us-west-2:123456789111:resolver-rule/rslvr-rr-42b60677c0example" --resolver-rule-policy "{\"Version\": \"2012-10-17\", \"Statement\": [ { \"Effect\" : \"Allow\", \"Principal\" : {\"AWS\" : \"123456789222\" }, \"Action\" : [ \"route53resolver:GetResolverRule\", \"route53resolver:AssociateResolverRule\", \"route53resolver:DisassociateResolverRule\", \"route53resolver:ListResolverRules\", \"route53resolver:ListResolverRuleAssociations\" ], \"Resource\" : [ \"arn:aws:route53resolver:us-west-2:123456789111:resolver-rule/rslvr-rr-42b60677c0example\" ] } ] }"Identify--arnThe Amazon Resource Name (ARN) of the rule that you want to share with another account.--resolver-rule-policyAn Identity and Access Management policy statement that lists the rules that you want to share with another Amazon Web Services account and the operations that you want the account to be able to perform.Its output
{
"ReturnValue": true
}After you run put-resolver-rule-policy, you can run the following two Resource Access Manager (RAM) commands. You must use the account that you want to share the rule with:
get-resource-share-invitations returns the value resourceShareInvitationArn. You need this value to accept the invitation to use the shared rule.
accept-resource-share-invitation accepts the invitation to use the shared rule.
For more information, see the following documentation:
get-resource-share-invitations
accept-resource-share-invitations
Sharing Forwarding Rules with Other AWS Accounts and Using Shared Rules in the Amazon Route 53 Developer Guide.
Options
--arnThe Amazon Resource Name (ARN) of the rule that you want to share with another account.--resolver-rule-policyAn Identity and Access Management policy statement that lists the rules that you want to share with another Amazon Web Services account and the operations that you want the account to be able to perform.