-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: changes to lifecycle_commands
and/or interpreter
should not be follwed by changes to other arguments
#106
Comments
Yes, this is irksome for me also, since I'm using the shell resource to do git manipulation across multiple repositories. The environment contains a hash (of git ls-remote) that indicates which repositories have changed and need updating. Since the for_each contains around 250 repositories; at least one of them always has a change. So it's practically impossible to change the script since one of those 250 repositories will have changed and hence the environment will have changed. I have to keep 'state rm'-ing the relevant portions. Can we lift this restriction? |
I am running into the same error with a almost identical config. It's a pitty, because if that would work, it'd be a really clean and native way to integrate a shell. E.g. to call ansible-playbook in an ENV that is feed from Terraform, very handy .... resource "shell_script" "call_ansible" { |
There should at least be an option to override this. It is probably a decent restriction most of the time, but for me it just makes one MR turn into about 3-4. |
@scottwinkler there is a typo in this message follwed -> followed 😅 |
@Ninlives has forked this repo and removed the "changes to Provider: Allow change lifecycle_commands and environment together commit: |
we are using shell_script resource to create IBM VPN server, first time creation resource creation worked perfectly but second time when we run plan getting below error
Error: changes to
lifecycle_commands
and/orinterpreter
should not be follwed by changes to other argumentsHere is our TF code
resource "shell_script" "vpn_server_route" {
lifecycle_commands {
create = file("${path.module}/scripts/create-vpn-route.sh")
read = file("${path.module}/scripts/read-vpn-route.sh")
delete = file("${path.module}/scripts/delete-vpn-route.sh")
}
environment = {
REGION = var.region
RESOURCE_GROUP = var.resource_group_name
VPC_NAME = var.vpc_name
VPN_SERVER_NAME = var.vpn_instance_name
API_KEY = var.ibmcloud_api_key
}
working_directory = path.module
}
The text was updated successfully, but these errors were encountered: