Magento-2-aws-cluster-terraform
Magento-2-aws-cluster-terraform copied to clipboard
IAM Instance Profile not available to "brand" user in user_data
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.
configuration related to s3
instance profile
and user data
will be rewritten
also chown with many files can take very long time on startup