hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.84k stars 9.19k forks source link

Neptune create from snapshot results in "InvalidParameterValue: The parameter ResourceName must be provided and must not be blank." #11752

Closed trillom closed 1 year ago

trillom commented 4 years ago

I'm seeing a similar issue to #5360, but when provisioning a Neptune cluster with tagging from an existing snapshot.

Error: error updating Neptune Cluster () tags: error tagging resource (): InvalidParameterValue: The parameter ResourceName must be provided and must not be blank.
    status code: 400, request id: ***

Community Note

Terraform Version

Terraform v0.12.20
+ provider.aws v2.46.0

Affected Resource(s)

Terraform Configuration Files

resource "aws_neptune_cluster" "default" {
  cluster_identifier        = var.snapshot_identifier == null ? var.cluster_identifier : "${var.cluster_identifier}-restored"
  apply_immediately         = var.apply_immediately
  backup_retention_period   = var.retention_period
  engine                    = var.engine
  engine_version            = var.engine_version
  final_snapshot_identifier = "${var.cluster_identifier}-${local.now}-final"
  neptune_subnet_group_name = aws_neptune_subnet_group.default.id
  port                      = var.port
  preferred_backup_window   = var.backup_window
  skip_final_snapshot       = var.skip_final_snapshot
  snapshot_identifier       = var.snapshot_identifier

  # Encryption
  storage_encrypted       = true
  kms_key_arn             = data.aws_kms_key.default.arn

  vpc_security_group_ids = [ var.clusterwide_sg == "" ? aws_security_group.default[0].id : var.clusterwide_sg ]

  tags = merge(local.common_tags, {})
}

Debug Output

Expected Behavior

Neptune Cluster created from snapshot

Actual Behavior

Above error is thrown, base cluster is created, but apply fails and instances are not created.

Steps to Reproduce

  1. terraform apply

References

jayvee1110 commented 4 years ago

Still no solution for this?

kalyansundar commented 4 years ago

still it is continuing, is there any timeline to give a solution for this ?

We are trying to create a new cluster with encryption by an existing Neptune cluster snapshot, but could not do for this reason

my info

Terraform v0.12.29
+ provider.aws v3.7.0
nikolaykolev commented 3 years ago

I've hit the same issue today, it seems it's still not fixed :(

chungath commented 3 years ago

I could fix it locally by doing the !d.IsNewResource() check in aws/resource_aws_neptune_cluster.go#L678.

Existing Code if d.HasChange("tags") { Fix if !d.IsNewResource() && d.HasChange("tags") { Basically, only tag during actual resource update. Similar to the fix done to the RDS issue mentioned above.

I was able to build terraform-provider-aws with the fix and validate it by creating the neptune cluster from a snapshot.

However, I am not able to run the tests. Also, am not able to create a pull request. git push fails with the following error:

remote: Permission to hashicorp/terraform-provider-aws.git denied to chungath.

Can someone take this change and process it?

santoshdevops119 commented 3 years ago

The issue still persists and its a blocker for planning disaster recovery automation via terraform for neptune DB. Can someone please fix this.

NasAmin commented 3 years ago

@chungath Sounds like you have a fix for this. Did you apply a fix to a fork or did you directly clone this repo and made changes to it?

I think you should be able to push to a fork and then create a PR from it on this repo.

FarhanKhan-sains commented 3 years ago

Is there any workaround for this issue?

chungath commented 3 years ago

The workaround is to not create any tags on the neptune cluster.

FarhanKhan-sains commented 3 years ago

@chungath Thanks, that seems to have fixed the issue for now

justinretzolk commented 2 years ago

Hey y'all 👋 Thank you for taking the time to file this issue, and for the ongoing discussion. Given that there's been a number of AWS provider releases since the last update on this issue, can anyone confirm whether you're still experiencing this behavior?

tachang commented 2 years ago

I just ran into it as well. Tried to create from snapshot and wouldn't let me due to tags. Removed them and it worked.

danielcweber commented 2 years ago

25972 attempts to fix this. It's basically tries to include the change proposed by @chungath, though the referenced file has moved/changed. @chungath: Maybe you could have a quick look whether it captures your intent.

I'm neither familiar with Terraform nor Go but rather trying to get an internal showstopper resolved.

@justinretzolk

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.