-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Add hostname property for aws_transfer_server #6956
Comments
Hi @dbuzolin-nfl 👋 Can you verify creating Route53 records is correct? #6639 (comment) There is not currently anything in the AWS Transfer API to set this: https://docs.aws.amazon.com/transfer/latest/userguide/API_CreateServer.html If so, maybe we should add an example |
Creation of the SFTP service from AWS console allows entering DNS name for service and then it creates CNAME entry in route53 for you. Two tags show up in sftp service, ex: aws:transfer:route53HostedZoneId | /hostedzone/ABCDEFGHIGFK Can we use this route (tags) - since they are "aws.*" ? |
I see when I create the service manually, via console, it adds this tag which reflects the hostname:"aws:transfer:customHostname" But when i try to apply this via TF, it successfully appears that it applied it, but it doesn't show up, and then when I run the plan again it shows that it is needed and isn't there. |
Yeah, probably because "aws.*" tags are considered "system" tags and can't be applied externally? Just a guess... |
That's how the AWS console is doing it (see the XHR requests made from the browser): {
"headers": {
"X-Amz-User-Agent": "aws-sdk-js/2.41.0 promise",
"Content-Type": "application/x-amz-json-1.1",
"X-Amz-Target": "TransferService.TagResource"
},
"path": "/",
"method": "POST",
"region": "eu-central-1",
"params": {},
"contentString": "{\"Arn\":\"arn:aws:transfer:eu-central-1:123456789012:server/s-12345678901234567\",\"Tags\":[{\"Key\":\"aws:transfer:customHostname\",\"Value\":\"sftp.example.com\"}]}",
"operation": "tagResource"
} I think it's appropriate here to allow creating |
any update? |
Workaround: if the AWSCLI is installed on the machine where you're running Terraform, you can use
|
Has anyone had any success using @nickvollmar 's method, but with a non-Route53-hosted customHostname? I did the following:
but no matter what I do, it keeps throwing "Invalid ARN", including when I try the CLI directly:
I've tried literally copying and pasting the ARN from the contentString, from within the POST request in my browser's DevTools network panel, but I still get the same problem. I've also had 2 other people confirm that my request matches character-for-character, including re-typing the entire thing in the unlikely event that a homograph was unintentionally being copied. Finally, I've tried destroying and re-building the resource several times, just in case it was some weird issue with a specific instance, but no dice. I'm pulling my hair out here, but I don't know what else to try. Anyone have any ideas? EDIT: For anyone finding this later, the solution was something very simple but not documented anywhere: you must specifically define the region that the SFTP server lives in, using the "--region" argument. For example:
|
Hi, @dbuzolin-nfl! Thank you for using Terraform and for opening up this question. Issues on GitHub are intended to be related to bugs or feature requests with the provider codebase. I looks like you've gotten some great feedback and solutions i this thread. Please use https://discuss.hashicorp.com/c/terraform-providers for additional feedback, community discussions, and questions around Terraform. If you believe that your issue was miscategorized as a question or closed in error, please create a new issue using one of the following provided templates: bug report or feature request. Please make sure to provide us with the appropriate information so we can best determine how to assist with the given issue. |
@nickvollmar's workaround only partly solves this - the |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Is there way to add hostname property to transfer service, and/or also integrate it with Route53? Current implementation creates service with empty hostname: "-"
The text was updated successfully, but these errors were encountered: