-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Import does not work for resources accessible from endpoint different from region #8154
Comments
Hi @begault 👋 Sorry you are running into trouble here. By chance, you may be able to work around this once version 2.5.0 of the Terraform AWS Provider is released later this week. We added support for customizing all service endpoints in #8096 which was merged yesterday. I believe you should be able to setup something like the following once this is released: provider "aws" {
region = "eu-west-1"
endpoints {
opsworks = "https://opsworks.us-east-1.amazonaws.com"
}
} If you are working with new and old OpsWorks resources, I would recommend creating a separate provider alias (see also: the Terraform documentation on multiple provider instances) to handle those special older resources just to ensure new resources do not wind up in provider "aws" {
alias = "opsworks-us-east-1"
region = "eu-west-1"
endpoints {
opsworks = "https://opsworks.us-east-1.amazonaws.com"
}
}
resource "aws_opsworks_rails_app_layer" "rails_app" {
provider = "aws.opsworks-us-east-1"
# ... other configuration ...
} If you do use provider aliases, just don't forget the |
The endpoint customization I mentioned above has been released in version 2.5.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. Would definitely like to know if it helps in anyway. |
Hello @bflad Thank you very much for your valuable help. I've tried today the new feature. here is my
Here is the error:
I've seen that in the changelog of AWS provider the terraform 0.11.13 is not compatible anymore with the new feature las update. (https://github.com/terraform-providers/terraform-provider-aws/blob/master/CHANGELOG.md#250-april-05-2019) Do you think my problem is related & I need to wait for the terraform 0.12 version as well to be released ? |
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! |
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. |
Community Note
Terraform Version
Terraform v0.11.13
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/begault/a65cef85542bc19e4569904f2bdc443e
Panic Output
Expected Behavior
The API endpoint for resources can be overridden and the host can be:
Host: opsworks.us-east-1.amazonaws.com
even if the default region iseu-west-1
Actual Behavior
When using Opsworks console, I get the following url :
.../opsworks/home?region=eu-west-1&endpoint=us-east-1/...
.This is due to Opsworks history. All API endpoints are pointing to
us-east-1
, even if the instances are ineu-west-1
.When I want to import a layer or another type of resource, I get the following error:
When checking the endpoint of the aws API request, I notice that the endpoint region used is the default region given and cannot be overridden independently.
See: https://gist.github.com/begault/a65cef85542bc19e4569904f2bdc443e#file-terraform_layers_output-txt-L231
Where the host used is:
Host: opsworks.eu-west-1.amazonaws.com
The import task does not find the resource as it's not looking to the right endpoint.
Steps to Reproduce
This bug is hard to reproduce as you need to have an Opsworks architecture which has been created before the endpoint regions opening.
Important Factoids
References
The text was updated successfully, but these errors were encountered: