Magento-2-aws-cluster-terraform icon indicating copy to clipboard operation
Magento-2-aws-cluster-terraform copied to clipboard

IAM Instance Profile not available to "brand" user in user_data

Open youanden opened this issue 2 years ago • 1 comments

It looks like the IAM instance profile user is not available when calling commands like:

su ${parameter["BRAND"]} -s /bin/bash -c "git init -b main"

and errors with:

The following profile does not have credentials configured: default. You must configure the access key and secret key for the profile. For more information, see Configure an AWS CLI Profile in the AWS CLI User Guide.

For now I've rewritten to:

cd ${parameter["WEB_ROOT_PATH"]}
git init -b main
git remote add origin ${parameter["CODECOMMIT_APP_REPO"]}
git fetch origin main
git reset origin/main --hard
chown -R ${parameter["BRAND"]}:${parameter["PHP_USER"]} .

I don't know how to delegate the IAM instance role to another user.

youanden avatar Apr 01 '22 18:04 youanden

configuration related to s3 instance profile and user data will be rewritten also chown with many files can take very long time on startup

magenx avatar Apr 02 '22 08:04 magenx