I'm trying to set an environment variable using sceptre !cmd hooks(before create/update), which can be then resolved by sceptre_user_data with !environment_variable resolver within the same config file.
The command works well, when executed from shell, but for some reason, the !cmd hook doesn't perform assignment during runtime
Don't know, if I'm missing anything here
hooks:
before_create:
- !cmd "export OBJECT_VERSION=$(aws s3api put-object --body file --bucket bucket-name --key path --query 'VersionId')"
sceptre_user_data:
ObjectVersion: !environment_variable OBJECT_VERSION
Unfortunately you'd need a custom resolver for that at the moment
sceptre_plugins_cmd_extras.py
setup.py
But you'd then need to make your command idempotent (something like)