Oran Erez
05/04/2023, 8:46 AMmodule.snowflake.snowflake_role_grants.bp_role_to_admins["SUPPORT LEADERS"]
As can be seen there is a space between SUPPORT and LEADERS words.
The issue is that I'm also using targeting resources on daily basis.
As a result that leads me to use the following syntax in order to use the targeting option:
atlantis plan -p stg-us-west-2 -- -target='module.snowflake.snowflake_role_grants.bp_role_to_admins["SUPPORT LEADERS"]'
and the support of built-in environment variable COMMENT_ARGS
with some customization workflow to manipulate the give string (could be few resources as well), i.e.:
- env:
name: TARGET_PARAMS
command: echo "$COMMENT_ARGS" | sed s/'\\'/''/g | sed 's/,/ /g'
- run: terraform init -input=false
- run: terraform workspace select $WORKSPACE
- run: terraform plan $TARGET_PARAMS -input=false -refresh -out $PLANFILE
Atlantis is not able to handle the space correctly, no matter what manipulation i'm trying to do end up with the following error:
|
│ Error: Invalid target "module.snowflake.snowflake_role_grants.bp_role_to_admins[SUPPORT"
│
│ Index brackets must contain either a literal number or a literal string.
|
Is there a way to handle the space while keeping the resource name intact?
Thanks in advanced.PePe Amengual
05/04/2023, 3:42 PMOran Erez
05/04/2023, 3:43 PM