How to apply default policies to cloudformation or terraform in aws?

With terraform or cloudformation, we can apply individual permissions while creating a policy.

But how to select default predefined policies like AWSRDSReadyOnlyAccess, like these to the terraform template


Using the ManagedPolicyArns property. Here's how you do it using CloudFormation

DmsCloudwatchServiceRole:
    Type: AWS::IAM::Role
    Properties:
        RoleName: dms-cloudwatch-logs-role
        Description: "Role to allow DMS to write to Cloudwatch Logs. Role name must not be changed as DMS requires this exact role name."
        AssumeRolePolicyDocument:
            Version: 2012-10-17
            Statement:
                -
                    Effect: Allow
                    Principal:
                        Service:
                            - dms.amazonaws.com
                    Action:
                        - sts:AssumeRole
        Path: /
        ManagedPolicyArns:
         - arn:aws:iam::aws:policy/service-role/AmazonDMSCloudWatchLogsRole

I'm not 100% sure this is the question you're asking, the question is a little imprecise.