Skip to content
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

Issue importing an aws_appautoscaling_policy for a DynamoDB Table #21152

Closed
scampuza opened this issue Apr 29, 2019 · 3 comments
Closed

Issue importing an aws_appautoscaling_policy for a DynamoDB Table #21152

scampuza opened this issue Apr 29, 2019 · 3 comments

Comments

@scampuza
Copy link

Hi there,

I´m using Terraform v0.11.11 with the AWS Provider to import some existing resources into the Terraform state.

Trying to import some existing DynamoDB aws_appautoscaling_policy policies, I´m getting the following errors:

terraform import aws_appautoscaling_policy.dynamodb_table_read_policy dynamodb/table/visitors/dynamodb:table:ReadCapacityUnits/DynamoDBReadCapacityUtilization:table/visitors

Error: aws_appautoscaling_policy.dynamodb_table_read_policy (import id: dynamodb/table/visitors/dynamodb:table:ReadCapacityUnits/DynamoDBReadCapacityUtilization:table/visitors): 1 error(s) occurred:

  • import aws_appautoscaling_policy.dynamodb_table_read_policy result: visitors: aws_appautoscaling_policy.dynamodb_table_read_policy: Failed to read scaling policy: Error retrieving scaling policies: ValidationException: 1 validation error detected: Value 'DynamoDBReadCapacityUtilization:table' at 'scalableDimension' failed to satisfy constraint: Member must satisfy enum value set: [dynamodb:table:ReadCapacityUnits, dynamodb:index:ReadCapacityUnits, rds:cluster:ReadReplicaCount, elasticmapreduce:instancefleet:SpotCapacity, appstream:fleet:DesiredCapacity, dynamodb:index:WriteCapacityUnits, elasticmapreduce:instancefleet:OnDemandCapacity, rds:cluster:Capacity, dynamodb:table:WriteCapacityUnits, custom-resource:ResourceType:Property, sagemaker:variant:DesiredInstanceCount, ec2:spot-fleet-request:TargetCapacity, elasticmapreduce:instancegroup:InstanceCount, ecs:service:DesiredCount]
    status code: 400, request id: 3ffdf95e-6ad8-11e9-ae6d-234730bc25aa

According to the Terraform official documentation

https://www.terraform.io/docs/providers/aws/r/appautoscaling_policy.html

The right way for importing this kind of resources is as follows:

Application AutoScaling Policy can be imported using the service-namespace , resource-id, scalable-dimension and policy-name separated by /.

$ terraform import aws_appautoscaling_policy.test-policy service-namespace/resource-id/scalable-dimension/policy-name

But seems like I´m having issues because in my particular case, I have some / in some of the parameters:

"name": "DynamoDBReadCapacityUtilization:table/visitors",
"resource_id": "table/visitors"

I´ve tried even Escaping those forward slashes and using double and single quotes for the parameters, with the same result.

I would really appreciate some help with this issue.

Thanks a lot !

@zarnovican
Copy link

This issue is IMHO a duplicate of hashicorp/terraform-provider-aws#8306.

@ghost
Copy link

ghost commented May 31, 2019

This issue has been automatically migrated to hashicorp/terraform-provider-aws#8825 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to hashicorp/terraform-provider-aws#8825.

@ghost ghost closed this as completed May 31, 2019
@ghost
Copy link

ghost commented Jul 25, 2019

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.

@ghost ghost locked and limited conversation to collaborators Jul 25, 2019
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants