-
Notifications
You must be signed in to change notification settings - Fork 276
terraform-bin state rm ::debug::stdout: #167
Copy link
Copy link
Closed
Description
When running this code in a GitHub action:
- name: Terraform Remove Permanent Resources From State
env:
TF_ACTION_WORKING_DIR: 'terraform'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
cd terraform
cp terraform.tfstate tempstate
ECSTASKS=$(terraform state list | grep "aws_ecs_task_definition")
for ECSTASK in $ECSTASKS
do
terraform state rm $ECSTASK
done
I get the following output
terraform-bin state rm aws_ecs_task_definition.task
Removed aws_ecs_task_definition.task
Successfully removed 1 resource instance(s).
terraform-bin state rm ::debug::stdout:
Error: Variable name required
on line 1:
(source code not available)
Must begin with a variable name.
The removal of aws_ecs_task_definition.task is correct. This code has been tested outside of Github actions and works correctly. When I echo $ECSTASKS, I only get aws_ecs_task_definition.task showing the loop is running once with the correct info.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels