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.73k stars 9.09k forks source link

Unable import aws_cloudwatch_log_subscription_filter #9743

Closed ghost closed 3 years ago

ghost commented 5 years ago

This issue was originally opened by @odessky2 as hashicorp/terraform#20988. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.11.13

Terraform Configuration Files

resource "aws_cloudwatch_log_subscription_filter" "my_lambda_emailnotifications-defaults_logs" {
  name            = "${local.function_name}_logfilter"
  log_group_name  = "/aws/lambda/${local.function_name}"
  filter_pattern  = ""
  destination_arn = "arn:aws:kinesis:eu-west-2:*******:stream/flowlogs"
}

Debug Output

Coming soon

Expected Behavior

Import complete!

Actual Behavior

aws_cloudwatch_log_subscription_filter.my_lambda_emailnotifications-defaults_logs: Importing from ID "my-dev-emailconfirmationservice|my_lambda_emailnotifications_lambda"...
aws_cloudwatch_log_subscription_filter.my_lambda_emailnotifications-defaults_logs: Import complete!
  Imported aws_cloudwatch_log_subscription_filter (ID: cwlsf-4105373893)
aws_cloudwatch_log_subscription_filter.my_lambda_emailnotifications-defaults_logs: Refreshing state... (ID: cwlsf-4105373893)

Error: aws_cloudwatch_log_subscription_filter.my_lambda_emailnotifications-defaults_logs (import id: my-dev-emailconfirmationservice|my_lambda_emailnotifications_lambda): 1 error(s) occurred:

* import aws_cloudwatch_log_subscription_filter.my_lambda_emailnotifications-defaults_logs result: cwlsf-4105373893: import aws_cloudwatch_log_subscription_filter.my_lambda_emailnotifications-defaults_logs (id: cwlsf-4105373893): Terraform detected a resource with this ID doesn't
exist. Please verify the ID is correct. You cannot import non-existent
resources using Terraform import.

Steps to Reproduce

terraform init terraform apply terraform import aws_cloudwatch_log_subscription_filter.my_lambda_emailnotifications-defaults_logs 'my-dev-emailconfirmationservice|my_lambda_emailnotifications_lambda'

github-actions[bot] commented 3 years ago

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

github-actions[bot] commented 2 years 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.