-
Notifications
You must be signed in to change notification settings - Fork 137
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
having trouble getting EIP to associate #14
Comments
@vtknightmare Can you share your full module declaration block? This seems like its the same as #8, but I still can't reproduce on my end. |
hey @jmhale, here you go: $ cat main.tf module "wireguard" { |
per various googling, people are referring to the count variable not being correct maybe? As in perhaps we are referring to something wrong? |
My workaround was to set the eip_id to "disabled" first and do the apply. Once the eip is created then I added the wireguard.id back in and ran apply again. This solved the problem for me. |
Quick solution is to apply separately: #8 (comment) Normal solution is to work on the code a little, like equalogic#2 |
Hey @jmhale
so, after many trials, I'm getting the following issue:
$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
module.wireguard.data.template_file.wg_client_data_json[0]: Refreshing state...
module.wireguard.data.aws_iam_policy_document.wireguard_policy_doc: Refreshing state...
module.wireguard.data.aws_ssm_parameter.wg_server_private_key: Refreshing state...
module.wireguard.data.aws_ami.ubuntu: Refreshing state...
module.wireguard.data.aws_iam_policy_document.ec2_assume_role: Refreshing state...
Error: Invalid count argument
on .terraform/modules/wireguard/wireguard-iam.tf line 28, in resource "aws_iam_policy" "wireguard_policy":
28: count = (var.eip_id != "disabled" ? 1 : 0) # only used for EIP mode
The "count" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the count depends on.
Error: Invalid count argument
on .terraform/modules/wireguard/wireguard-iam.tf line 36, in resource "aws_iam_role" "wireguard_role":
36: count = (var.eip_id != "disabled" ? 1 : 0) # only used for EIP mode
The "count" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the count depends on.
-0-0-0-0-0-0-0--0-00-0-0-0-0--00-0-0-0-0-0-0-
Now, if I manually provide the EIP id, it works but hilariously by creating it's OWN EIP that is WON'T associate with the EC2 instance it creates -_-
Any help here? What could I be missing?
The text was updated successfully, but these errors were encountered: