In my AWS CDK code for setting up EC2, I’m trying to put a local file to a certain location in my instance.
The only overcomplicated way I can think of is to upload it to s3 in the CDK code, and then
// download from s3 to instance
const localPath = instance.userData.addS3DownloadCommand({
bucket:asset.bucket,
bucketKey:asset.s3ObjectKey
// move
instance.user_data.add_commands(
"#!/bin/bash",
"mv {localPath} dst”
)
You can use cloudInit