//snippet-sourcedescription:[This IAM policy demonstrates how to grant read-only access to secrets that match a specific name pattern.]
//snippet-keyword:[IAM Policy]
//snippet-keyword:[Code Sample]
//snippet-keyword:[AWS Secrets Manager]
//snippet-service:[secretsmanager]
//snippet-sourcetype:[full-example]
//snippet-sourcedate:[]
//snippet-sourceauthor:[AWS]
//snippet-start:[secretsmanager.iam_policy.grants_access_to_secret_by_name_with_wildcard]
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "secretsmanager:DescribeSecret",
                "secretsmanager:List*"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": "secretsmanager:*",
            "Resource": [
                "arn:aws:secretsmanager:<region>:<account-id-number>:secret:a_specific_secret_name-a1b2c3",
                "arn:aws:secretsmanager:<region>:<account-id-number>:secret:another_secret_name-??????"
            ]
        }
    ]
}
//snippet-end:[secretsmanager.iam_policy.grants_access_to_secret_by_name_with_wildcard]