There are multiple ways to do it. One is to assume to transform AUC to cohen's D and then just sample data from 2 standard normal distributions D standard deviations apart.
We can transform AUC to D according to a formula from SALGADO, Jesús F.. Transforming the Area under the Normal Curve (AUC) into Cohen’s d, Pearson’s r pb , Odds-Ratio, and Natural Log Odds-Ratio: Two Conversion Tables. The European Journal of Psychology Applied to Legal Context [online]. 2018, vol.10, n.1, pp.35-47. ISSN 1989-4007. http://dx.doi.org/10.5093/ejpalc2018a5
Which in R code will work like this
auc <- 0.95
t <- sqrt(log(1/(1-auc)**2))
z <- t-((2.515517 + 0.802853*t + 0.0103328*t**2) /
(1 + 1.432788*t + 0.189269*t**2 + 0.001308*t**3))
d <- z*sqrt(2)
n <- 10000
x <- c(rnorm(n/2, mean = 0), rnorm(n/2, mean = d))
y <- c(rep(0, n/2), rep(1, n/2))
library(AUC)
auc(roc(x, as.factor(y)))
# out
# [1] 0.9486257
Of course, since we are sampling, this will produce the correct AUC on average, but the specific sample will not be exactly the required AUC.